mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C#: Refactor the model generator configurations to use the new API.
This commit is contained in:
@@ -8,10 +8,6 @@
|
||||
|
||||
import internal.CaptureModels
|
||||
|
||||
class Activate extends ActiveConfiguration {
|
||||
override predicate activateToSinkConfig() { any() }
|
||||
}
|
||||
|
||||
from DataFlowTargetApi api, string sink
|
||||
where sink = captureSink(api)
|
||||
select sink order by sink
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
|
||||
import internal.CaptureModels
|
||||
|
||||
class Activate extends ActiveConfiguration {
|
||||
override predicate activateFromSourceConfig() { any() }
|
||||
}
|
||||
|
||||
from DataFlowTargetApi api, string source
|
||||
where source = captureSource(api)
|
||||
select source order by source
|
||||
|
||||
@@ -110,7 +110,7 @@ predicate isRelevantType(CS::Type t) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the CSV string representation of the qualifier.
|
||||
* Gets the MaD string representation of the qualifier.
|
||||
*/
|
||||
string qualifierString() { result = "Argument[this]" }
|
||||
|
||||
@@ -120,14 +120,7 @@ string parameterAccess(CS::Parameter p) {
|
||||
else result = "Argument[" + p.getPosition() + "]"
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the CSV string representation of the parameter node `p`.
|
||||
*/
|
||||
string parameterNodeAsInput(DataFlow::ParameterNode p) {
|
||||
result = parameterAccess(p.asParameter())
|
||||
or
|
||||
result = qualifierString() and p instanceof DataFlowPrivate::InstanceParameterNode
|
||||
}
|
||||
class InstanceParameterNode = DataFlowPrivate::InstanceParameterNode;
|
||||
|
||||
pragma[nomagic]
|
||||
private CS::Parameter getParameter(DataFlowImplCommon::ReturnNodeExt node, ParameterPosition pos) {
|
||||
@@ -135,7 +128,7 @@ private CS::Parameter getParameter(DataFlowImplCommon::ReturnNodeExt node, Param
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the CSV string representation of the the return node `node`.
|
||||
* Gets the MaD string representation of the the return node `node`.
|
||||
*/
|
||||
string returnNodeAsOutput(DataFlowImplCommon::ReturnNodeExt node) {
|
||||
if node.getKind() instanceof DataFlowImplCommon::ValueReturnKind
|
||||
@@ -188,9 +181,9 @@ predicate apiSource(DataFlow::Node source) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the CSV input string representation of `source`.
|
||||
* Gets the MaD input string representation of `source`.
|
||||
*/
|
||||
string asInputArgument(DataFlow::Node source) {
|
||||
string asInputArgumentSpecific(DataFlow::Node source) {
|
||||
exists(int pos |
|
||||
pos = source.(DataFlow::ParameterNode).getParameter().getPosition() and
|
||||
result = "Argument[" + pos + "]"
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
private import CaptureModels
|
||||
|
||||
private class Activate extends ActiveConfiguration {
|
||||
override predicate activateThroughFlowConfig() { any() }
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture fluent APIs that return `this`.
|
||||
* Example of a fluent API:
|
||||
|
||||
Reference in New Issue
Block a user