Skip to content

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

Description

@lcartey

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-MediumPhase IIIStandard-AUTOSARfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions