Skip to content

Commit 57cb300

Browse files
committed
C++/C#/Java/JavaScript/Python: Remove singleton set literals.
1 parent a237137 commit 57cb300

File tree

21 files changed

+34
-49
lines changed

21 files changed

+34
-49
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Allocation.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private class MallocAllocationFunction extends AllocationFunction {
5656
]) and
5757
sizeArg = 1
5858
or
59-
hasGlobalName(["HeapAlloc"]) and // HeapAlloc(heap, flags, size)
59+
hasGlobalName("HeapAlloc") and // HeapAlloc(heap, flags, size)
6060
sizeArg = 2
6161
or
6262
hasGlobalName([

csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ module EntityFramework {
239239
private class SystemDataEntityDbSetSqlQuerySinkModelCsv extends SinkModelCsv {
240240
override predicate row(string row) {
241241
row =
242-
["System.Data.Entity;DbSet;false;SqlQuery;(System.String,System.Object[]);;Argument[0];sql"]
242+
"System.Data.Entity;DbSet;false;SqlQuery;(System.String,System.Object[]);;Argument[0];sql"
243243
}
244244
}
245245

csharp/ql/lib/semmle/code/csharp/security/dataflow/XSSSinks.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private class HttpResponseBaseSink extends Sink {
251251
*/
252252
private class StringContentSinkModelCsv extends SinkModelCsv {
253253
override predicate row(string row) {
254-
row = ["System.Net.Http;StringContent;false;StringContent;;;Argument[0];xss"]
254+
row = "System.Net.Http;StringContent;false;StringContent;;;Argument[0];xss"
255255
}
256256
}
257257

java/ql/lib/semmle/code/java/frameworks/jOOQ.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,5 @@ predicate jOOQSqlMethod(Method m) {
2424
}
2525

2626
private class SqlSinkCsv extends SinkModelCsv {
27-
override predicate row(string row) {
28-
row =
29-
[
30-
//"package;type;overrides;name;signature;ext;spec;kind"
31-
"org.jooq;PlainSQL;false;;;Annotated;Argument[0];sql"
32-
]
33-
}
27+
override predicate row(string row) { row = "org.jooq;PlainSQL;false;;;Annotated;Argument[0];sql" }
3428
}

java/ql/lib/semmle/code/java/security/InformationLeak.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import semmle.code.java.security.XSS
99
private class DefaultInformationLeakSinkModel extends SinkModelCsv {
1010
override predicate row(string row) {
1111
row =
12-
[
13-
"javax.servlet.http;HttpServletResponse;false;sendError;(int,String);;Argument[1];information-leak"
14-
]
12+
"javax.servlet.http;HttpServletResponse;false;sendError;(int,String);;Argument[1];information-leak"
1513
}
1614
}
1715

java/ql/test/library-tests/frameworks/stream/test.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import TestUtilities.InlineFlowTest
44
class SummaryModelTest extends SummaryModelCsv {
55
override predicate row(string row) {
66
row =
7-
[
8-
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",
9-
"generatedtest;Test;false;getElementSpliterator;(Spliterator);;Element of Argument[0];ReturnValue;value"
10-
]
7+
"generatedtest;Test;false;getElementSpliterator;(Spliterator);;Element of Argument[0];ReturnValue;value"
118
}
129
}

java/ql/test/library-tests/optional/test.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import TestUtilities.InlineFlowTest
33

44
class SummaryModelTest extends SummaryModelCsv {
55
override predicate row(string row) {
6-
row =
7-
[
8-
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",
9-
"generatedtest;Test;false;getStreamElement;;;Element of Argument[0];ReturnValue;value"
10-
]
6+
row = "generatedtest;Test;false;getStreamElement;;;Element of Argument[0];ReturnValue;value"
117
}
128
}

java/ql/test/query-tests/security/CWE-079/semmle/tests/XSS.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class XSSConfig extends TaintTracking::Configuration {
2020
class XssTest extends InlineExpectationsTest {
2121
XssTest() { this = "XssTest" }
2222

23-
override string getARelevantTag() { result = ["xss"] }
23+
override string getARelevantTag() { result = "xss" }
2424

2525
override predicate hasActualResult(Location location, string element, string tag, string value) {
2626
tag = "xss" and

javascript/ql/lib/semmle/javascript/frameworks/Angular2.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ module Angular2 {
152152
/** A value that is about to be promoted to a trusted script value. */
153153
private class AngularCodeInjectionSink extends CodeInjection::Sink {
154154
AngularCodeInjectionSink() {
155-
this = domSanitizer().getAMethodCall(["bypassSecurityTrustScript"]).getArgument(0)
155+
this = domSanitizer().getAMethodCall("bypassSecurityTrustScript").getArgument(0)
156156
}
157157
}
158158

javascript/ql/lib/semmle/javascript/frameworks/ComposedFunctions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module FunctionCompositionCall {
8282
/** A call whose arguments are functions `f,g,h` which are composed into `f(g(h(...))` */
8383
private class RightToLeft extends WithArrayOverloading {
8484
RightToLeft() {
85-
this = DataFlow::moduleImport(["compose-function"]).getACall()
85+
this = DataFlow::moduleImport("compose-function").getACall()
8686
or
8787
this =
8888
DataFlow::moduleMember(["redux", "ramda", "@reduxjs/toolkit", "recompose"], "compose")

0 commit comments

Comments
 (0)