Skip to content

Commit adb3d0b

Browse files
committed
fix most ql/alert-message-style-violation
1 parent 38b23f1 commit adb3d0b

11 files changed

+18
-18
lines changed

go/ql/src/InconsistentCode/ConstantLengthComparison.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ where
3030
cond.dominates(idx.getBasicBlock()) and
3131
// and that check happens inside the loop body
3232
cond.getCondition().getParent+() = fs
33-
select cond.getCondition(),
34-
"This checks the length against a constant, but it is indexed using a variable $@.", idx, "here"
33+
select cond.getCondition(), "This checks the length against a constant, but it $@.", idx,
34+
"is indexed using a variable"

go/ql/src/InconsistentCode/MissingErrorCheck.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,5 @@ where
116116
// `deref` dereferences `ptr`
117117
deref.getOperand() = ptr.getAUse()
118118
select deref.getOperand(),
119-
ptr.getSourceVariable() + " may be nil here, because $@ may not have been checked.", err,
120-
err.getSourceVariable().toString()
119+
ptr.getSourceVariable() + " may be nil at this location, because $@ may not have been checked.",
120+
err, err.getSourceVariable().toString()

go/ql/src/RedundantCode/CompareIdenticalValues.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ where
2424
cmp.getAnOperand() = decl.getAReference() and
2525
cmp.getAnOperand() instanceof BasicLit
2626
)
27-
select cmp, "This expression compares $@ to itself.", cmp.getLeftOperand(), "an expression"
27+
select cmp, "This expression compares an $@ to itself.", cmp.getLeftOperand(), "expression"

go/ql/src/RedundantCode/DuplicateCondition.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ GVN conditionGvn(IfStmt is, int i, Expr e) {
3030

3131
from IfStmt is, Expr e, Expr f, int i, int j
3232
where conditionGvn(is, i, e) = conditionGvn(is, j, f) and i < j
33-
select f, "This condition is a duplicate of $@.", e, "an earlier condition"
33+
select f, "This condition is a duplicate of an $@.", e, "earlier condition"

go/ql/src/RedundantCode/DuplicateSwitchCase.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ GVN switchCaseGvn(SwitchStmt switch, int i, Expr e) {
2020

2121
from SwitchStmt switch, int i, Expr e, int j, Expr f
2222
where switchCaseGvn(switch, i, e) = switchCaseGvn(switch, j, f) and i < j
23-
select f, "This case is a duplicate of $@.", e, "an earlier case"
23+
select f, "This case is a duplicate of an $@.", e, "earlier case"

go/ql/src/RedundantCode/SelfAssignment.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ from PotentialSelfAssignment assgn, HashableNode rhs
2323
where
2424
rhs = assgn.getRhs() and
2525
rhs.hash() = assgn.getLhs().(HashableNode).hash()
26-
select assgn, "This statement assigns $@ to itself.", rhs, "an expression"
26+
select assgn, "This statement assigns an $@ to itself.", rhs, "expression"

go/ql/src/Security/CWE-022/TaintedPath.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ import DataFlow::PathGraph
2121

2222
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
2323
where cfg.hasFlowPath(source, sink)
24-
select sink.getNode(), source, sink, "$@ flows to here and is used in a path.", source.getNode(),
25-
"User-provided value"
24+
select sink.getNode(), source, sink, "This path depends on a $@.", source.getNode(),
25+
"user-provided value"

go/ql/src/Security/CWE-117/LogInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import DataFlow::PathGraph
1717

1818
from LogInjection::Configuration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink, source, sink, "This log write receives unsanitized user input from $@.",
21-
source.getNode(), "here"
20+
select sink.getNode(), source, sink, "Log entry depends on $@.", source.getNode(),
21+
"a user-provided value"

go/ql/src/Security/CWE-209/StackTraceExposure.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ class StackTraceExposureConfig extends TaintTracking::Configuration {
7777
from StackTraceExposureConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
7878
where cfg.hasFlowPath(source, sink)
7979
select sink.getNode(), source, sink,
80-
"Stack trace information from $@ may be exposed to an external user here.", source.getNode(),
81-
"here"
80+
"$@ flows to this location and may be exposed to an external user.", source.getNode(),
81+
"Stack trace information"

go/ql/src/Security/CWE-312/CleartextLogging.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import DataFlow::PathGraph
1919

2020
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where cfg.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "Sensitive data returned by $@ is logged here.",
23-
source.getNode(), source.getNode().(Source).describe()
22+
select sink.getNode(), source, sink, "$@ is logged at this location.", source.getNode(),
23+
"Sensitive data returned by " + source.getNode().(Source).describe()

go/ql/src/Security/CWE-643/XPathInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ predicate isStringOrByte(DataFlow::PathNode node) {
2424

2525
from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink
2626
where config.hasFlowPath(source, sink) and isStringOrByte(sink)
27-
select sink.getNode(), source, sink, "$@ flows to here and is used in an XPath expression.",
28-
source.getNode(), "User-provided value"
27+
select sink.getNode(), source, sink, "XPath expression depends on $@.", source.getNode(),
28+
"a user-provided value"

0 commit comments

Comments
 (0)