mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
patch upper-case acronyms to be PascalCase
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user