Autoformat

This commit is contained in:
Chris Smowton
2023-10-24 11:06:19 +01:00
parent 09e83d1173
commit e8c9708282
24 changed files with 26 additions and 65 deletions

View File

@@ -1251,7 +1251,7 @@ class ClassInstanceExpr extends Expr, ConstructorCall, @classinstancexpr {
override string getAPrimaryQlClass() { result = "ClassInstanceExpr" }
}
/**
/**
* An explicit `new ClassName(...)` expression.
*
* Note this does not include implicit instance creation such as lambda expressions

View File

@@ -58,9 +58,7 @@ private predicate implicitEnclosingThisCopy(ConstructorCall cc, RefType t1, RefT
private predicate enclosingInstanceAccess(ExprParent e, RefType t) {
e.(InstanceAccess).isEnclosingInstanceAccess(t)
or
exists(MethodCall ma |
ma.isEnclosingMethodCall(t) and ma = e and not exists(ma.getQualifier())
)
exists(MethodCall ma | ma.isEnclosingMethodCall(t) and ma = e and not exists(ma.getQualifier()))
or
exists(FieldAccess fa | fa.isEnclosingFieldAccess(t) and fa = e and not exists(fa.getQualifier()))
or

View File

@@ -466,9 +466,7 @@ class ObjectOutputStreamVar extends LocalVariableDecl {
}
/** DEPRECATED: Alias for `getAWriteObjectMethodCall`. */
deprecated MethodCall getAWriteObjectMethodAccess() {
result = this.getAWriteObjectMethodCall()
}
deprecated MethodCall getAWriteObjectMethodAccess() { result = this.getAWriteObjectMethodCall() }
}
/** Flow through string formatting. */

View File

@@ -78,9 +78,7 @@ class MockitoInitedTest extends Class {
m.calls*(initMocks)
)
or
exists(MethodCall call | call.getCallee() = initMocks |
call.getArgument(0).getType() = this
)
exists(MethodCall call | call.getCallee() = initMocks | call.getArgument(0).getType() = this)
)
}
}

View File

@@ -158,9 +158,8 @@ private class IsUnixFromPosixFromFileSystem extends IsUnixGuard instanceof Metho
supportedFileAttributeViewsMethod.hasName("supportedFileAttributeViews") and
supportedFileAttributeViewsMethod.getDeclaringType() instanceof TypeFileSystem
|
DataFlow::localExprFlow(any(MethodCall ma |
ma.getMethod() = supportedFileAttributeViewsMethod
), super.getQualifier())
DataFlow::localExprFlow(any(MethodCall ma | ma.getMethod() = supportedFileAttributeViewsMethod),
super.getQualifier())
)
}
}

View File

@@ -13,9 +13,7 @@ private predicate directFileRead(Expr fileAccess, Expr fileReadingExpr) {
.hasQualifiedName("java.io", ["RandomAccessFile", "FileReader", "FileInputStream"])
)
or
exists(MethodCall ma, Method filesMethod |
ma = fileReadingExpr and filesMethod = ma.getMethod()
|
exists(MethodCall ma, Method filesMethod | ma = fileReadingExpr and filesMethod = ma.getMethod() |
(
// Identify all method calls on the `Files` class that imply that we are reading the file
// represented by the first argument.

View File

@@ -18,9 +18,7 @@ deprecated class EqualsAccess = EqualsCall;
/**
* Holds if `sink` compares password `p` against a hardcoded expression `source`.
*/
predicate isHardcodedCredentialsComparison(
EqualsCall sink, HardcodedExpr source, PasswordVariable p
) {
predicate isHardcodedCredentialsComparison(EqualsCall sink, HardcodedExpr source, PasswordVariable p) {
source = sink.getQualifier() and
p.getAnAccess() = sink.getArgument(0)
or

View File

@@ -60,4 +60,4 @@ class PartialPathTraversalMethodCall extends MethodCall {
}
/** DEPRECATED: Alias for `PartialPathTraversalMethodCall`. */
deprecated class PartialPathTraversalMethodAccess = PartialPathTraversalMethodCall;
deprecated class PartialPathTraversalMethodAccess = PartialPathTraversalMethodCall;

View File

@@ -260,4 +260,5 @@ class MethodCallInsecureGuavaFilesCreateTempFile extends MethodCallInsecureFileC
}
/** DEPRECATED: Alias for `MethodCallInsecureGuavaFilesCreateTempFile`. */
deprecated class MethodAccessInsecureGuavaFilesCreateTempFile = MethodCallInsecureGuavaFilesCreateTempFile;
deprecated class MethodAccessInsecureGuavaFilesCreateTempFile =
MethodCallInsecureGuavaFilesCreateTempFile;