GeezerVison is showing github.com — Java: Autoformat qls. · github/codeql@2546963
File treeExpand file treeCollapse file tree Open diff view settings Violations of Best Practice
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Likely Bugs/Arithmetic/CondExprTypes.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 |
| 13 | 13 | import java | 14 | 14 |
| 15 | | -class CharType extends PrimitiveType { CharType() { this.hasName("char") } } | | 15 | +class CharType extends PrimitiveType { | | 16 | + CharType() { this.hasName("char") } | | 17 | +} | 16 | 18 |
| 17 | 19 | private Type getABranchType(ConditionalExpr ce) { | 18 | 20 | result = ce.getTrueExpr().getType() or | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Likely Bugs/Concurrency/LazyInitStaticField.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | import java | 17 | 17 |
| 18 | 18 | /** A comparison (using `==`) with `null`. */ | 19 | | -class NullEQExpr extends EQExpr { NullEQExpr() { exists(NullLiteral l | l.getParent() = this) } } | | 19 | +class NullEQExpr extends EQExpr { | | 20 | + NullEQExpr() { exists(NullLiteral l | l.getParent() = this) } | | 21 | +} | 20 | 22 |
| 21 | 23 | /** An assignment to a static field. */ | 22 | 24 | class StaticFieldInit extends AssignExpr { | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Likely Bugs/Likely Typos/ContainerSizeCmpZero.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,9 @@ import semmle.code.java.Collections | 15 | 15 | import semmle.code.java.Maps | 16 | 16 |
| 17 | 17 | /** A union of the possible kinds of container size calls. */ | 18 | | -abstract class SizeOfContainer extends Expr { abstract string getContainerKind(); } | | 18 | +abstract class SizeOfContainer extends Expr { | | 19 | + abstract string getContainerKind(); | | 20 | +} | 19 | 21 |
| 20 | 22 | /** A read access to the `length` field of an array. */ | 21 | 23 | class ArrayLengthRead extends FieldRead, SizeOfContainer { | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Performance/ConcatenationInLoops.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,9 @@ import semmle.code.java.Statement | 16 | 16 | import semmle.code.java.JDK | 17 | 17 |
| 18 | 18 | /** A use of `+` that has type `String`. */ | 19 | | -class StringCat extends AddExpr { StringCat() { this.getType() instanceof TypeString } } | | 19 | +class StringCat extends AddExpr { | | 20 | + StringCat() { this.getType() instanceof TypeString } | | 21 | +} | 20 | 22 |
| 21 | 23 | /** | 22 | 24 | * An assignment of the form | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Performance/InefficientToArray.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,9 @@ predicate emptyArrayLiteral(Expr e) { | 39 | 39 | ) | 40 | 40 | } | 41 | 41 |
| 42 | | -class EmptyArrayLiteral extends Expr { EmptyArrayLiteral() { emptyArrayLiteral(this) } } | | 42 | +class EmptyArrayLiteral extends Expr { | | 43 | + EmptyArrayLiteral() { emptyArrayLiteral(this) } | | 44 | +} | 43 | 45 |
| 44 | 46 | from EmptyArrayLiteral l, MethodAccess ma, Method m, GenericInterface coll | 45 | 47 | where | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-190/ArithmeticWithExtremeValues.ql +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,9 +21,13 @@ abstract class ExtremeValueField extends Field { | 21 | 21 | ExtremeValueField() { getType() instanceof IntegralType } | 22 | 22 | } | 23 | 23 |
| 24 | | -class MinValueField extends ExtremeValueField { MinValueField() { this.getName() = "MIN_VALUE" } } | | 24 | +class MinValueField extends ExtremeValueField { | | 25 | + MinValueField() { this.getName() = "MIN_VALUE" } | | 26 | +} | 25 | 27 |
| 26 | | -class MaxValueField extends ExtremeValueField { MaxValueField() { this.getName() = "MAX_VALUE" } } | | 28 | +class MaxValueField extends ExtremeValueField { | | 29 | + MaxValueField() { this.getName() = "MAX_VALUE" } | | 30 | +} | 27 | 31 |
| 28 | 32 | class ExtremeSource extends VarAccess { | 29 | 33 | ExtremeSource() { this.getVariable() instanceof ExtremeValueField } | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsComparison.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | import java | 13 | 13 | import HardcodedCredentials | 14 | 14 |
| 15 | | -class EqualsAccess extends MethodAccess { EqualsAccess() { getMethod() instanceof EqualsMethod } } | | 15 | +class EqualsAccess extends MethodAccess { | | 16 | + EqualsAccess() { getMethod() instanceof EqualsMethod } | | 17 | +} | 16 | 18 |
| 17 | 19 | from EqualsAccess sink, HardcodedExpr source, PasswordVariable p | 18 | 20 | where | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,9 @@ class TypeShiroWCPermission extends RefType { | 25 | 25 | } | 26 | 26 | } | 27 | 27 |
| 28 | | -abstract class PermissionsConstruction extends Top { abstract Expr getInput(); } | | 28 | +abstract class PermissionsConstruction extends Top { | | 29 | + abstract Expr getInput(); | | 30 | +} | 29 | 31 |
| 30 | 32 | class PermissionsCheckMethodAccess extends MethodAccess, PermissionsConstruction { | 31 | 33 | PermissionsCheckMethodAccess() { | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Violations of Best Practice/Declarations/NoConstantsOnly.ql +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 |
| 13 | 13 | import semmle.code.java.Member | 14 | 14 |
| 15 | | -class ConstantField extends Field { ConstantField() { this.isStatic() and this.isFinal() } } | | 15 | +class ConstantField extends Field { | | 16 | + ConstantField() { this.isStatic() and this.isFinal() } | | 17 | +} | 16 | 18 |
| 17 | 19 | pragma[noinline] | 18 | 20 | predicate typeWithConstantField(RefType t) { exists(ConstantField f | f.getDeclaringType() = t) } | |
Collapse file Copy file name to clipboardExpand all lines: java/ql/src/Violations of Best Practice/legacy/AutoBoxing.ql +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | import java | 13 | 13 |
| 14 | 14 | /** An expression of primitive type. */ | 15 | | -class PrimitiveExpr extends Expr { PrimitiveExpr() { this.getType() instanceof PrimitiveType } } | | 15 | +class PrimitiveExpr extends Expr { | | 16 | + PrimitiveExpr() { this.getType() instanceof PrimitiveType } | | 17 | +} | 16 | 18 |
| 17 | 19 | /** An expression of boxed type. */ | 18 | | -class BoxedExpr extends Expr { BoxedExpr() { this.getType() instanceof BoxedType } } | | 20 | +class BoxedExpr extends Expr { | | 21 | + BoxedExpr() { this.getType() instanceof BoxedType } | | 22 | +} | 19 | 23 |
| 20 | 24 | /** | 21 | 25 | * Relate expressions and the variables they flow into in one step, | |
|