JS: Make API::EntryPoint overrides optional

This commit is contained in:
Asger Feldthaus
2022-04-05 09:39:34 +02:00
committed by Asger F
parent ce9c3b3eb5
commit 76ba78294f
13 changed files with 2 additions and 30 deletions

View File

@@ -569,10 +569,10 @@ module API {
deprecated DataFlow::SourceNode getARhs() { none() }
/** Gets a data-flow node where a value enters the current codebase through this entry-point. */
abstract DataFlow::SourceNode getASource();
DataFlow::SourceNode getASource() { none() }
/** Gets a data-flow node where a value leaves the current codebase through this entry-point. */
abstract DataFlow::Node getASink();
DataFlow::Node getASink() { none() }
/** Gets an API-node for this entry point. */
API::Node getANode() { result = root().getASuccessor(Label::entryPoint(this)) }

View File

@@ -10,8 +10,6 @@ module D3 {
D3GlobalEntry() { this = "D3GlobalEntry" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("d3") }
override DataFlow::Node getASink() { none() }
}
/** Gets an API node referring to the `d3` module. */

View File

@@ -9,8 +9,6 @@ module History {
HistoryGlobalEntry() { this = "HistoryLibrary" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("HistoryLibrary") }
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -17,8 +17,6 @@ private module Immutable {
ImmutableGlobalEntry() { this = "ImmutableGlobalEntry" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Immutable") }
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -36,8 +36,6 @@ private module Console {
ConsoleGlobalEntry() { this = "ConsoleGlobalEntry" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("console") }
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -143,8 +143,6 @@ module NestJS {
override DataFlow::SourceNode getASource() {
result.(DataFlow::ClassNode).getName() = "ValidationPipe"
}
override DataFlow::Node getASink() { none() }
}
/** Gets an API node referring to the constructor of `ValidationPipe` */

View File

@@ -1096,8 +1096,6 @@ module Redux {
private class HeuristicConnectEntryPoint extends API::EntryPoint {
HeuristicConnectEntryPoint() { this = "react-redux-connect" }
override DataFlow::Node getASink() { none() }
override DataFlow::SourceNode getASource() {
exists(DataFlow::CallNode call |
call.getAnArgument().asExpr().(Identifier).getName() =

View File

@@ -660,8 +660,6 @@ module Templating {
override DataFlow::SourceNode getASource() {
result = any(TemplatePlaceholderTag tag).getInnerTopLevel().getAVariableUse("include")
}
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -15,8 +15,6 @@ module TrustedTypes {
TrustedTypesEntry() { this = "TrustedTypesEntry" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("trustedTypes") }
override DataFlow::Node getASink() { none() }
}
private API::Node trustedTypesObj() { result = any(TrustedTypesEntry entry).getANode() }

View File

@@ -10,8 +10,6 @@ module Vue {
GlobalVueEntryPoint() { this = "VueEntryPoint" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Vue") }
override DataFlow::Node getASink() { none() }
}
/**
@@ -22,8 +20,6 @@ module Vue {
private class VueExportEntryPoint extends API::EntryPoint {
VueExportEntryPoint() { this = "VueExportEntryPoint" }
override DataFlow::SourceNode getASource() { none() }
override DataFlow::Node getASink() {
result = any(SingleFileComponent c).getModule().getDefaultOrBulkExport()
}
@@ -490,8 +486,6 @@ module Vue {
result = imprt.getImportedModuleNode()
)
}
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -63,8 +63,6 @@ private class GlobalApiEntryPoint extends API::EntryPoint {
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef(global) }
override DataFlow::Node getASink() { none() }
/** Gets the name of the global variable. */
string getGlobal() { result = global }
}

View File

@@ -165,8 +165,6 @@ private class ExternalRemoteFlowSourceSpecEntryPoint extends API::EntryPoint {
string getName() { result = name }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef(name) }
override DataFlow::Node getASink() { none() }
}
/**

View File

@@ -2,8 +2,6 @@ class CustomEntryPoint extends API::EntryPoint {
CustomEntryPoint() { this = "CustomEntryPoint" }
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("CustomEntryPoint") }
override DataFlow::Node getASink() { none() }
}
import ApiGraphs.VerifyAssertions