mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: Autoformat most queries.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
import java
|
||||
|
||||
from Method m
|
||||
where m.getReturnType() instanceof VoidType
|
||||
and m.fromSource()
|
||||
where
|
||||
m.getReturnType() instanceof VoidType and
|
||||
m.fromSource()
|
||||
select m
|
||||
|
||||
@@ -8,4 +8,3 @@ import semmle.code.xml.MavenPom
|
||||
|
||||
from Dependency d
|
||||
select d, d.getParent*().(Pom), d.getPom()
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import semmle.code.java.security.ControlledString
|
||||
|
||||
from Expr controlled, Method method, int line
|
||||
where
|
||||
controlledString(controlled)
|
||||
and method = controlled.getEnclosingCallable()
|
||||
and line = controlled.getLocation().getStartLine() - method.getLocation().getStartLine()
|
||||
and controlled.getCompilationUnit().fromSource()
|
||||
controlledString(controlled) and
|
||||
method = controlled.getEnclosingCallable() and
|
||||
line = controlled.getLocation().getStartLine() - method.getLocation().getStartLine() and
|
||||
controlled.getCompilationUnit().fromSource()
|
||||
select method.getName(), line, controlled
|
||||
|
||||
@@ -2,7 +2,5 @@ import semmle.code.java.security.ControlledString
|
||||
|
||||
from Expr precedes, Method method
|
||||
where endsInQuote(precedes) and precedes.getEnclosingCallable() = method
|
||||
select
|
||||
method.getName(),
|
||||
precedes.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
precedes
|
||||
select method.getName(),
|
||||
precedes.getLocation().getStartLine() - method.getLocation().getStartLine(), precedes
|
||||
|
||||
@@ -2,11 +2,6 @@ import semmle.code.java.dataflow.TaintTracking
|
||||
|
||||
from StringBuilderVar sbv, MethodAccess append, Method method
|
||||
where sbv.getAnAppend() = append and append.getEnclosingCallable() = method
|
||||
select
|
||||
method.getName(),
|
||||
sbv.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
sbv,
|
||||
append.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
append,
|
||||
select method.getName(), sbv.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
sbv, append.getLocation().getStartLine() - method.getLocation().getStartLine(), append,
|
||||
append.getArgument(0)
|
||||
|
||||
|
||||
@@ -2,9 +2,5 @@ import semmle.code.java.dataflow.TaintTracking
|
||||
|
||||
from StringBuilderVar sbv, MethodAccess toString, Method method
|
||||
where sbv.getToStringCall() = toString and toString.getEnclosingCallable() = method
|
||||
select
|
||||
method.getName(),
|
||||
sbv.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
sbv,
|
||||
toString.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
toString
|
||||
select method.getName(), sbv.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
sbv, toString.getLocation().getStartLine() - method.getLocation().getStartLine(), toString
|
||||
|
||||
@@ -2,13 +2,8 @@ import semmle.code.java.security.SqlUnescapedLib
|
||||
|
||||
from StringBuilderVar sbv, Expr uncontrolled, Method method, int methodLine
|
||||
where
|
||||
uncontrolledStringBuilderQuery(sbv, uncontrolled)
|
||||
and method = uncontrolled.getEnclosingCallable()
|
||||
and methodLine = method.getLocation().getStartLine()
|
||||
select
|
||||
method.getName(),
|
||||
sbv.getLocation().getStartLine() - methodLine,
|
||||
sbv,
|
||||
uncontrolled.getLocation().getStartLine() - methodLine,
|
||||
uncontrolled
|
||||
|
||||
uncontrolledStringBuilderQuery(sbv, uncontrolled) and
|
||||
method = uncontrolled.getEnclosingCallable() and
|
||||
methodLine = method.getLocation().getStartLine()
|
||||
select method.getName(), sbv.getLocation().getStartLine() - methodLine, sbv,
|
||||
uncontrolled.getLocation().getStartLine() - methodLine, uncontrolled
|
||||
|
||||
@@ -2,13 +2,12 @@ import semmle.code.java.dataflow.FlowSources
|
||||
|
||||
class Conf extends TaintTracking::Configuration {
|
||||
Conf() { this = "qltest:cwe-089:taintedString" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) { source instanceof UserInput }
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) { any() }
|
||||
}
|
||||
|
||||
from Conf conf, Expr tainted, Method method
|
||||
where conf.hasFlowToExpr(tainted) and tainted.getEnclosingCallable() = method
|
||||
select
|
||||
method,
|
||||
tainted.getLocation().getStartLine() - method.getLocation().getStartLine(),
|
||||
tainted
|
||||
select method, tainted.getLocation().getStartLine() - method.getLocation().getStartLine(), tainted
|
||||
|
||||
Reference in New Issue
Block a user