mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Java: Hnalde global files as exceptions rather than annotating them
This allows us to merge them without redundent annoations for now.
This commit is contained in:
@@ -177,6 +177,12 @@ def insert_overlay_caller_annotations(lines):
|
||||
out_lines.append(line)
|
||||
return out_lines
|
||||
|
||||
explicitly_global = set([
|
||||
"java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll",
|
||||
"java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll",
|
||||
"java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll",
|
||||
"java/ql/lib/semmle/code/java/dispatch/internal/Unification.qll",
|
||||
])
|
||||
|
||||
def annotate_as_appropriate(filename, lines):
|
||||
'''
|
||||
@@ -196,6 +202,9 @@ def annotate_as_appropriate(filename, lines):
|
||||
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
|
||||
any("implements DataFlow::ConfigSig" in line for line in lines))):
|
||||
return None
|
||||
elif filename in explicitly_global:
|
||||
# These files are explicitly global and should not be annotated.
|
||||
return None
|
||||
elif not any(line for line in lines if line.strip()):
|
||||
return None
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
* data flow check for lambdas, anonymous classes, and other sufficiently
|
||||
* private classes where all object instantiations are accounted for.
|
||||
*/
|
||||
overlay[global]
|
||||
module;
|
||||
|
||||
import java
|
||||
private import VirtualDispatch
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* The set of dispatch targets for `Object.toString()` calls are reduced based
|
||||
* on possible data flow from objects of more specific types to the qualifier.
|
||||
*/
|
||||
overlay[global]
|
||||
module;
|
||||
|
||||
import java
|
||||
private import VirtualDispatch
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
* Provides predicates for reasoning about runtime call targets through virtual
|
||||
* dispatch.
|
||||
*/
|
||||
overlay[global]
|
||||
module;
|
||||
|
||||
import java
|
||||
import semmle.code.java.dataflow.TypeFlow
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/**
|
||||
* Provides a module to check whether two `ParameterizedType`s are unifiable.
|
||||
*/
|
||||
overlay[global]
|
||||
module;
|
||||
|
||||
import java
|
||||
|
||||
|
||||
Reference in New Issue
Block a user