Skip to content

Commit 6acf49d

Browse files
authored
Merge pull request #7814 from aibaars/fix-ql-alerts
Ruby: fix all QL-QL alerts
2 parents 4f13bf8 + 3b05cb6 commit 6acf49d

File tree

27 files changed

+171
-879
lines changed

27 files changed

+171
-879
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ class DataFlowCallOption extends TDataFlowCallOption {
12901290
}
12911291
}
12921292

1293-
/** Content tagged with the type of a containing object. */
1293+
/** A `Content` tagged with the type of a containing object. */
12941294
class TypedContent extends MkTypedContent {
12951295
private Content c;
12961296
private DataFlowType t;

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ class DataFlowCallOption extends TDataFlowCallOption {
12901290
}
12911291
}
12921292

1293-
/** Content tagged with the type of a containing object. */
1293+
/** A `Content` tagged with the type of a containing object. */
12941294
class TypedContent extends MkTypedContent {
12951295
private Content c;
12961296
private DataFlowType t;

cpp/ql/lib/tutorial.qll

Lines changed: 23 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -6,122 +6,22 @@
66
*/
77
class Person extends string {
88
Person() {
9-
this = "Ronil" or
10-
this = "Dina" or
11-
this = "Ravi" or
12-
this = "Bruce" or
13-
this = "Jo" or
14-
this = "Aida" or
15-
this = "Esme" or
16-
this = "Charlie" or
17-
this = "Fred" or
18-
this = "Meera" or
19-
this = "Maya" or
20-
this = "Chad" or
21-
this = "Tiana" or
22-
this = "Laura" or
23-
this = "George" or
24-
this = "Will" or
25-
this = "Mary" or
26-
this = "Almira" or
27-
this = "Susannah" or
28-
this = "Rhoda" or
29-
this = "Cynthia" or
30-
this = "Eunice" or
31-
this = "Olive" or
32-
this = "Virginia" or
33-
this = "Angeline" or
34-
this = "Helen" or
35-
this = "Cornelia" or
36-
this = "Harriet" or
37-
this = "Mahala" or
38-
this = "Abby" or
39-
this = "Margaret" or
40-
this = "Deb" or
41-
this = "Minerva" or
42-
this = "Severus" or
43-
this = "Lavina" or
44-
this = "Adeline" or
45-
this = "Cath" or
46-
this = "Elisa" or
47-
this = "Lucretia" or
48-
this = "Anne" or
49-
this = "Eleanor" or
50-
this = "Joanna" or
51-
this = "Adam" or
52-
this = "Agnes" or
53-
this = "Rosanna" or
54-
this = "Clara" or
55-
this = "Melissa" or
56-
this = "Amy" or
57-
this = "Isabel" or
58-
this = "Jemima" or
59-
this = "Cordelia" or
60-
this = "Melinda" or
61-
this = "Delila" or
62-
this = "Jeremiah" or
63-
this = "Elijah" or
64-
this = "Hester" or
65-
this = "Walter" or
66-
this = "Oliver" or
67-
this = "Hugh" or
68-
this = "Aaron" or
69-
this = "Reuben" or
70-
this = "Eli" or
71-
this = "Amos" or
72-
this = "Augustus" or
73-
this = "Theodore" or
74-
this = "Ira" or
75-
this = "Timothy" or
76-
this = "Cyrus" or
77-
this = "Horace" or
78-
this = "Simon" or
79-
this = "Asa" or
80-
this = "Frank" or
81-
this = "Nelson" or
82-
this = "Leonard" or
83-
this = "Harrison" or
84-
this = "Anthony" or
85-
this = "Louis" or
86-
this = "Milton" or
87-
this = "Noah" or
88-
this = "Cornelius" or
89-
this = "Abdul" or
90-
this = "Warren" or
91-
this = "Harvey" or
92-
this = "Dennis" or
93-
this = "Wesley" or
94-
this = "Sylvester" or
95-
this = "Gilbert" or
96-
this = "Sullivan" or
97-
this = "Edmund" or
98-
this = "Wilson" or
99-
this = "Perry" or
100-
this = "Matthew" or
101-
this = "Simba" or
102-
this = "Nala" or
103-
this = "Rafiki" or
104-
this = "Shenzi" or
105-
this = "Ernest" or
106-
this = "Gertrude" or
107-
this = "Oscar" or
108-
this = "Lilian" or
109-
this = "Raymond" or
110-
this = "Elgar" or
111-
this = "Elmer" or
112-
this = "Herbert" or
113-
this = "Maude" or
114-
this = "Mae" or
115-
this = "Otto" or
116-
this = "Edwin" or
117-
this = "Ophelia" or
118-
this = "Parsley" or
119-
this = "Sage" or
120-
this = "Rosemary" or
121-
this = "Thyme" or
122-
this = "Garfunkel" or
123-
this = "King Basil" or
124-
this = "Stephen"
9+
this =
10+
[
11+
"Ronil", "Dina", "Ravi", "Bruce", "Jo", "Aida", "Esme", "Charlie", "Fred", "Meera", "Maya",
12+
"Chad", "Tiana", "Laura", "George", "Will", "Mary", "Almira", "Susannah", "Rhoda",
13+
"Cynthia", "Eunice", "Olive", "Virginia", "Angeline", "Helen", "Cornelia", "Harriet",
14+
"Mahala", "Abby", "Margaret", "Deb", "Minerva", "Severus", "Lavina", "Adeline", "Cath",
15+
"Elisa", "Lucretia", "Anne", "Eleanor", "Joanna", "Adam", "Agnes", "Rosanna", "Clara",
16+
"Melissa", "Amy", "Isabel", "Jemima", "Cordelia", "Melinda", "Delila", "Jeremiah", "Elijah",
17+
"Hester", "Walter", "Oliver", "Hugh", "Aaron", "Reuben", "Eli", "Amos", "Augustus",
18+
"Theodore", "Ira", "Timothy", "Cyrus", "Horace", "Simon", "Asa", "Frank", "Nelson",
19+
"Leonard", "Harrison", "Anthony", "Louis", "Milton", "Noah", "Cornelius", "Abdul", "Warren",
20+
"Harvey", "Dennis", "Wesley", "Sylvester", "Gilbert", "Sullivan", "Edmund", "Wilson",
21+
"Perry", "Matthew", "Simba", "Nala", "Rafiki", "Shenzi", "Ernest", "Gertrude", "Oscar",
22+
"Lilian", "Raymond", "Elgar", "Elmer", "Herbert", "Maude", "Mae", "Otto", "Edwin",
23+
"Ophelia", "Parsley", "Sage", "Rosemary", "Thyme", "Garfunkel", "King Basil", "Stephen"
24+
]
12525
}
12626

12727
/** Gets the hair color of the person. If the person is bald, there is no result. */
@@ -936,25 +836,12 @@ class Person extends string {
936836

937837
/** Holds if the person is deceased. */
938838
predicate isDeceased() {
939-
this = "Ernest" or
940-
this = "Gertrude" or
941-
this = "Oscar" or
942-
this = "Lilian" or
943-
this = "Edwin" or
944-
this = "Raymond" or
945-
this = "Elgar" or
946-
this = "Elmer" or
947-
this = "Herbert" or
948-
this = "Maude" or
949-
this = "Mae" or
950-
this = "Otto" or
951-
this = "Ophelia" or
952-
this = "Parsley" or
953-
this = "Sage" or
954-
this = "Rosemary" or
955-
this = "Thyme" or
956-
this = "Garfunkel" or
957-
this = "King Basil"
839+
this =
840+
[
841+
"Ernest", "Gertrude", "Oscar", "Lilian", "Edwin", "Raymond", "Elgar", "Elmer", "Herbert",
842+
"Maude", "Mae", "Otto", "Ophelia", "Parsley", "Sage", "Rosemary", "Thyme", "Garfunkel",
843+
"King Basil"
844+
]
958845
}
959846

960847
/** Gets a parent of the person (alive or deceased). */
@@ -1195,12 +1082,7 @@ class Person extends string {
11951082
}
11961083

11971084
/** Holds if the person is allowed in the region. Initially, all villagers are allowed in every region. */
1198-
predicate isAllowedIn(string region) {
1199-
region = "north" or
1200-
region = "south" or
1201-
region = "east" or
1202-
region = "west"
1203-
}
1085+
predicate isAllowedIn(string region) { region = ["north", "south", "east", "west"] }
12041086
}
12051087

12061088
/** Returns a parent of the person. */

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
private import InlineExpectationsTestPrivate
9494

9595
/**
96-
* Base class for tests with inline expectations. The test extends this class to provide the actual
96+
* The base class for tests with inline expectations. The test extends this class to provide the actual
9797
* results of the query, which are then compared with the expected results in comments to produce a
9898
* list of failure messages that point out where the actual results differ from the expected
9999
* results.

csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ abstract class SplitKind extends SplitKindBase {
214214
abstract string toString();
215215
}
216216

217-
/** Provides the interface for implementing an entity to split on. */
217+
/** An interface for implementing an entity to split on. */
218218
abstract class SplitImpl extends Split {
219219
/** Gets the kind of this split. */
220220
abstract SplitKind getKind();

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ class DataFlowCallOption extends TDataFlowCallOption {
12901290
}
12911291
}
12921292

1293-
/** Content tagged with the type of a containing object. */
1293+
/** A `Content` tagged with the type of a containing object. */
12941294
class TypedContent extends MkTypedContent {
12951295
private Content c;
12961296
private DataFlowType t;

0 commit comments

Comments
 (0)