Skip to content

Commit 23a1bc3

Browse files
committed
Finalize A0-1-4 except finding a good fName
1 parent 09ab74e commit 23a1bc3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

cpp/common/src/codingstandards/cpp/rules/unusedparameter/UnusedParameter.qll

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Provides a library which includes a `problems` predicate for reporting unused parameters.
3-
*/
2+
* Provides a library which includes a `problems` predicate for reporting unused parameters.
3+
*/
44

55
import cpp
66
import codingstandards.cpp.Customizations
@@ -11,7 +11,7 @@ abstract class UnusedParameterSharedQuery extends Query { }
1111

1212
Query getQuery() { result instanceof UnusedParameterSharedQuery }
1313

14-
predicate isMaybeUnusedParameter(Parameter parameter) {
14+
query predicate isMaybeUnusedParameter(Parameter parameter) {
1515
parameter.getAnAttribute().toString() = "maybe_unused"
1616
}
1717

@@ -32,10 +32,13 @@ query predicate lambdaExprParamHasAccess(Parameter parameter) {
3232

3333
query predicate problems(UnusedParameter p, string message, Function f, string fName) {
3434
not isExcluded(p, getQuery()) and
35-
(not isMaybeUnusedParameter(p) and
36-
f = p.getFunction() and
37-
// Virtual functions are covered by a different rule
38-
not f.isVirtual()) and
35+
(
36+
not isMaybeUnusedParameter(p) and
37+
f = p.getFunction() and
38+
// Virtual functions are covered by a different rule
39+
not f.isVirtual()
40+
) and
3941
message = "Unused parameter '" + p.getName() + "' for function $@." and
40-
fName = f.getQualifiedName()
42+
// fName = f.getQualifiedName()
43+
fName = "TODO."
4144
}

0 commit comments

Comments
 (0)