Skip to content

Commit

Permalink
Tag the call nodes directly for python (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Apr 29, 2024
1 parent ae0c4eb commit 3221239
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "chen"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "2.0.9"
ThisBuild / version := "2.0.10"
ThisBuild / scalaVersion := "3.4.1"

val cpgVersion = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"downloadUrl": "https://github.com/AppThreat/chen",
"issueTracker": "https://github.com/AppThreat/chen/issues",
"name": "chen",
"version": "2.0.9",
"version": "2.0.10",
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
"applicationCategory": "code-analysis",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "2.0.9" %}
{% set version = "2.0.10" %}

package:
name: chen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ class CdxPass(atom: Cpg) extends CpgPass(atom):
pkgName.replace("django_", ""),
pkgName.replace("py", "")
).foreach { ns =>
val bpkg = toPyModuleForm(ns)
if bpkg.nonEmpty && !donePkgs.contains(bpkg) then
donePkgs.put(bpkg, true)
atom.call.where(
_.methodFullName(bpkg)
).argument.newTagNode(compPurl).store()(dstGraph)
atom.identifier.typeFullName(bpkg).newTagNode(
compPurl
).store()(dstGraph)
Set(toPyModuleForm(ns), s"$ns${Pattern.quote(File.separator)}.*").foreach {
bpkg =>
if bpkg.nonEmpty && !donePkgs.contains(bpkg) then
donePkgs.put(bpkg, true)
atom.call.where(
_.methodFullName(bpkg)
).newTagNode(compPurl).store()(dstGraph)
atom.identifier.typeFullName(bpkg).newTagNode(
compPurl
).store()(dstGraph)
}
}
end if
val properties = comp.hcursor.downField("properties").focus.flatMap(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "appthreat-chen"
version = "2.0.9"
version = "2.0.10"
description = "Code Hierarchy Exploration Net (chen)"
authors = ["Team AppThreat <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 3221239

Please sign in to comment.