Skip to content

Commit 64707f4

Browse files
committed
remove redundant assignments
1 parent 9373651 commit 64707f4

File tree

10 files changed

+46
-51
lines changed

10 files changed

+46
-51
lines changed

csharp/ql/src/Bad Practices/Magic Constants/MagicConstants.qll

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ private predicate trivialPositiveIntValue(string s) {
1010
s =
1111
[
1212
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
13-
"17", "18", "19", "20", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096",
14-
"16384", "32768", "65536", "1048576", "2147483648", "4294967296", "15", "31", "63", "127",
15-
"255", "511", "1023", "2047", "4095", "16383", "32767", "65535", "1048577", "2147483647",
16-
"4294967295", "0x00000001", "0x00000002", "0x00000004", "0x00000008", "0x00000010",
17-
"0x00000020", "0x00000040", "0x00000080", "0x00000100", "0x00000200", "0x00000400",
18-
"0x00000800", "0x00001000", "0x00002000", "0x00004000", "0x00008000", "0x00010000",
19-
"0x00020000", "0x00040000", "0x00080000", "0x00100000", "0x00200000", "0x00400000",
20-
"0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x08000000", "0x10000000",
21-
"0x20000000", "0x40000000", "0x80000000", "0x00000001", "0x00000003", "0x00000007",
22-
"0x0000000f", "0x0000001f", "0x0000003f", "0x0000007f", "0x000000ff", "0x000001ff",
23-
"0x000003ff", "0x000007ff", "0x00000fff", "0x00001fff", "0x00003fff", "0x00007fff",
24-
"0x0000ffff", "0x0001ffff", "0x0003ffff", "0x0007ffff", "0x000fffff", "0x001fffff",
25-
"0x003fffff", "0x007fffff", "0x00ffffff", "0x01ffffff", "0x03ffffff", "0x07ffffff",
26-
"0x0fffffff", "0x1fffffff", "0x3fffffff", "0x7fffffff", "0xffffffff", "0x0001", "0x0002",
27-
"0x0004", "0x0008", "0x0010", "0x0020", "0x0040", "0x0080", "0x0100", "0x0200", "0x0400",
28-
"0x0800", "0x1000", "0x2000", "0x4000", "0x8000", "0x0001", "0x0003", "0x0007", "0x000f",
29-
"0x001f", "0x003f", "0x007f", "0x00ff", "0x01ff", "0x03ff", "0x07ff", "0x0fff", "0x1fff",
30-
"0x3fff", "0x7fff", "0xffff", "0x01", "0x02", "0x04", "0x08", "0x10", "0x20", "0x40", "0x80",
31-
"0x01", "0x03", "0x07", "0x0f", "0x1f", "0x3f", "0x7f", "0xff", "0x00", "10", "100", "1000",
32-
"10000", "100000", "1000000", "10000000", "100000000", "1000000000"
13+
"17", "18", "19", "20", "32", "64", "128", "256", "512", "1024", "2048", "4096", "16384",
14+
"32768", "65536", "1048576", "2147483648", "4294967296", "31", "63", "127", "255", "511",
15+
"1023", "2047", "4095", "16383", "32767", "65535", "1048577", "2147483647", "4294967295",
16+
"0x00000001", "0x00000002", "0x00000004", "0x00000008", "0x00000010", "0x00000020",
17+
"0x00000040", "0x00000080", "0x00000100", "0x00000200", "0x00000400", "0x00000800",
18+
"0x00001000", "0x00002000", "0x00004000", "0x00008000", "0x00010000", "0x00020000",
19+
"0x00040000", "0x00080000", "0x00100000", "0x00200000", "0x00400000", "0x00800000",
20+
"0x01000000", "0x02000000", "0x04000000", "0x08000000", "0x10000000", "0x20000000",
21+
"0x40000000", "0x80000000", "0x00000003", "0x00000007", "0x0000000f", "0x0000001f",
22+
"0x0000003f", "0x0000007f", "0x000000ff", "0x000001ff", "0x000003ff", "0x000007ff",
23+
"0x00000fff", "0x00001fff", "0x00003fff", "0x00007fff", "0x0000ffff", "0x0001ffff",
24+
"0x0003ffff", "0x0007ffff", "0x000fffff", "0x001fffff", "0x003fffff", "0x007fffff",
25+
"0x00ffffff", "0x01ffffff", "0x03ffffff", "0x07ffffff", "0x0fffffff", "0x1fffffff",
26+
"0x3fffffff", "0x7fffffff", "0xffffffff", "0x0001", "0x0002", "0x0004", "0x0008", "0x0010",
27+
"0x0020", "0x0040", "0x0080", "0x0100", "0x0200", "0x0400", "0x0800", "0x1000", "0x2000",
28+
"0x4000", "0x8000", "0x0003", "0x0007", "0x000f", "0x001f", "0x003f", "0x007f", "0x00ff",
29+
"0x01ff", "0x03ff", "0x07ff", "0x0fff", "0x1fff", "0x3fff", "0x7fff", "0xffff", "0x02",
30+
"0x04", "0x08", "0x10", "0x20", "0x40", "0x80", "0x01", "0x03", "0x07", "0x0f", "0x1f",
31+
"0x3f", "0x7f", "0xff", "0x00", "100", "1000", "10000", "100000", "1000000", "10000000",
32+
"100000000", "1000000000"
3333
]
3434
}
3535

csharp/ql/test/library-tests/assemblies/assemblies.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ where
3434
f.hasName("f") and
3535
g.hasName("g") and
3636
a.getDeclaringType() = class1 and
37-
a.getDeclaringType() = class1 and
3837
b.getDeclaringType() = class1 and
3938
c.getDeclaringType() = class1 and
4039
not exists(c.getParameter(0).getType().(KnownType)) and

go/ql/lib/semmle/go/security/OpenUrlRedirectCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private class SafeUrlSink extends SafeUrlFlow::Sink {
128128
private class UnsafeFieldReadSanitizer extends SafeUrlFlow::SanitizerEdge {
129129
UnsafeFieldReadSanitizer() {
130130
exists(DataFlow::FieldReadNode frn, string name |
131-
name = ["User", "RawQuery", "Fragment", "User"] and
131+
name = ["User", "RawQuery", "Fragment"] and
132132
frn.getField().hasQualifiedName("net/url", "URL")
133133
|
134134
this = frn.getBase()

java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
250250
"java.util;Scanner;true;Scanner;;;Argument[0];Argument[-1];taint;manual",
251251
"java.util;Scanner;true;findInLine;;;Argument[-1];ReturnValue;taint;manual",
252252
"java.util;Scanner;true;findWithinHorizon;;;Argument[-1];ReturnValue;taint;manual",
253-
"java.util;Scanner;true;findWithinHorizon;;;Argument[-1];ReturnValue;taint;manual",
254253
"java.util;Scanner;true;next;;;Argument[-1];ReturnValue;taint;manual",
255254
"java.util;Scanner;true;nextBigDecimal;;;Argument[-1];ReturnValue;taint;manual",
256255
"java.util;Scanner;true;nextBigInteger;;;Argument[-1];ReturnValue;taint;manual",

java/ql/lib/semmle/code/java/frameworks/android/ContentProviders.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ private class SummaryModels extends SummaryModelCsv {
5656
"android.content;ContentValues;false;putAll;;;Argument[0].MapValue;Argument[-1].MapValue;value;manual",
5757
"android.content;ContentResolver;true;acquireContentProviderClient;;;Argument[0];ReturnValue;taint;manual",
5858
"android.content;ContentResolver;true;acquireUnstableContentProviderClient;;;Argument[0];ReturnValue;taint;manual",
59-
"android.content;ContentResolver;true;acquireUnstableContentProviderClient;;;Argument[0];ReturnValue;taint;manual",
6059
"android.content;ContentResolver;true;applyBatch;;;Argument[1];ReturnValue;taint;manual",
6160
"android.content;ContentResolver;true;call;;;Argument[0];ReturnValue;taint;manual",
6261
"android.content;ContentResolver;true;canonicalize;;;Argument[0];ReturnValue;taint;manual",

java/ql/lib/semmle/code/java/frameworks/guava/Collections.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ private class GuavaCollectCsv extends SummaryModelCsv {
503503
"com.google.common.collect;Sets;false;filter;(SortedSet,Predicate);;Argument[0].Element;ReturnValue.Element;value;manual",
504504
"com.google.common.collect;Sets;false;intersection;(Set,Set);;Argument[0..1].Element;ReturnValue.Element;value;manual",
505505
"com.google.common.collect;Sets;false;newConcurrentHashSet;(Iterable);;Argument[0].Element;ReturnValue.Element;value;manual",
506-
"com.google.common.collect;Sets;false;newConcurrentHashSet;(Iterable);;Argument[0].Element;ReturnValue.Element;value;manual",
507506
"com.google.common.collect;Sets;false;newCopyOnWriteArraySet;(Iterable);;Argument[0].Element;ReturnValue.Element;value;manual",
508507
"com.google.common.collect;Sets;false;newHashSet;(Iterable);;Argument[0].Element;ReturnValue.Element;value;manual",
509508
"com.google.common.collect;Sets;false;newHashSet;(Iterator);;Argument[0].Element;ReturnValue.Element;value;manual",

java/ql/lib/semmle/code/java/frameworks/guava/IO.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ private class GuavaIoSinkCsv extends SinkModelCsv {
9393
"com.google.common.io;Resources;false;asByteSource;(URL);;Argument[0];url-open-stream;manual",
9494
"com.google.common.io;Resources;false;asCharSource;(URL,Charset);;Argument[0];url-open-stream;manual",
9595
"com.google.common.io;Resources;false;copy;(URL,OutputStream);;Argument[0];url-open-stream;manual",
96-
"com.google.common.io;Resources;false;asByteSource;(URL);;Argument[0];url-open-stream;manual",
9796
"com.google.common.io;Resources;false;readLines;;;Argument[0];url-open-stream;manual",
9897
"com.google.common.io;Resources;false;toByteArray;(URL);;Argument[0];url-open-stream;manual",
9998
"com.google.common.io;Resources;false;toString;(URL,Charset);;Argument[0];url-open-stream;manual"

java/ql/src/Violations of Best Practice/Magic Constants/MagicConstants.qll

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ private predicate trivialPositiveIntValue(string s) {
88
s =
99
[
1010
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
11-
"17", "18", "19", "20", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096",
12-
"16384", "32768", "65536", "1048576", "2147483648", "4294967296", "15", "31", "63", "127",
13-
"255", "511", "1023", "2047", "4095", "16383", "32767", "65535", "1048577", "2147483647",
14-
"4294967295", "0x00000001", "0x00000002", "0x00000004", "0x00000008", "0x00000010",
15-
"0x00000020", "0x00000040", "0x00000080", "0x00000100", "0x00000200", "0x00000400",
16-
"0x00000800", "0x00001000", "0x00002000", "0x00004000", "0x00008000", "0x00010000",
17-
"0x00020000", "0x00040000", "0x00080000", "0x00100000", "0x00200000", "0x00400000",
18-
"0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x08000000", "0x10000000",
19-
"0x20000000", "0x40000000", "0x80000000", "0x00000001", "0x00000003", "0x00000007",
20-
"0x0000000f", "0x0000001f", "0x0000003f", "0x0000007f", "0x000000ff", "0x000001ff",
21-
"0x000003ff", "0x000007ff", "0x00000fff", "0x00001fff", "0x00003fff", "0x00007fff",
22-
"0x0000ffff", "0x0001ffff", "0x0003ffff", "0x0007ffff", "0x000fffff", "0x001fffff",
23-
"0x003fffff", "0x007fffff", "0x00ffffff", "0x01ffffff", "0x03ffffff", "0x07ffffff",
24-
"0x0fffffff", "0x1fffffff", "0x3fffffff", "0x7fffffff", "0xffffffff", "0x0001", "0x0002",
25-
"0x0004", "0x0008", "0x0010", "0x0020", "0x0040", "0x0080", "0x0100", "0x0200", "0x0400",
26-
"0x0800", "0x1000", "0x2000", "0x4000", "0x8000", "0x0001", "0x0003", "0x0007", "0x000f",
27-
"0x001f", "0x003f", "0x007f", "0x00ff", "0x01ff", "0x03ff", "0x07ff", "0x0fff", "0x1fff",
28-
"0x3fff", "0x7fff", "0xffff", "0x01", "0x02", "0x04", "0x08", "0x10", "0x20", "0x40", "0x80",
29-
"0x01", "0x03", "0x07", "0x0f", "0x1f", "0x3f", "0x7f", "0xff", "0x00", "10", "100", "1000",
30-
"10000", "100000", "1000000", "10000000", "100000000", "1000000000"
11+
"17", "18", "19", "20", "32", "64", "128", "256", "512", "1024", "2048", "4096", "16384",
12+
"32768", "65536", "1048576", "2147483648", "4294967296", "31", "63", "127", "255", "511",
13+
"1023", "2047", "4095", "16383", "32767", "65535", "1048577", "2147483647", "4294967295",
14+
"0x00000001", "0x00000002", "0x00000004", "0x00000008", "0x00000010", "0x00000020",
15+
"0x00000040", "0x00000080", "0x00000100", "0x00000200", "0x00000400", "0x00000800",
16+
"0x00001000", "0x00002000", "0x00004000", "0x00008000", "0x00010000", "0x00020000",
17+
"0x00040000", "0x00080000", "0x00100000", "0x00200000", "0x00400000", "0x00800000",
18+
"0x01000000", "0x02000000", "0x04000000", "0x08000000", "0x10000000", "0x20000000",
19+
"0x40000000", "0x80000000", "0x00000003", "0x00000007", "0x0000000f", "0x0000001f",
20+
"0x0000003f", "0x0000007f", "0x000000ff", "0x000001ff", "0x000003ff", "0x000007ff",
21+
"0x00000fff", "0x00001fff", "0x00003fff", "0x00007fff", "0x0000ffff", "0x0001ffff",
22+
"0x0003ffff", "0x0007ffff", "0x000fffff", "0x001fffff", "0x003fffff", "0x007fffff",
23+
"0x00ffffff", "0x01ffffff", "0x03ffffff", "0x07ffffff", "0x0fffffff", "0x1fffffff",
24+
"0x3fffffff", "0x7fffffff", "0xffffffff", "0x0001", "0x0002", "0x0004", "0x0008", "0x0010",
25+
"0x0020", "0x0040", "0x0080", "0x0100", "0x0200", "0x0400", "0x0800", "0x1000", "0x2000",
26+
"0x4000", "0x8000", "0x0003", "0x0007", "0x000f", "0x001f", "0x003f", "0x007f", "0x00ff",
27+
"0x01ff", "0x03ff", "0x07ff", "0x0fff", "0x1fff", "0x3fff", "0x7fff", "0xffff", "0x01",
28+
"0x02", "0x04", "0x08", "0x10", "0x20", "0x40", "0x80", "0x03", "0x07", "0x0f", "0x1f",
29+
"0x3f", "0x7f", "0xff", "0x00", "100", "1000", "10000", "100000", "1000000", "10000000",
30+
"100000000", "1000000000"
3131
]
3232
}
3333

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private module Redis {
251251
"set", "publish", "append", "bitfield", "decrby", "getset", "hincrby", "hincrbyfloat",
252252
"hset", "hsetnx", "incrby", "incrbyfloat", "linsert", "lpush", "lpushx", "lset", "ltrim",
253253
"rename", "renamenx", "rpushx", "setbit", "setex", "smove", "zincrby", "zinterstore",
254-
"hdel", "lpush", "pfadd", "rpush", "sadd", "sdiffstore", "srem"
254+
"hdel", "pfadd", "rpush", "sadd", "sdiffstore", "srem"
255255
] and
256256
argIndex = 0
257257
or

javascript/ql/lib/semmle/javascript/security/dataflow/LoopBoundInjectionCustomizations.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ module LoopBoundInjection {
122122
"flattenDeep", "flattenDepth", "initial", "intersection", "intersectionBy",
123123
"intersectionWith", "join", "remove", "reverse", "slice", "sortedUniq", "sortedUniqBy",
124124
"tail", "union", "unionBy", "unionWith", "uniqBy", "unzip", "unzipWith", "without", "zip",
125-
"zipObject", "zipObjectDeep", "zipWith", "countBy", "each", "forEach", "eachRight",
126-
"forEachRight", "filter", "find", "findLast", "flatMap", "flatMapDeep", "flatMapDepth",
127-
"forEach", "forEachRight", "groupBy", "invokeMap", "keyBy", "map", "orderBy", "partition",
128-
"reduce", "reduceRight", "reject", "sortBy"
125+
"zipObject", "zipObjectDeep", "zipWith", "countBy", "each", "eachRight", "forEachRight",
126+
"filter", "find", "findLast", "flatMap", "flatMapDeep", "flatMapDepth", "forEach",
127+
"groupBy", "invokeMap", "keyBy", "map", "orderBy", "partition", "reduce", "reduceRight",
128+
"reject", "sortBy"
129129
]
130130
}
131131

0 commit comments

Comments
 (0)