Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce9c3b3

Browse files
committed
JS: Also rename predicates on API::EntryPoint
1 parent 19a5db9 commit ce9c3b3

13 files changed

Lines changed: 40 additions & 34 deletions

File tree

javascript/ql/lib/semmle/javascript/ApiGraphs.qll

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,17 @@ module API {
562562
bindingset[this]
563563
EntryPoint() { any() }
564564

565-
/** Gets a data-flow node that uses this entry point. */
566-
abstract DataFlow::SourceNode getAUse();
565+
/** DEPRECATED. This predicate has been renamed to `getASource`. */
566+
deprecated DataFlow::SourceNode getAUse() { none() }
567+
568+
/** DEPRECATED. This predicate has been renamed to `getASink`. */
569+
deprecated DataFlow::SourceNode getARhs() { none() }
570+
571+
/** Gets a data-flow node where a value enters the current codebase through this entry-point. */
572+
abstract DataFlow::SourceNode getASource();
567573

568-
/** Gets a data-flow node that defines this entry point. */
569-
abstract DataFlow::Node getARhs();
574+
/** Gets a data-flow node where a value leaves the current codebase through this entry-point. */
575+
abstract DataFlow::Node getASink();
570576

571577
/** Gets an API-node for this entry point. */
572578
API::Node getANode() { result = root().getASuccessor(Label::entryPoint(this)) }
@@ -684,7 +690,7 @@ module API {
684690
base = MkRoot() and
685691
exists(EntryPoint e |
686692
lbl = Label::entryPoint(e) and
687-
rhs = e.getARhs()
693+
rhs = e.getASink()
688694
)
689695
or
690696
exists(string m, string prop |
@@ -861,7 +867,7 @@ module API {
861867
base = MkRoot() and
862868
exists(EntryPoint e |
863869
lbl = Label::entryPoint(e) and
864-
ref = e.getAUse()
870+
ref = e.getASource()
865871
)
866872
or
867873
// property reads

javascript/ql/lib/semmle/javascript/frameworks/D3.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module D3 {
99
private class D3GlobalEntry extends API::EntryPoint {
1010
D3GlobalEntry() { this = "D3GlobalEntry" }
1111

12-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("d3") }
12+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("d3") }
1313

14-
override DataFlow::Node getARhs() { none() }
14+
override DataFlow::Node getASink() { none() }
1515
}
1616

1717
/** Gets an API node referring to the `d3` module. */

javascript/ql/lib/semmle/javascript/frameworks/History.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ module History {
88
private class HistoryGlobalEntry extends API::EntryPoint {
99
HistoryGlobalEntry() { this = "HistoryLibrary" }
1010

11-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("HistoryLibrary") }
11+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("HistoryLibrary") }
1212

13-
override DataFlow::Node getARhs() { none() }
13+
override DataFlow::Node getASink() { none() }
1414
}
1515

1616
/**

javascript/ql/lib/semmle/javascript/frameworks/Immutable.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ private module Immutable {
1616
private class ImmutableGlobalEntry extends API::EntryPoint {
1717
ImmutableGlobalEntry() { this = "ImmutableGlobalEntry" }
1818

19-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("Immutable") }
19+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Immutable") }
2020

21-
override DataFlow::Node getARhs() { none() }
21+
override DataFlow::Node getASink() { none() }
2222
}
2323

2424
/**

javascript/ql/lib/semmle/javascript/frameworks/Logging.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ private module Console {
3535
private class ConsoleGlobalEntry extends API::EntryPoint {
3636
ConsoleGlobalEntry() { this = "ConsoleGlobalEntry" }
3737

38-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("console") }
38+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("console") }
3939

40-
override DataFlow::Node getARhs() { none() }
40+
override DataFlow::Node getASink() { none() }
4141
}
4242

4343
/**

javascript/ql/lib/semmle/javascript/frameworks/Nest.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ module NestJS {
140140
private class ValidationNodeEntry extends API::EntryPoint {
141141
ValidationNodeEntry() { this = "ValidationNodeEntry" }
142142

143-
override DataFlow::SourceNode getAUse() {
143+
override DataFlow::SourceNode getASource() {
144144
result.(DataFlow::ClassNode).getName() = "ValidationPipe"
145145
}
146146

147-
override DataFlow::Node getARhs() { none() }
147+
override DataFlow::Node getASink() { none() }
148148
}
149149

150150
/** Gets an API node referring to the constructor of `ValidationPipe` */

javascript/ql/lib/semmle/javascript/frameworks/Redux.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,9 +1096,9 @@ module Redux {
10961096
private class HeuristicConnectEntryPoint extends API::EntryPoint {
10971097
HeuristicConnectEntryPoint() { this = "react-redux-connect" }
10981098

1099-
override DataFlow::Node getARhs() { none() }
1099+
override DataFlow::Node getASink() { none() }
11001100

1101-
override DataFlow::SourceNode getAUse() {
1101+
override DataFlow::SourceNode getASource() {
11021102
exists(DataFlow::CallNode call |
11031103
call.getAnArgument().asExpr().(Identifier).getName() =
11041104
["mapStateToProps", "mapDispatchToProps"] and

javascript/ql/lib/semmle/javascript/frameworks/Templating.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,11 @@ module Templating {
657657
private class IncludeFunctionAsEntryPoint extends API::EntryPoint {
658658
IncludeFunctionAsEntryPoint() { this = "IncludeFunctionAsEntryPoint" }
659659

660-
override DataFlow::SourceNode getAUse() {
660+
override DataFlow::SourceNode getASource() {
661661
result = any(TemplatePlaceholderTag tag).getInnerTopLevel().getAVariableUse("include")
662662
}
663663

664-
override DataFlow::Node getARhs() { none() }
664+
override DataFlow::Node getASink() { none() }
665665
}
666666

667667
/**

javascript/ql/lib/semmle/javascript/frameworks/TrustedTypes.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ module TrustedTypes {
1414
private class TrustedTypesEntry extends API::EntryPoint {
1515
TrustedTypesEntry() { this = "TrustedTypesEntry" }
1616

17-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("trustedTypes") }
17+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("trustedTypes") }
1818

19-
override DataFlow::Node getARhs() { none() }
19+
override DataFlow::Node getASink() { none() }
2020
}
2121

2222
private API::Node trustedTypesObj() { result = any(TrustedTypesEntry entry).getANode() }

javascript/ql/lib/semmle/javascript/frameworks/Vue.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ module Vue {
99
private class GlobalVueEntryPoint extends API::EntryPoint {
1010
GlobalVueEntryPoint() { this = "VueEntryPoint" }
1111

12-
override DataFlow::SourceNode getAUse() { result = DataFlow::globalVarRef("Vue") }
12+
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Vue") }
1313

14-
override DataFlow::Node getARhs() { none() }
14+
override DataFlow::Node getASink() { none() }
1515
}
1616

1717
/**
@@ -22,9 +22,9 @@ module Vue {
2222
private class VueExportEntryPoint extends API::EntryPoint {
2323
VueExportEntryPoint() { this = "VueExportEntryPoint" }
2424

25-
override DataFlow::SourceNode getAUse() { none() }
25+
override DataFlow::SourceNode getASource() { none() }
2626

27-
override DataFlow::Node getARhs() {
27+
override DataFlow::Node getASink() {
2828
result = any(SingleFileComponent c).getModule().getDefaultOrBulkExport()
2929
}
3030
}
@@ -484,14 +484,14 @@ module Vue {
484484
private class VueFileImportEntryPoint extends API::EntryPoint {
485485
VueFileImportEntryPoint() { this = "VueFileImportEntryPoint" }
486486

487-
override DataFlow::SourceNode getAUse() {
487+
override DataFlow::SourceNode getASource() {
488488
exists(Import imprt |
489489
imprt.getImportedPath().resolve() instanceof VueFile and
490490
result = imprt.getImportedModuleNode()
491491
)
492492
}
493493

494-
override DataFlow::Node getARhs() { none() }
494+
override DataFlow::Node getASink() { none() }
495495
}
496496

497497
/**

0 commit comments

Comments
 (0)