mirror of
https://github.com/github/codeql.git
synced 2026-01-05 18:50:23 +01:00
simplify expressions that could be type-casts
This commit is contained in:
@@ -16,12 +16,9 @@ import semmle.code.java.deadcode.DeadCode
|
||||
from DeadField f, Element origin, string reason
|
||||
where
|
||||
not f.isInDeadScope() and
|
||||
if exists(FieldRead read | read = f.getAnAccess())
|
||||
if f.getAnAccess() instanceof FieldRead
|
||||
then (
|
||||
if
|
||||
exists(DeadRoot root |
|
||||
root = getADeadRoot(f.getAnAccess().(FieldRead).getEnclosingCallable())
|
||||
)
|
||||
if exists(getADeadRoot(f.getAnAccess().(FieldRead).getEnclosingCallable()))
|
||||
then (
|
||||
origin = getADeadRoot(f.getAnAccess().(FieldRead).getEnclosingCallable()) and
|
||||
reason = " is only read from dead code originating at $@."
|
||||
|
||||
Reference in New Issue
Block a user