delete all dead code

This commit is contained in:
Erik Krogh Kristensen
2022-03-14 13:03:31 +01:00
parent 27d41cba7e
commit 3bf5e06d53
30 changed files with 0 additions and 259 deletions

View File

@@ -9,26 +9,6 @@ import EJB
/** A method or constructor that may not be called from an EJB. */
abstract class ForbiddenCallable extends Callable { }
/**
* Specialized version of the `polyCalls(..)` predicate for the use
* case of finding "shortest" call chains from EJBs to forbidden
* methods. This is the same as `polyCalls(..)`, with two exceptions:
*
* - It does not consider calls into an EJB method.
* - It does not consider calls from "forbidden callables".
*/
private predicate ejbPolyCalls(Callable origin, Callable target) {
origin.polyCalls(target) and
not exists(EJB ejb | target = ejb.getACallable()) and
not origin instanceof ForbiddenCallable
}
private predicate ejbPolyCallsPlus(Callable origin, Callable target) {
exists(EJB ejb | origin = ejb.getACallable() | ejbPolyCalls(origin, target))
or
exists(Callable mid | ejbPolyCallsPlus(origin, mid) and ejbPolyCalls(mid, target))
}
/**
* Holds if there exists a call chain from an EJB-`Callable` `origin` to a `ForbiddenCallable` `target`
* that does not contain any intermediate EJB-`Callable` or `ForbiddenCallable`,

View File

@@ -16,13 +16,6 @@
import java
class ReachFromStmt extends Stmt {
ReachFromStmt() {
exists(Method m | m.getBody() = this) or
exists(WhileStmt w | w.getStmt() = this)
}
}
class SleepMethod extends Method {
SleepMethod() {
this.getName() = "sleep" and

View File

@@ -15,11 +15,6 @@ import semmle.code.java.Expr
import semmle.code.java.Statement
import semmle.code.java.JDK
/** A use of `+` that has type `String`. */
class StringCat extends AddExpr {
StringCat() { this.getType() instanceof TypeString }
}
/**
* An assignment of the form
*

View File

@@ -36,16 +36,6 @@ class MessageDigest extends RefType {
MessageDigest() { this.hasQualifiedName("java.security", "MessageDigest") }
}
/** The method call `MessageDigest.getInstance(...)` */
class MDConstructor extends StaticMethodAccess {
MDConstructor() {
exists(Method m | m = this.getMethod() |
m.getDeclaringType() instanceof MessageDigest and
m.hasName("getInstance")
)
}
}
/** The method `digest()` declared in `java.security.MessageDigest`. */
class MDDigestMethod extends Method {
MDDigestMethod() {