Skip to content

Commit a2ffd4c

Browse files
authored
Merge pull request #853 from github/lcartey/make-a3-1-5-audit
`A3-1-5`: Down grade to an "audit" query.
2 parents 737305f + 939ab79 commit a2ffd4c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A3-1-5` - `NonTrivialNonTemplateFunctionDefinedInsideClassDefinition.ql`:
2+
- 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.

cpp/autosar/src/rules/A3-1-5/NonTrivialNonTemplateFunctionDefinedInsideClassDefinition.ql

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
* @description A function that is not either trivial, a template function, or a member of a
55
* template class may not be defined within a class body.
66
* @kind problem
7-
* @precision very-high
7+
* @precision low
88
* @problem.severity recommendation
99
* @tags external/autosar/id/a3-1-5
10+
* external/autosar/audit
1011
* external/autosar/allocated-target/design
1112
* external/autosar/enforcement/partially-automated
1213
* external/autosar/obligation/required

cpp/autosar/test/rules/A3-1-5/test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,4 @@ int FooBar::f1(int a, int b) { // COMPLIANT not a trivial function
188188
;
189189
;
190190
}
191-
}
191+
}

rule_packages/cpp/Classes.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@
182182
"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.",
183183
"kind": "problem",
184184
"name": "A function shall be defined with a class body if and only if it is intended to be inlined",
185-
"precision": "very-high",
185+
"precision": "low",
186186
"severity": "recommendation",
187187
"short_name": "NonTrivialNonTemplateFunctionDefinedInsideClassDefinition",
188-
"tags": []
188+
"tags": [
189+
"external/autosar/audit"
190+
]
189191
}
190192
],
191193
"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."

0 commit comments

Comments
 (0)