mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: Autoformat qls.
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
|
||||
import java
|
||||
|
||||
class CharType extends PrimitiveType { CharType() { this.hasName("char") } }
|
||||
class CharType extends PrimitiveType {
|
||||
CharType() { this.hasName("char") }
|
||||
}
|
||||
|
||||
private Type getABranchType(ConditionalExpr ce) {
|
||||
result = ce.getTrueExpr().getType() or
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
import java
|
||||
|
||||
/** A comparison (using `==`) with `null`. */
|
||||
class NullEQExpr extends EQExpr { NullEQExpr() { exists(NullLiteral l | l.getParent() = this) } }
|
||||
class NullEQExpr extends EQExpr {
|
||||
NullEQExpr() { exists(NullLiteral l | l.getParent() = this) }
|
||||
}
|
||||
|
||||
/** An assignment to a static field. */
|
||||
class StaticFieldInit extends AssignExpr {
|
||||
|
||||
@@ -15,7 +15,9 @@ import semmle.code.java.Collections
|
||||
import semmle.code.java.Maps
|
||||
|
||||
/** A union of the possible kinds of container size calls. */
|
||||
abstract class SizeOfContainer extends Expr { abstract string getContainerKind(); }
|
||||
abstract class SizeOfContainer extends Expr {
|
||||
abstract string getContainerKind();
|
||||
}
|
||||
|
||||
/** A read access to the `length` field of an array. */
|
||||
class ArrayLengthRead extends FieldRead, SizeOfContainer {
|
||||
|
||||
@@ -16,7 +16,9 @@ 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 } }
|
||||
class StringCat extends AddExpr {
|
||||
StringCat() { this.getType() instanceof TypeString }
|
||||
}
|
||||
|
||||
/**
|
||||
* An assignment of the form
|
||||
|
||||
@@ -39,7 +39,9 @@ predicate emptyArrayLiteral(Expr e) {
|
||||
)
|
||||
}
|
||||
|
||||
class EmptyArrayLiteral extends Expr { EmptyArrayLiteral() { emptyArrayLiteral(this) } }
|
||||
class EmptyArrayLiteral extends Expr {
|
||||
EmptyArrayLiteral() { emptyArrayLiteral(this) }
|
||||
}
|
||||
|
||||
from EmptyArrayLiteral l, MethodAccess ma, Method m, GenericInterface coll
|
||||
where
|
||||
|
||||
@@ -21,9 +21,13 @@ abstract class ExtremeValueField extends Field {
|
||||
ExtremeValueField() { getType() instanceof IntegralType }
|
||||
}
|
||||
|
||||
class MinValueField extends ExtremeValueField { MinValueField() { this.getName() = "MIN_VALUE" } }
|
||||
class MinValueField extends ExtremeValueField {
|
||||
MinValueField() { this.getName() = "MIN_VALUE" }
|
||||
}
|
||||
|
||||
class MaxValueField extends ExtremeValueField { MaxValueField() { this.getName() = "MAX_VALUE" } }
|
||||
class MaxValueField extends ExtremeValueField {
|
||||
MaxValueField() { this.getName() = "MAX_VALUE" }
|
||||
}
|
||||
|
||||
class ExtremeSource extends VarAccess {
|
||||
ExtremeSource() { this.getVariable() instanceof ExtremeValueField }
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
import java
|
||||
import HardcodedCredentials
|
||||
|
||||
class EqualsAccess extends MethodAccess { EqualsAccess() { getMethod() instanceof EqualsMethod } }
|
||||
class EqualsAccess extends MethodAccess {
|
||||
EqualsAccess() { getMethod() instanceof EqualsMethod }
|
||||
}
|
||||
|
||||
from EqualsAccess sink, HardcodedExpr source, PasswordVariable p
|
||||
where
|
||||
|
||||
@@ -25,7 +25,9 @@ class TypeShiroWCPermission extends RefType {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class PermissionsConstruction extends Top { abstract Expr getInput(); }
|
||||
abstract class PermissionsConstruction extends Top {
|
||||
abstract Expr getInput();
|
||||
}
|
||||
|
||||
class PermissionsCheckMethodAccess extends MethodAccess, PermissionsConstruction {
|
||||
PermissionsCheckMethodAccess() {
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
import semmle.code.java.Member
|
||||
|
||||
class ConstantField extends Field { ConstantField() { this.isStatic() and this.isFinal() } }
|
||||
class ConstantField extends Field {
|
||||
ConstantField() { this.isStatic() and this.isFinal() }
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
predicate typeWithConstantField(RefType t) { exists(ConstantField f | f.getDeclaringType() = t) }
|
||||
|
||||
@@ -12,10 +12,14 @@
|
||||
import java
|
||||
|
||||
/** An expression of primitive type. */
|
||||
class PrimitiveExpr extends Expr { PrimitiveExpr() { this.getType() instanceof PrimitiveType } }
|
||||
class PrimitiveExpr extends Expr {
|
||||
PrimitiveExpr() { this.getType() instanceof PrimitiveType }
|
||||
}
|
||||
|
||||
/** An expression of boxed type. */
|
||||
class BoxedExpr extends Expr { BoxedExpr() { this.getType() instanceof BoxedType } }
|
||||
class BoxedExpr extends Expr {
|
||||
BoxedExpr() { this.getType() instanceof BoxedType }
|
||||
}
|
||||
|
||||
/**
|
||||
* Relate expressions and the variables they flow into in one step,
|
||||
|
||||
Reference in New Issue
Block a user