patch upper-case acronyms to be PascalCase

This commit is contained in:
Erik Krogh Kristensen
2022-03-11 11:10:33 +01:00
parent e3a15792fa
commit 69353bb014
422 changed files with 3532 additions and 2244 deletions

View File

@@ -27,13 +27,13 @@ predicate containsArray(Type t) {
)
}
predicate functionAPIViolation(MemberFunction f) {
predicate functionApiViolation(MemberFunction f) {
f.isPublic() and
containsArray(f.getAParameter().getType())
}
from MemberFunction m
where
functionAPIViolation(m) and
functionApiViolation(m) and
not m.getDeclaringType() instanceof Struct
select m, "Raw arrays should not be used in interfaces. A container class should be used instead."

View File

@@ -12,13 +12,13 @@
import cpp
// whether f is to be considered an API entry point, and hence reachable by default
predicate isAPI(Function f) {
predicate isApi(Function f) {
f.hasName("main") or
f.(MemberFunction).hasSpecifier("public")
}
predicate unusedFunction(Function f) {
not isAPI(f) and
not isApi(f) and
not exists(FunctionCall c | c.getTarget() = f) and
not exists(Access acc | acc.getTarget() = f) and
f.hasDefinition()