We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6ec8b6 commit 4b02198Copy full SHA for 4b02198
csharp/ql/src/Useless code/IntGetHashCode.ql
@@ -16,5 +16,12 @@ import semmle.code.csharp.frameworks.System
16
from MethodCall mc, IntegralType t
17
where
18
mc.getTarget() instanceof GetHashCodeMethod and
19
- t = mc.getQualifier().getType()
+ t = mc.getQualifier().getType() and
20
+ (
21
+ t instanceof ByteType or
22
+ t instanceof SByteType or
23
+ t instanceof ShortType or
24
+ t instanceof UShortType or
25
+ t instanceof IntType
26
+ )
27
select mc, "Calling GetHashCode() on type " + t.toStringWithTypes() + " is redundant."
0 commit comments