Skip to content

A3-1-5: Down grade to an "audit" query. #853

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

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading