Skip to content

Commit a2dc452

Browse files
committed
JS tags
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 3c8985d commit a2dc452

File tree

1 file changed

+13
-0
lines changed
  • platform/frontends/x2cpg/src/main/scala/io/appthreat/x2cpg/passes/taggers

1 file changed

+13
-0
lines changed

platform/frontends/x2cpg/src/main/scala/io/appthreat/x2cpg/passes/taggers/EasyTagsPass.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ class EasyTagsPass(atom: Cpg) extends CpgPass(atom):
3434
).argument.isCall.methodFullName.filterNot(_.startsWith("<")).foreach { m =>
3535
atom.method.nameExact(m).newTagNode("exported").store()(dstGraph)
3636
}
37+
// DOM-related events
38+
atom.method.external.name(
39+
"(addEventListener|fetch|createElement|createTextNode|importNode|appendChild|insertBefore)"
40+
).parameter.newTagNode(
41+
"dom"
42+
).store()(
43+
dstGraph
44+
)
45+
atom.method.internal.name("(GET|POST|PUT|DELETE|HEAD|OPTIONS|request)").parameter.newTagNode(
46+
"http"
47+
).store()(
48+
dstGraph
49+
)
3750
else if language == Languages.PYTHON || language == Languages.PYTHONSRC then
3851
atom.method.internal.name("is_[a-z].*").newTagNode("validation").store()(dstGraph)
3952
atom.call.methodFullName(Operators.equals).code(

0 commit comments

Comments
 (0)