Skip to content

Commit

Permalink
Merge pull request #853 from github/lcartey/make-a3-1-5-audit
Browse files Browse the repository at this point in the history
`A3-1-5`: Down grade to an "audit" query.
  • Loading branch information
lcartey authored Feb 9, 2025
2 parents 737305f + 939ab79 commit a2ffd4c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions change_notes/2025-02-06-a3-1-5-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A3-1-5` - `NonTrivialNonTemplateFunctionDefinedInsideClassDefinition.ql`:
- Mark this as an `audit` query. As a consequence, it will no longer be run as part of the default query suite for AUTOSAR. It can still be run as part of the `autosar-audit.qls` query suite. The query has been downgraded because the rule allows for functions to be declared in the class body if they were "intended" to be inlined, and that developer intention cannot be determined automatically from the code.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
* @description A function that is not either trivial, a template function, or a member of a
* template class may not be defined within a class body.
* @kind problem
* @precision very-high
* @precision low
* @problem.severity recommendation
* @tags external/autosar/id/a3-1-5
* external/autosar/audit
* external/autosar/allocated-target/design
* external/autosar/enforcement/partially-automated
* external/autosar/obligation/required
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/test/rules/A3-1-5/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ int FooBar::f1(int a, int b) { // COMPLIANT not a trivial function
;
;
}
}
}
6 changes: 4 additions & 2 deletions rule_packages/cpp/Classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@
"description": "A function that is not either trivial, a template function, or a member of a template class may not be defined within a class body.",
"kind": "problem",
"name": "A function shall be defined with a class body if and only if it is intended to be inlined",
"precision": "very-high",
"precision": "low",
"severity": "recommendation",
"short_name": "NonTrivialNonTemplateFunctionDefinedInsideClassDefinition",
"tags": []
"tags": [
"external/autosar/audit"
]
}
],
"title": "A function definition shall only be placed in a class definition if (1) the function is intended to be inlined (2) it is a member function template (3) it is a member function of a class template."
Expand Down

0 comments on commit a2ffd4c

Please sign in to comment.