Skip to content

Commit 84f6b89

Browse files
committed
JS: Minor improvements to threat-model Concepts
Mirroring what was done for Python
1 parent 1726287 commit 84f6b89

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

javascript/ql/lib/semmle/javascript/Concepts.qll

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ private import codeql.threatmodels.ThreatModels
1616
class ThreatModelSource extends DataFlow::Node instanceof ThreatModelSource::Range {
1717
/**
1818
* Gets a string that represents the source kind with respect to threat modeling.
19+
*
20+
*
21+
* See
22+
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
23+
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
1924
*/
2025
string getThreatModel() { result = super.getThreatModel() }
2126

@@ -34,6 +39,10 @@ module ThreatModelSource {
3439
abstract class Range extends DataFlow::Node {
3540
/**
3641
* Gets a string that represents the source kind with respect to threat modeling.
42+
*
43+
* See
44+
* - https://github.com/github/codeql/blob/main/docs/codeql/reusables/threat-model-description.rst
45+
* - https://github.com/github/codeql/blob/main/shared/threat-models/ext/threat-model-grouping.model.yml
3746
*/
3847
abstract string getThreatModel();
3948

@@ -45,11 +54,11 @@ module ThreatModelSource {
4554
/**
4655
* A data flow source that is enabled in the current threat model configuration.
4756
*/
48-
class ActiveThreatModelSource extends DataFlow::Node {
57+
class ActiveThreatModelSource extends ThreatModelSource {
4958
ActiveThreatModelSource() {
5059
exists(string kind |
5160
currentThreatModel(kind) and
52-
this.(ThreatModelSource).getThreatModel() = kind
61+
this.getThreatModel() = kind
5362
)
5463
}
5564
}

0 commit comments

Comments
 (0)