mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
delete all dead code
This commit is contained in:
@@ -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`,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user