mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Autoformat qlls.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import java
|
||||
import semmle.code.java.controlflow.Guards
|
||||
|
||||
abstract class PathCreation extends Expr { abstract Expr getInput(); }
|
||||
abstract class PathCreation extends Expr {
|
||||
abstract Expr getInput();
|
||||
}
|
||||
|
||||
class PathsGet extends PathCreation, MethodAccess {
|
||||
PathsGet() {
|
||||
|
||||
4
java/ql/src/external/Clover.qll
vendored
4
java/ql/src/external/Clover.qll
vendored
@@ -5,7 +5,9 @@ import java
|
||||
* top-level children (usually, in fact, there is only one) is
|
||||
* a tag with the name "coverage".
|
||||
*/
|
||||
class CloverReport extends XMLFile { CloverReport() { this.getAChild().getName() = "coverage" } }
|
||||
class CloverReport extends XMLFile {
|
||||
CloverReport() { this.getAChild().getName() = "coverage" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The Clover "coverage" tag contains one or more "projects".
|
||||
|
||||
@@ -67,4 +67,6 @@ class ConfigValue extends @configValue, ConfigLocatable {
|
||||
}
|
||||
|
||||
/** A Java property is a name-value pair in a `.properties` file. */
|
||||
class JavaProperty extends ConfigPair { JavaProperty() { getFile().getExtension() = "properties" } }
|
||||
class JavaProperty extends ConfigPair {
|
||||
JavaProperty() { getFile().getExtension() = "properties" }
|
||||
}
|
||||
|
||||
@@ -513,28 +513,44 @@ class AssignOp extends Assignment, @assignop {
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `+=` operator. */
|
||||
class AssignAddExpr extends AssignOp, @assignaddexpr { override string getOp() { result = "+=" } }
|
||||
class AssignAddExpr extends AssignOp, @assignaddexpr {
|
||||
override string getOp() { result = "+=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `-=` operator. */
|
||||
class AssignSubExpr extends AssignOp, @assignsubexpr { override string getOp() { result = "-=" } }
|
||||
class AssignSubExpr extends AssignOp, @assignsubexpr {
|
||||
override string getOp() { result = "-=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `*=` operator. */
|
||||
class AssignMulExpr extends AssignOp, @assignmulexpr { override string getOp() { result = "*=" } }
|
||||
class AssignMulExpr extends AssignOp, @assignmulexpr {
|
||||
override string getOp() { result = "*=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `/=` operator. */
|
||||
class AssignDivExpr extends AssignOp, @assigndivexpr { override string getOp() { result = "/=" } }
|
||||
class AssignDivExpr extends AssignOp, @assigndivexpr {
|
||||
override string getOp() { result = "/=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `%=` operator. */
|
||||
class AssignRemExpr extends AssignOp, @assignremexpr { override string getOp() { result = "%=" } }
|
||||
class AssignRemExpr extends AssignOp, @assignremexpr {
|
||||
override string getOp() { result = "%=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `&=` operator. */
|
||||
class AssignAndExpr extends AssignOp, @assignandexpr { override string getOp() { result = "&=" } }
|
||||
class AssignAndExpr extends AssignOp, @assignandexpr {
|
||||
override string getOp() { result = "&=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `|=` operator. */
|
||||
class AssignOrExpr extends AssignOp, @assignorexpr { override string getOp() { result = "|=" } }
|
||||
class AssignOrExpr extends AssignOp, @assignorexpr {
|
||||
override string getOp() { result = "|=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `^=` operator. */
|
||||
class AssignXorExpr extends AssignOp, @assignxorexpr { override string getOp() { result = "^=" } }
|
||||
class AssignXorExpr extends AssignOp, @assignxorexpr {
|
||||
override string getOp() { result = "^=" }
|
||||
}
|
||||
|
||||
/** A compound assignment expression using the `<<=` operator. */
|
||||
class AssignLShiftExpr extends AssignOp, @assignlshiftexpr {
|
||||
@@ -643,37 +659,59 @@ class BinaryExpr extends Expr, @binaryexpr {
|
||||
}
|
||||
|
||||
/** A binary expression using the `*` operator. */
|
||||
class MulExpr extends BinaryExpr, @mulexpr { override string getOp() { result = " * " } }
|
||||
class MulExpr extends BinaryExpr, @mulexpr {
|
||||
override string getOp() { result = " * " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `/` operator. */
|
||||
class DivExpr extends BinaryExpr, @divexpr { override string getOp() { result = " / " } }
|
||||
class DivExpr extends BinaryExpr, @divexpr {
|
||||
override string getOp() { result = " / " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `%` operator. */
|
||||
class RemExpr extends BinaryExpr, @remexpr { override string getOp() { result = " % " } }
|
||||
class RemExpr extends BinaryExpr, @remexpr {
|
||||
override string getOp() { result = " % " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `+` operator. */
|
||||
class AddExpr extends BinaryExpr, @addexpr { override string getOp() { result = " + " } }
|
||||
class AddExpr extends BinaryExpr, @addexpr {
|
||||
override string getOp() { result = " + " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `-` operator. */
|
||||
class SubExpr extends BinaryExpr, @subexpr { override string getOp() { result = " - " } }
|
||||
class SubExpr extends BinaryExpr, @subexpr {
|
||||
override string getOp() { result = " - " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `<<` operator. */
|
||||
class LShiftExpr extends BinaryExpr, @lshiftexpr { override string getOp() { result = " << " } }
|
||||
class LShiftExpr extends BinaryExpr, @lshiftexpr {
|
||||
override string getOp() { result = " << " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `>>` operator. */
|
||||
class RShiftExpr extends BinaryExpr, @rshiftexpr { override string getOp() { result = " >> " } }
|
||||
class RShiftExpr extends BinaryExpr, @rshiftexpr {
|
||||
override string getOp() { result = " >> " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `>>>` operator. */
|
||||
class URShiftExpr extends BinaryExpr, @urshiftexpr { override string getOp() { result = " >>> " } }
|
||||
class URShiftExpr extends BinaryExpr, @urshiftexpr {
|
||||
override string getOp() { result = " >>> " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `&` operator. */
|
||||
class AndBitwiseExpr extends BinaryExpr, @andbitexpr { override string getOp() { result = " & " } }
|
||||
class AndBitwiseExpr extends BinaryExpr, @andbitexpr {
|
||||
override string getOp() { result = " & " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `|` operator. */
|
||||
class OrBitwiseExpr extends BinaryExpr, @orbitexpr { override string getOp() { result = " | " } }
|
||||
class OrBitwiseExpr extends BinaryExpr, @orbitexpr {
|
||||
override string getOp() { result = " | " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `^` operator. */
|
||||
class XorBitwiseExpr extends BinaryExpr, @xorbitexpr { override string getOp() { result = " ^ " } }
|
||||
class XorBitwiseExpr extends BinaryExpr, @xorbitexpr {
|
||||
override string getOp() { result = " ^ " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `&&` operator. */
|
||||
class AndLogicalExpr extends BinaryExpr, @andlogicalexpr {
|
||||
@@ -686,22 +724,34 @@ class OrLogicalExpr extends BinaryExpr, @orlogicalexpr {
|
||||
}
|
||||
|
||||
/** A binary expression using the `<` operator. */
|
||||
class LTExpr extends BinaryExpr, @ltexpr { override string getOp() { result = " < " } }
|
||||
class LTExpr extends BinaryExpr, @ltexpr {
|
||||
override string getOp() { result = " < " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `>` operator. */
|
||||
class GTExpr extends BinaryExpr, @gtexpr { override string getOp() { result = " > " } }
|
||||
class GTExpr extends BinaryExpr, @gtexpr {
|
||||
override string getOp() { result = " > " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `<=` operator. */
|
||||
class LEExpr extends BinaryExpr, @leexpr { override string getOp() { result = " <= " } }
|
||||
class LEExpr extends BinaryExpr, @leexpr {
|
||||
override string getOp() { result = " <= " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `>=` operator. */
|
||||
class GEExpr extends BinaryExpr, @geexpr { override string getOp() { result = " >= " } }
|
||||
class GEExpr extends BinaryExpr, @geexpr {
|
||||
override string getOp() { result = " >= " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `==` operator. */
|
||||
class EQExpr extends BinaryExpr, @eqexpr { override string getOp() { result = " == " } }
|
||||
class EQExpr extends BinaryExpr, @eqexpr {
|
||||
override string getOp() { result = " == " }
|
||||
}
|
||||
|
||||
/** A binary expression using the `!=` operator. */
|
||||
class NEExpr extends BinaryExpr, @neexpr { override string getOp() { result = " != " } }
|
||||
class NEExpr extends BinaryExpr, @neexpr {
|
||||
override string getOp() { result = " != " }
|
||||
}
|
||||
|
||||
/**
|
||||
* A bitwise expression.
|
||||
@@ -852,16 +902,24 @@ class PreDecExpr extends UnaryAssignExpr, @predecexpr {
|
||||
}
|
||||
|
||||
/** A unary minus expression. For example, `-i`. */
|
||||
class MinusExpr extends UnaryExpr, @minusexpr { override string toString() { result = "-..." } }
|
||||
class MinusExpr extends UnaryExpr, @minusexpr {
|
||||
override string toString() { result = "-..." }
|
||||
}
|
||||
|
||||
/** A unary plus expression. For example, `+i`. */
|
||||
class PlusExpr extends UnaryExpr, @plusexpr { override string toString() { result = "+..." } }
|
||||
class PlusExpr extends UnaryExpr, @plusexpr {
|
||||
override string toString() { result = "+..." }
|
||||
}
|
||||
|
||||
/** A bit negation expression. For example, `~x`. */
|
||||
class BitNotExpr extends UnaryExpr, @bitnotexpr { override string toString() { result = "~..." } }
|
||||
class BitNotExpr extends UnaryExpr, @bitnotexpr {
|
||||
override string toString() { result = "~..." }
|
||||
}
|
||||
|
||||
/** A logical negation expression. For example, `!b`. */
|
||||
class LogNotExpr extends UnaryExpr, @lognotexpr { override string toString() { result = "!..." } }
|
||||
class LogNotExpr extends UnaryExpr, @lognotexpr {
|
||||
override string toString() { result = "!..." }
|
||||
}
|
||||
|
||||
/** A cast expression. */
|
||||
class CastExpr extends Expr, @castexpr {
|
||||
@@ -1286,7 +1344,9 @@ class LValue extends VarAccess {
|
||||
* a simple assignment, but it may occur as the destination of a compound assignment
|
||||
* or a unary assignment.
|
||||
*/
|
||||
class RValue extends VarAccess { RValue() { this.isRValue() } }
|
||||
class RValue extends VarAccess {
|
||||
RValue() { this.isRValue() }
|
||||
}
|
||||
|
||||
/** A method access is an invocation of a method with a list of arguments. */
|
||||
class MethodAccess extends Expr, Call, @methodaccess {
|
||||
|
||||
@@ -22,10 +22,14 @@ class TypeProcessBuilder extends Class {
|
||||
}
|
||||
|
||||
/** The class `java.lang.Runtime`. */
|
||||
class TypeRuntime extends Class { TypeRuntime() { hasQualifiedName("java.lang", "Runtime") } }
|
||||
class TypeRuntime extends Class {
|
||||
TypeRuntime() { hasQualifiedName("java.lang", "Runtime") }
|
||||
}
|
||||
|
||||
/** The class `java.lang.String`. */
|
||||
class TypeString extends Class { TypeString() { this.hasQualifiedName("java.lang", "String") } }
|
||||
class TypeString extends Class {
|
||||
TypeString() { this.hasQualifiedName("java.lang", "String") }
|
||||
}
|
||||
|
||||
/** The `length()` method of the class `java.lang.String`. */
|
||||
class StringLengthMethod extends Method {
|
||||
@@ -43,7 +47,9 @@ class TypeStringBuilder extends Class {
|
||||
}
|
||||
|
||||
/** The class `java.lang.System`. */
|
||||
class TypeSystem extends Class { TypeSystem() { this.hasQualifiedName("java.lang", "System") } }
|
||||
class TypeSystem extends Class {
|
||||
TypeSystem() { this.hasQualifiedName("java.lang", "System") }
|
||||
}
|
||||
|
||||
/** The class `java.lang.Throwable`. */
|
||||
class TypeThrowable extends Class {
|
||||
@@ -56,7 +62,9 @@ class TypeException extends Class {
|
||||
}
|
||||
|
||||
/** The class `java.lang.Error`. */
|
||||
class TypeError extends Class { TypeError() { this.hasQualifiedName("java.lang", "Error") } }
|
||||
class TypeError extends Class {
|
||||
TypeError() { this.hasQualifiedName("java.lang", "Error") }
|
||||
}
|
||||
|
||||
/** The class `java.lang.RuntimeException`. */
|
||||
class TypeRuntimeException extends Class {
|
||||
@@ -89,7 +97,9 @@ class TypeConstructor extends Class {
|
||||
}
|
||||
|
||||
/** The class `java.lang.Math`. */
|
||||
class TypeMath extends Class { TypeMath() { this.hasQualifiedName("java.lang", "Math") } }
|
||||
class TypeMath extends Class {
|
||||
TypeMath() { this.hasQualifiedName("java.lang", "Math") }
|
||||
}
|
||||
|
||||
/** A numeric type, including both primitive and boxed types. */
|
||||
class NumericType extends Type {
|
||||
@@ -131,10 +141,14 @@ class TypeObjectOutputStream extends RefType {
|
||||
}
|
||||
|
||||
/** The class `java.nio.file.Paths`. */
|
||||
class TypePaths extends Class { TypePaths() { this.hasQualifiedName("java.nio.file", "Paths") } }
|
||||
class TypePaths extends Class {
|
||||
TypePaths() { this.hasQualifiedName("java.nio.file", "Paths") }
|
||||
}
|
||||
|
||||
/** The type `java.nio.file.Path`. */
|
||||
class TypePath extends RefType { TypePath() { this.hasQualifiedName("java.nio.file", "Path") } }
|
||||
class TypePath extends RefType {
|
||||
TypePath() { this.hasQualifiedName("java.nio.file", "Path") }
|
||||
}
|
||||
|
||||
/** The class `java.nio.file.FileSystem`. */
|
||||
class TypeFileSystem extends Class {
|
||||
@@ -142,7 +156,9 @@ class TypeFileSystem extends Class {
|
||||
}
|
||||
|
||||
/** The class `java.io.File`. */
|
||||
class TypeFile extends Class { TypeFile() { this.hasQualifiedName("java.io", "File") } }
|
||||
class TypeFile extends Class {
|
||||
TypeFile() { this.hasQualifiedName("java.io", "File") }
|
||||
}
|
||||
|
||||
// --- Standard methods ---
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,9 @@ import Type
|
||||
abstract class ManagedBean extends Interface { }
|
||||
|
||||
/** An `MBean`. */
|
||||
class MBean extends ManagedBean { MBean() { this.getQualifiedName().matches("%MBean%") } }
|
||||
class MBean extends ManagedBean {
|
||||
MBean() { this.getQualifiedName().matches("%MBean%") }
|
||||
}
|
||||
|
||||
/** An `MXBean`. */
|
||||
class MXBean extends ManagedBean {
|
||||
|
||||
@@ -504,7 +504,9 @@ abstract class InitializerMethod extends Method { }
|
||||
* A static initializer is a method that contains all static
|
||||
* field initializations and static initializer blocks.
|
||||
*/
|
||||
class StaticInitializer extends InitializerMethod { StaticInitializer() { hasName("<clinit>") } }
|
||||
class StaticInitializer extends InitializerMethod {
|
||||
StaticInitializer() { hasName("<clinit>") }
|
||||
}
|
||||
|
||||
/**
|
||||
* An instance initializer is a method that contains field initializations
|
||||
@@ -604,4 +606,6 @@ class Field extends Member, ExprParent, @field, Variable {
|
||||
}
|
||||
|
||||
/** An instance field. */
|
||||
class InstanceField extends Field { InstanceField() { not this.isStatic() } }
|
||||
class InstanceField extends Field {
|
||||
InstanceField() { not this.isStatic() }
|
||||
}
|
||||
|
||||
@@ -404,7 +404,9 @@ class SwitchStmt extends Stmt, @switchstmt {
|
||||
*
|
||||
* This includes both normal `case`s and the `default` case.
|
||||
*/
|
||||
class SwitchCase extends Stmt, @case { SwitchStmt getSwitch() { result.getACase() = this } }
|
||||
class SwitchCase extends Stmt, @case {
|
||||
SwitchStmt getSwitch() { result.getACase() = this }
|
||||
}
|
||||
|
||||
/** A constant `case` of a switch statement. */
|
||||
class ConstCase extends SwitchCase {
|
||||
|
||||
@@ -589,7 +589,9 @@ class RefType extends Type, Annotatable, Modifiable, @reftype {
|
||||
}
|
||||
|
||||
/** A type that is the same as its source declaration. */
|
||||
class SrcRefType extends RefType { SrcRefType() { this.isSourceDeclaration() } }
|
||||
class SrcRefType extends RefType {
|
||||
SrcRefType() { this.isSourceDeclaration() }
|
||||
}
|
||||
|
||||
/** A class declaration. */
|
||||
class Class extends RefType, @class {
|
||||
@@ -863,7 +865,9 @@ class PrimitiveType extends Type, @primitive {
|
||||
}
|
||||
|
||||
/** The type of the `null` literal. */
|
||||
class NullType extends Type, @primitive { NullType() { this.hasName("<nulltype>") } }
|
||||
class NullType extends Type, @primitive {
|
||||
NullType() { this.hasName("<nulltype>") }
|
||||
}
|
||||
|
||||
/** The `void` type. */
|
||||
class VoidType extends Type, @primitive {
|
||||
|
||||
@@ -243,7 +243,9 @@ class InstanceAccessExt extends TInstanceAccessExt {
|
||||
/**
|
||||
* An access to an object's own instance.
|
||||
*/
|
||||
class OwnInstanceAccess extends InstanceAccessExt { OwnInstanceAccess() { isOwnInstanceAccess() } }
|
||||
class OwnInstanceAccess extends InstanceAccessExt {
|
||||
OwnInstanceAccess() { isOwnInstanceAccess() }
|
||||
}
|
||||
|
||||
/**
|
||||
* An access to an enclosing instance.
|
||||
|
||||
@@ -152,9 +152,7 @@ private predicate rankedPhiInput(
|
||||
edge = rank[r](SsaReadPositionPhiInputEdge e |
|
||||
e.phiInput(phi, _)
|
||||
|
|
||||
e
|
||||
order by
|
||||
getId(e.getOrigBlock())
|
||||
e order by getId(e.getOrigBlock())
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -250,9 +250,13 @@ private newtype TReason =
|
||||
* is due to a specific condition, or `NoReason` if the bound is inferred
|
||||
* without going through a bounding condition.
|
||||
*/
|
||||
abstract class Reason extends TReason { abstract string toString(); }
|
||||
abstract class Reason extends TReason {
|
||||
abstract string toString();
|
||||
}
|
||||
|
||||
class NoReason extends Reason, TNoReason { override string toString() { result = "NoReason" } }
|
||||
class NoReason extends Reason, TNoReason {
|
||||
override string toString() { result = "NoReason" }
|
||||
}
|
||||
|
||||
class CondReason extends Reason, TCondReason {
|
||||
Guard getCond() { this = TCondReason(result) }
|
||||
@@ -390,7 +394,10 @@ private predicate boundFlowStep(Expr e2, Expr e1, int delta, boolean upper) {
|
||||
else
|
||||
if strictlyNegative(x)
|
||||
then upper = true and delta = -1
|
||||
else if negative(x) then upper = true and delta = 0 else none()
|
||||
else
|
||||
if negative(x)
|
||||
then upper = true and delta = 0
|
||||
else none()
|
||||
)
|
||||
or
|
||||
exists(Expr x |
|
||||
@@ -416,7 +423,10 @@ private predicate boundFlowStep(Expr e2, Expr e1, int delta, boolean upper) {
|
||||
else
|
||||
if strictlyNegative(x)
|
||||
then upper = false and delta = 1
|
||||
else if negative(x) then upper = false and delta = 0 else none()
|
||||
else
|
||||
if negative(x)
|
||||
then upper = false and delta = 0
|
||||
else none()
|
||||
)
|
||||
or
|
||||
e2.(RemExpr).getRightOperand() = e1 and positive(e1) and delta = -1 and upper = true
|
||||
|
||||
@@ -461,7 +461,10 @@ private Sign fieldSign(Field f) {
|
||||
else
|
||||
if f.hasName("MAX_VALUE")
|
||||
then result = TPos()
|
||||
else if f.hasName("MIN_VALUE") then result = TNeg() else any()
|
||||
else
|
||||
if f.hasName("MIN_VALUE")
|
||||
then result = TNeg()
|
||||
else any()
|
||||
}
|
||||
|
||||
/** Gets a possible sign for `e`. */
|
||||
|
||||
@@ -138,9 +138,7 @@ private predicate joinStepRank1(int r, TypeFlowNode n1, TypeFlowNode n2) {
|
||||
n1 = rank[r](TypeFlowNode n |
|
||||
joinStep(n, n2)
|
||||
|
|
||||
n
|
||||
order by
|
||||
n.getLocation().getStartLine(), n.getLocation().getStartColumn()
|
||||
n order by n.getLocation().getStartLine(), n.getLocation().getStartColumn()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,9 @@ import ImplCommon
|
||||
* this dispatch target of `ma` implies a reduced set of dispatch origins
|
||||
* to which data may flow if it should reach a `return` statement.
|
||||
*/
|
||||
abstract class CallContext extends TCallContext { abstract string toString(); }
|
||||
abstract class CallContext extends TCallContext {
|
||||
abstract string toString();
|
||||
}
|
||||
|
||||
class CallContextAny extends CallContext, TAnyCallContext {
|
||||
override string toString() { result = "CcAny" }
|
||||
|
||||
@@ -9,7 +9,9 @@ import semmle.code.java.frameworks.jackson.JacksonSerializability
|
||||
*
|
||||
* This defines the set of fields for which we will determine liveness.
|
||||
*/
|
||||
library class SourceField extends Field { SourceField() { fromSource() } }
|
||||
library class SourceField extends Field {
|
||||
SourceField() { fromSource() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A field is dead if it is never read by a live callable and it is neither reflectively accessed,
|
||||
|
||||
@@ -112,7 +112,9 @@ private predicate relevant(RefType t) {
|
||||
}
|
||||
|
||||
/** A node with a type that is relevant for dispatch flow. */
|
||||
private class RelevantNode extends Node { RelevantNode() { relevant(this.getType()) } }
|
||||
private class RelevantNode extends Node {
|
||||
RelevantNode() { relevant(this.getType()) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `p` is the `i`th parameter of a viable dispatch target of `call`.
|
||||
|
||||
@@ -7,7 +7,9 @@ import java
|
||||
/**
|
||||
* The type `com.esotericsoftware.kryo.Kryo`.
|
||||
*/
|
||||
class Kryo extends RefType { Kryo() { this.hasQualifiedName("com.esotericsoftware.kryo", "Kryo") } }
|
||||
class Kryo extends RefType {
|
||||
Kryo() { this.hasQualifiedName("com.esotericsoftware.kryo", "Kryo") }
|
||||
}
|
||||
|
||||
/**
|
||||
* A Kryo input stream.
|
||||
|
||||
@@ -8,7 +8,9 @@ class TypeUrlConnection extends RefType {
|
||||
TypeUrlConnection() { hasQualifiedName("java.net", "URLConnection") }
|
||||
}
|
||||
|
||||
class TypeSocket extends RefType { TypeSocket() { hasQualifiedName("java.net", "Socket") } }
|
||||
class TypeSocket extends RefType {
|
||||
TypeSocket() { hasQualifiedName("java.net", "Socket") }
|
||||
}
|
||||
|
||||
class URLConnectionGetInputStreamMethod extends Method {
|
||||
URLConnectionGetInputStreamMethod() {
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
import java
|
||||
|
||||
/** The interface `java.rmi.Remote`. */
|
||||
class TypeRemote extends RefType { TypeRemote() { hasQualifiedName("java.rmi", "Remote") } }
|
||||
class TypeRemote extends RefType {
|
||||
TypeRemote() { hasQualifiedName("java.rmi", "Remote") }
|
||||
}
|
||||
|
||||
/** A method that is intended to be called via RMI. */
|
||||
class RemoteCallableMethod extends Method { RemoteCallableMethod() { remoteCallableMethod(this) } }
|
||||
class RemoteCallableMethod extends Method {
|
||||
RemoteCallableMethod() { remoteCallableMethod(this) }
|
||||
}
|
||||
|
||||
private predicate remoteCallableMethod(Method method) {
|
||||
method.getDeclaringType().getASupertype() instanceof TypeRemote
|
||||
|
||||
@@ -38,7 +38,9 @@ class SafeSnakeYamlConstruction extends ClassInstanceExpr {
|
||||
/**
|
||||
* The class `org.yaml.snakeyaml.Yaml`.
|
||||
*/
|
||||
class Yaml extends RefType { Yaml() { this.hasQualifiedName("org.yaml.snakeyaml", "Yaml") } }
|
||||
class Yaml extends RefType {
|
||||
Yaml() { this.hasQualifiedName("org.yaml.snakeyaml", "Yaml") }
|
||||
}
|
||||
|
||||
private class SafeYamlConstructionFlowConfig extends DataFlow2::Configuration {
|
||||
SafeYamlConstructionFlowConfig() { this = "SnakeYaml::SafeYamlConstructionFlowConfig" }
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import java
|
||||
|
||||
class TypeIntent extends Class { TypeIntent() { hasQualifiedName("android.content", "Intent") } }
|
||||
class TypeIntent extends Class {
|
||||
TypeIntent() { hasQualifiedName("android.content", "Intent") }
|
||||
}
|
||||
|
||||
class TypeActivity extends Class { TypeActivity() { hasQualifiedName("android.app", "Activity") } }
|
||||
class TypeActivity extends Class {
|
||||
TypeActivity() { hasQualifiedName("android.app", "Activity") }
|
||||
}
|
||||
|
||||
class TypeContext extends RefType {
|
||||
TypeContext() { hasQualifiedName("android.content", "Context") }
|
||||
|
||||
@@ -4,7 +4,9 @@ class TypeSQLiteDatabase extends Class {
|
||||
TypeSQLiteDatabase() { hasQualifiedName("android.database.sqlite", "SQLiteDatabase") }
|
||||
}
|
||||
|
||||
abstract class SQLiteRunner extends Method { abstract int sqlIndex(); }
|
||||
abstract class SQLiteRunner extends Method {
|
||||
abstract int sqlIndex();
|
||||
}
|
||||
|
||||
class ExecSqlMethod extends SQLiteRunner {
|
||||
ExecSqlMethod() {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import java
|
||||
|
||||
class TypeWebView extends Class { TypeWebView() { hasQualifiedName("android.webkit", "WebView") } }
|
||||
class TypeWebView extends Class {
|
||||
TypeWebView() { hasQualifiedName("android.webkit", "WebView") }
|
||||
}
|
||||
|
||||
class TypeWebViewClient extends Class {
|
||||
TypeWebViewClient() { hasQualifiedName("android.webkit", "WebViewClient") }
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringAbstractRef
|
||||
|
||||
/** An `<idref>` element in a Spring XML file. */
|
||||
class SpringIdRef extends SpringAbstractRef { SpringIdRef() { this.getName() = "idref" } }
|
||||
class SpringIdRef extends SpringAbstractRef {
|
||||
SpringIdRef() { this.getName() = "idref" }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringXMLElement
|
||||
|
||||
/** A `<key>` element in Spring XML files. */
|
||||
class SpringKey extends SpringXMLElement { SpringKey() { this.getName() = "key" } }
|
||||
class SpringKey extends SpringXMLElement {
|
||||
SpringKey() { this.getName() = "key" }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringListOrSet
|
||||
|
||||
/** A `<list>` element in Spring XML files. */
|
||||
class SpringList extends SpringListOrSet { SpringList() { this.getName() = "list" } }
|
||||
class SpringList extends SpringListOrSet {
|
||||
SpringList() { this.getName() = "list" }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringXMLElement
|
||||
|
||||
/** A `<null>` element in Spring XML files. */
|
||||
class SpringNull extends SpringXMLElement { SpringNull() { this.getName() = "null" } }
|
||||
class SpringNull extends SpringXMLElement {
|
||||
SpringNull() { this.getName() = "null" }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringMergable
|
||||
|
||||
/** A `<props>` element in a Spring XML file. */
|
||||
class SpringProps extends SpringMergable { SpringProps() { this.getName() = "props" } }
|
||||
class SpringProps extends SpringMergable {
|
||||
SpringProps() { this.getName() = "props" }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,6 @@ import java
|
||||
import semmle.code.java.frameworks.spring.SpringListOrSet
|
||||
|
||||
/** A `<set>` element in a Spring XML file. */
|
||||
class SpringSet extends SpringListOrSet { SpringSet() { this.getName() = "set" } }
|
||||
class SpringSet extends SpringListOrSet {
|
||||
SpringSet() { this.getName() = "set" }
|
||||
}
|
||||
|
||||
@@ -291,10 +291,14 @@ class PomElement extends XMLElement {
|
||||
}
|
||||
|
||||
/** An XML element named "groupId", as found in Maven POM XML files. */
|
||||
class Group extends PomElement { Group() { this.getName() = "groupId" } }
|
||||
class Group extends PomElement {
|
||||
Group() { this.getName() = "groupId" }
|
||||
}
|
||||
|
||||
/** An XML element named "artifactId", as found in Maven POM XML files. */
|
||||
class Artifact extends PomElement { Artifact() { this.getName() = "artifactId" } }
|
||||
class Artifact extends PomElement {
|
||||
Artifact() { this.getName() = "artifactId" }
|
||||
}
|
||||
|
||||
/** An XML element named "parent", as found in Maven POM XML files. */
|
||||
class Parent extends ProtoPom {
|
||||
@@ -304,13 +308,19 @@ class Parent extends ProtoPom {
|
||||
}
|
||||
|
||||
/** An XML element named "version", as found in Maven POM XML files. */
|
||||
class Version extends PomElement { Version() { this.getName() = "version" } }
|
||||
class Version extends PomElement {
|
||||
Version() { this.getName() = "version" }
|
||||
}
|
||||
|
||||
/** An XML element named "name", as found in Maven POM XML files. */
|
||||
class Named extends PomElement { Named() { this.getName() = "name" } }
|
||||
class Named extends PomElement {
|
||||
Named() { this.getName() = "name" }
|
||||
}
|
||||
|
||||
/** An XML element named "scope", as found in Maven POM XML files. */
|
||||
class Scope extends PomElement { Scope() { this.getName() = "scope" } }
|
||||
class Scope extends PomElement {
|
||||
Scope() { this.getName() = "scope" }
|
||||
}
|
||||
|
||||
/** An XML element named "dependencies", as found in Maven POM XML files. */
|
||||
class Dependencies extends PomElement {
|
||||
@@ -350,7 +360,9 @@ class PomProperties extends PomElement {
|
||||
* An XML element that is the child of a PomProperties element, as found in Maven POM XML files.
|
||||
* Represents a single property.
|
||||
*/
|
||||
class PomProperty extends PomElement { PomProperty() { getParent() instanceof PomProperties } }
|
||||
class PomProperty extends PomElement {
|
||||
PomProperty() { getParent() instanceof PomProperties }
|
||||
}
|
||||
|
||||
/**
|
||||
* A folder that represents a maven local repository using the standard layout. Any folder called
|
||||
|
||||
@@ -74,7 +74,9 @@ class WebContextParamValue extends WebXMLElement {
|
||||
/**
|
||||
* A `<filter>` element in a `web.xml` file.
|
||||
*/
|
||||
class WebFilter extends WebXMLElement { WebFilter() { getName() = "filter" } }
|
||||
class WebFilter extends WebXMLElement {
|
||||
WebFilter() { getName() = "filter" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `<filter-class>` element in a `web.xml` file, nested under a `<filter>` element.
|
||||
@@ -91,7 +93,9 @@ class WebFilterClass extends WebXMLElement {
|
||||
/**
|
||||
* A `<servlet>` element in a `web.xml` file.
|
||||
*/
|
||||
class WebServlet extends WebXMLElement { WebServlet() { getName() = "servlet" } }
|
||||
class WebServlet extends WebXMLElement {
|
||||
WebServlet() { getName() = "servlet" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `<servlet-class>` element in a `web.xml` file, nested under a `<servlet>` element.
|
||||
@@ -108,7 +112,9 @@ class WebServletClass extends WebXMLElement {
|
||||
/**
|
||||
* A `<listener>` element in a `web.xml` file.
|
||||
*/
|
||||
class WebListener extends WebXMLElement { WebListener() { getName() = "listener" } }
|
||||
class WebListener extends WebXMLElement {
|
||||
WebListener() { getName() = "listener" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `<listener-class>` element in a `web.xml` file, nested under a `<listener>` element.
|
||||
|
||||
@@ -87,9 +87,7 @@ class XMLParent extends @xmlparent {
|
||||
result = concat(string chars, int pos |
|
||||
xmlChars(_, chars, this, pos, _, _)
|
||||
|
|
||||
chars, " "
|
||||
order by
|
||||
pos
|
||||
chars, " " order by pos
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user