Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ql/ql/test/queries/performance/MissingNoInline/Test.qll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import ql
*
* This predicate exists to fix a join order.
*/
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { // $ Alert
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) {
// $ Alert
// BAD
add.getLeftOperand() = e1 and
add.getRightOperand() = e2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ predicate isXML() { any() } // $ Alert
predicate isAES() { any() }

// BAD
newtype TXMLElements = // $ Alert
newtype TXMLElements =
// $ Alert
TXmlElement() or // GOOD
TXMLElement() // $ Alert // BAD
Comment on lines 7 to 11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ module EmptyConfig implements DataFlow::ConfigSig {
}

// BAD - does not end with "Config"
module EmptyConfiguration implements DataFlow::ConfigSig { // $ Alert
module EmptyConfiguration implements DataFlow::ConfigSig {
// $ Alert
predicate isSource(DataFlow::Node src) { none() }
Comment on lines 10 to 13

predicate isSink(DataFlow::Node sink) { none() }
}

// BAD - does not end with "Config"
module EmptyFlow implements DataFlow::ConfigSig { // $ Alert
module EmptyFlow implements DataFlow::ConfigSig {
// $ Alert
predicate isSource(DataFlow::Node src) { none() }

predicate isSink(DataFlow::Node sink) { none() }
Expand Down
3 changes: 2 additions & 1 deletion ql/ql/test/queries/style/DeadCode/Foo.qll
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private module Input1 implements InputSig {
predicate foo() { any() }
}

private module Input2 implements InputSig { // $ Alert
private module Input2 implements InputSig {
// $ Alert
predicate foo() { any() }
}
Comment on lines +46 to 49

Expand Down
6 changes: 4 additions & 2 deletions ql/ql/test/queries/style/Misspelling/Test.qll
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* A string that's deliberately mispelled (and so is that last word).
*/ // $ Alert
class PublicallyAccessible extends string { // $ Alert
class PublicallyAccessible extends string {
// $ Alert
int numOccurences; // $ Alert // should be 'occurrences'
Comment on lines +4 to 6

PublicallyAccessible() { this = "publically" and numOccurences = 123 }
Expand All @@ -16,7 +17,8 @@ class PublicallyAccessible extends string { // $ Alert
* A class whose name contains a British-English spelling.
* And here's the word 'colour'.
*/ // $ Alert
class AnalysedInt extends int { // $ Alert
class AnalysedInt extends int {
// $ Alert
AnalysedInt() { this = 7 }

// 'analyses' should not be flagged
Expand Down
6 changes: 4 additions & 2 deletions ql/ql/test/queries/style/NonDocBlock/Foo.qll
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/*
* This should be QLDoc.
*/ // $ Alert
*/

// $ Alert
/**
Comment on lines 1 to 6
* this is fine
*/
predicate foo() { any() }

/* Note: this is bad. */ // $ Alert
/* Note: this is bad. */
// $ Alert
class Foo extends string {
Foo() { this = "FOo" }
}
Expand Down
12 changes: 8 additions & 4 deletions ql/ql/test/queries/style/UseInstanceofExtension/Foo.qll
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,32 @@ class Range extends string {
string getAChild() { result = "test" }
}

class Inst extends string { // $ Alert
class Inst extends string {
// $ Alert
Range range;
Comment on lines +7 to 9

Inst() { this = range }

string getAChild() { result = range.getAChild() }
}

class Inst2 extends string { // $ Alert
class Inst2 extends string {
// $ Alert
Inst2() { this instanceof Range }

string getAChild() { result = this.(Range).getAChild() }
}

class Inst3 extends string { // $ Alert
class Inst3 extends string {
// $ Alert
Range range;

Inst3() { this = range }

Range getRange() { result = range }
}

class Inst4 extends string { // $ Alert
class Inst4 extends string {
// $ Alert
Inst4() { this instanceof Range }
}
Loading