Skip to content

A3-1-5: Tweak definition of trivial member function #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lcartey opened this issue Jun 3, 2024 · 0 comments · Fixed by #633
Closed

A3-1-5: Tweak definition of trivial member function #611

lcartey opened this issue Jun 3, 2024 · 0 comments · Fixed by #633
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Phase III Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Jun 3, 2024

Affected rules

  • A3-1-5

Description

This AUTOSAR rule is not strictly specified, only requiring that functions are included in class bodies when "intended to be inlined".

Our current heuristics aim to highlight non-trivial functions in class bodies as a proxy - essentially, we expect functions that occur in the body of the class to be "compact" - e.g. have few statements. However, feedback suggests we are flagging functions unnecessarily frequently, so we want to tweak the heuristics in the following way:

  • Use numbers of lines of code, instead of number of statements. As a consequence, macros will not be considered "expanded" (as with our previous statement based approach).
  • Increase the number of acceptable lines - perhaps around 8-10 to reduce likely false positives and developer fatigue.
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards labels Jun 3, 2024
@knewbury01 knewbury01 assigned knewbury01 and unassigned lcartey Jul 3, 2024
@knewbury01 knewbury01 moved this from Triaged to Ready for review in Coding Standards Public Development Board Jul 3, 2024
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Coding Standards Public Development Board Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Phase III Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

3 participants