mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
fix some more style-guide violations in the alert-messages
This commit is contained in:
@@ -25,4 +25,4 @@ from SanGuard guard
|
||||
where
|
||||
not exists(TypeExpr t | t.getResolvedType().(ClassType).getDeclaration() = guard) and
|
||||
not guard.hasAnnotation("deprecated")
|
||||
select guard, "Guard class is not mentioned anywhere"
|
||||
select guard, "Guard class is not mentioned anywhere."
|
||||
|
||||
@@ -19,4 +19,4 @@ where
|
||||
not call.getLocation().getFile().getAbsolutePath().matches("%/" + ["meta", "test"] + "/%") and
|
||||
not call.getLocation().getFile().getBaseName().toLowerCase() =
|
||||
["consistency.ql", "test.ql", "tst.ql", "tests.ql"]
|
||||
select call, "Don't use .getAQlClass"
|
||||
select call, "Don't use '.getAQlClass()'."
|
||||
|
||||
@@ -27,4 +27,4 @@ Import importBefore(Import i) {
|
||||
|
||||
from Import i
|
||||
where isStdLibImport(i, _) and exists(importBefore(i))
|
||||
select i, "This import may cause reevaluation to occur, as there are other imports preceding it"
|
||||
select i, "This import may cause reevaluation to occur, as there are other imports preceding it."
|
||||
|
||||
@@ -161,5 +161,5 @@ predicate transitiveDelta(Call rec, TransitivelyClosedCall tc) {
|
||||
|
||||
from Call rec, TransitivelyClosedCall tc, AstNode reason
|
||||
where transitiveDelta(rec, tc) and reason = tc.getReason()
|
||||
select tc, "This recursive delta is transively closed $@, which may be a performance problem.",
|
||||
reason, "here"
|
||||
select tc, "This recursive delta $@, which may be a performance problem.", reason,
|
||||
"is transively closed"
|
||||
|
||||
@@ -31,5 +31,5 @@ where
|
||||
)
|
||||
) and
|
||||
(if clz = implClz then extraMsg = "." else extraMsg = " of any class between it and $@.")
|
||||
select clz, "The field $@ declared in $@ is not used in the characteristic predicate" + extraMsg,
|
||||
field, field.getName(), clz, clz.getName(), implClz, implClz.getName()
|
||||
select clz, "This class declares $@ that is not used in the characteristic predicate" + extraMsg,
|
||||
field, "field " + field.getName(), implClz, implClz.getName()
|
||||
|
||||
@@ -14,4 +14,4 @@ import codeql_ql.style.AcronymsShouldBeCamelCaseQuery
|
||||
|
||||
from string name, AstNode node
|
||||
where shouldBePascalCased(name, node, _)
|
||||
select node, "Acronyms in " + name + " should be PascalCase/camelCase"
|
||||
select node, "Acronyms in " + name + " should be PascalCase/camelCase."
|
||||
|
||||
@@ -126,7 +126,7 @@ String avoidHere(Select sel, string part) {
|
||||
String avoidArticleInLinkText(Select sel) {
|
||||
result = sel.getExpr((any(int i | i > 1))) and
|
||||
result = getSelectPart(sel, _) and
|
||||
result.getValue().regexpMatch("a|an .*")
|
||||
result.getValue().regexpMatch("(a|an) .*")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,6 +203,9 @@ AstNode getAlertLocLink(Select sel) {
|
||||
from AstNode node, string msg, Select sel
|
||||
where
|
||||
not node.getLocation().getFile().getAbsolutePath().matches("%/test/%") and
|
||||
not node.getLocation().getFile().getAbsolutePath().matches("%/examples/%") and
|
||||
not node.getLocation().getFile().getAbsolutePath().matches("%/experimental/%") and
|
||||
not node.getLocation().getFile().getAbsolutePath().matches("%/meta/%") and
|
||||
sel.getQueryDoc().getQueryKind() = ["problem", "path-problem"] and
|
||||
(
|
||||
node = shouldHaveFullStop(sel) and
|
||||
|
||||
@@ -12,4 +12,4 @@ import codeql_ql.style.DeadCodeQuery
|
||||
|
||||
from AstNode node
|
||||
where isDead(node)
|
||||
select node, "Code is dead"
|
||||
select node, "Code is dead."
|
||||
|
||||
@@ -22,4 +22,4 @@ where
|
||||
call.getEnclosingPredicate() = c.getCharPred() and call.getTarget() instanceof NewTypeBranch
|
||||
).getAnArgument() and
|
||||
not f.getVarDecl().overrides(_)
|
||||
select f, "Field is only used in CharPred"
|
||||
select f, "Field is only used in CharPred."
|
||||
|
||||
@@ -13,4 +13,4 @@ import codeql_ql.style.RedundantCastQuery
|
||||
|
||||
from AstNode node, TypeExpr type
|
||||
where redundantCast(node, type)
|
||||
select node, "Redundant cast to $@", type, type.getResolvedType().getName()
|
||||
select node, "Redundant cast to $@.", type, type.getResolvedType().getName()
|
||||
|
||||
@@ -13,4 +13,4 @@ import codeql_ql.style.RedundantOverrideQuery
|
||||
|
||||
from ClassPredicate pred, ClassPredicate sup
|
||||
where redundantOverride(pred, sup)
|
||||
select pred, "Redundant override of $@ predicate", sup, "this"
|
||||
select pred, "Redundant override of $@.", sup, "this predicate"
|
||||
|
||||
@@ -17,5 +17,5 @@ where
|
||||
usesCastingBasedInstanceof(c, type) or
|
||||
usesFieldBasedInstanceof(c, any(TypeExpr te | te.getResolvedType() = type), _, _)
|
||||
) and
|
||||
message = "consider defining $@ as non-extending subtype of $@"
|
||||
select c, message, c, c.getName(), type.getDeclaration(), type.getName()
|
||||
message = "Consider defining this class as non-extending subtype of $@."
|
||||
select c, message, type.getDeclaration(), type.getName()
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| Test.qll:2:11:2:15 | ClasslessPredicate isXML | Acronyms in isXML should be PascalCase/camelCase |
|
||||
| Test.qll:8:9:8:20 | NewType TXMLElements | Acronyms in TXMLElements should be PascalCase/camelCase |
|
||||
| Test.qll:10:3:10:13 | NewTypeBranch TXMLElement | Acronyms in TXMLElement should be PascalCase/camelCase |
|
||||
| Test.qll:2:11:2:15 | ClasslessPredicate isXML | Acronyms in isXML should be PascalCase/camelCase. |
|
||||
| Test.qll:8:9:8:20 | NewType TXMLElements | Acronyms in TXMLElements should be PascalCase/camelCase. |
|
||||
| Test.qll:10:3:10:13 | NewTypeBranch TXMLElement | Acronyms in TXMLElement should be PascalCase/camelCase. |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| Foo.qll:2:21:2:25 | ClasslessPredicate dead1 | Code is dead |
|
||||
| Foo.qll:6:13:6:17 | ClasslessPredicate dead2 | Code is dead |
|
||||
| Foo.qll:2:21:2:25 | ClasslessPredicate dead1 | Code is dead. |
|
||||
| Foo.qll:6:13:6:17 | ClasslessPredicate dead2 | Code is dead. |
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| Foo.qll:5:25:5:31 | InlineCast | Redundant cast to $@ | Foo.qll:5:28:5:30 | TypeExpr | Foo |
|
||||
| Foo.qll:7:33:7:39 | InlineCast | Redundant cast to $@ | Foo.qll:7:36:7:38 | TypeExpr | Foo |
|
||||
| Foo.qll:11:36:11:42 | InlineCast | Redundant cast to $@ | Foo.qll:11:39:11:41 | TypeExpr | Foo |
|
||||
| Foo.qll:5:25:5:31 | InlineCast | Redundant cast to $@. | Foo.qll:5:28:5:30 | TypeExpr | Foo |
|
||||
| Foo.qll:7:33:7:39 | InlineCast | Redundant cast to $@. | Foo.qll:7:36:7:38 | TypeExpr | Foo |
|
||||
| Foo.qll:11:36:11:42 | InlineCast | Redundant cast to $@. | Foo.qll:11:39:11:41 | TypeExpr | Foo |
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
| RedundantOverride.qll:9:18:9:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:5:9:5:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:21:18:21:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:17:9:17:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:110:24:110:27 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:106:15:106:18 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:124:18:124:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:118:9:118:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:128:18:128:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:118:9:118:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:132:18:132:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:128:18:128:21 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:150:18:150:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:140:9:140:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:164:18:164:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:158:9:158:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:158:9:158:12 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:172:18:172:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:176:18:176:21 | ClassPredicate pred | Redundant override of $@ predicate | RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | this |
|
||||
| RedundantOverride.qll:9:18:9:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:5:9:5:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:21:18:21:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:17:9:17:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:110:24:110:27 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:106:15:106:18 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:124:18:124:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:118:9:118:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:128:18:128:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:118:9:118:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:132:18:132:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:128:18:128:21 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:150:18:150:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:140:9:140:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:164:18:164:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:158:9:158:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:158:9:158:12 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:172:18:172:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | this predicate |
|
||||
| RedundantOverride.qll:176:18:176:21 | ClassPredicate pred | Redundant override of $@. | RedundantOverride.qll:168:18:168:21 | ClassPredicate pred | this predicate |
|
||||
|
||||
Reference in New Issue
Block a user