Skip to content

Commit 6e61532

Browse files
authored
Fix/chennai tags windows compat (#81)
* Improve windows compat Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> * Updated couple of packages Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> * Tweaks Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 135cd29 commit 6e61532

File tree

11 files changed

+22
-21
lines changed

11 files changed

+22
-21
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Release Anaconda
8787
if: startsWith(github.ref, 'refs/tags/')
8888
run: |
89-
anaconda upload --label main -u appthreat /tmp/conda-out/noarch/*.tar.bz2
89+
$CONDA/bin/anaconda upload --label main -u appthreat /tmp/conda-out/noarch/*.tar.bz2
9090
env:
9191
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
9292
continue-on-error: true

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ This error is mostly due to missing python .so (linux), .dll (windows) or .dylib
190190
191191
chen is a fork of the popular [joern](https://github.com/joernio/joern) project. We deviate from the joern project in the following ways:
192192
193+
- Keep the CPG implementation at 1.0 based on the original paper.
193194
- Make code analysis accessible by adding first-class integration with Python and frameworks such as NetworkX and PyTorch.
194-
- Enable broader hierarchical analysis (Application + Dependency + Container + OS layer)
195-
- By creating a welcoming community more appropriate for beginner users with great enterprise support. We want to democratize code analysis.
195+
- Enable broader hierarchical analysis (Application + Dependency + Container + OS layer + Cloud + beyond)
196196
197197
We don't intend for bug-to-bug compatibility and often rewrite patches to suit our needs. We also do not bring features and passes that do not add value for hierarchical analysis.
198198
@@ -202,7 +202,7 @@ Apache-2.0
202202
203203
## Enterprise support
204204
205-
Enterprise support including custom language development and integration services is available via AppThreat Ltd. Free community support is also available via [Discord](https://discord.gg/UD4sHgbXYr).
205+
Enterprise support including custom language development and integration services is available via AppThreat Ltd.
206206
207207
## Sponsors
208208

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "chen"
22
ThisBuild / organization := "io.appthreat"
3-
ThisBuild / version := "2.1.1"
3+
ThisBuild / version := "2.1.2"
44
ThisBuild / scalaVersion := "3.4.2"
55

66
val cpgVersion = "1.0.0"

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"downloadUrl": "https://github.com/AppThreat/chen",
88
"issueTracker": "https://github.com/AppThreat/chen/issues",
99
"name": "chen",
10-
"version": "2.1.1",
10+
"version": "2.1.2",
1111
"description": "Code Hierarchy Exploration Net (chen) is an advanced exploration toolkit for your application source code and its dependency hierarchy.",
1212
"applicationCategory": "code-analysis",
1313
"keywords": [

console/src/main/scala/io/appthreat/console/Console.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ class Console[T <: Project](
528528
tree: Boolean = false,
529529
as_text: Boolean = false
530530
): String =
531-
if tree then
531+
if tree || includeCalls then
532532
val rootTree = richTreeLib.Tree(title, highlight = true)
533533
atom.file.whereNot(_.name("<(unknown|includes)>")).foreach { f =>
534534
val childTree = richTreeLib.Tree(f.name, highlight = true)
@@ -652,7 +652,7 @@ class Console[T <: Project](
652652
val dec: Set[Declaration] =
653653
(f.assignment.argument(1).filterNot(
654654
_.code == "this"
655-
).isIdentifier.refsTo ++ f.method.parameter
655+
).isIdentifier.nameNot("tmp[0-9]+$").refsTo ++ f.method.parameter
656656
.filterNot(_.code == "this")
657657
.filter(_.typeFullName != "ANY")).toSet
658658
table.add_row(f.name, dec.name.toSet.mkString("\n"))

meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "2.1.1" %}
1+
{% set version = "2.1.2" %}
22

33
package:
44
name: chen

platform/frontends/c2cpg/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ libraryDependencies ++= Seq(
1010
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface"),
1111
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface.text")
1212
),
13-
"org.jline" % "jline" % "3.26.1",
13+
"org.jline" % "jline" % "3.26.2",
1414
"org.scalatest" %% "scalatest" % Versions.scalatest % Test
1515
)
1616

platform/frontends/c2cpg/src/main/scala/io/appthreat/c2cpg/passes/AstCreationPass.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package io.appthreat.c2cpg.passes
33
import io.appthreat.c2cpg.Config
44
import io.appthreat.c2cpg.astcreation.AstCreator
55
import io.appthreat.c2cpg.parser.{CdtParser, FileDefaults}
6-
import io.appthreat.c2cpg.utils.{Report, TimeUtils}
6+
import io.appthreat.c2cpg.utils.Report
7+
import io.appthreat.x2cpg.SourceFiles
78
import io.shiftleft.codepropertygraph.Cpg
89
import io.shiftleft.passes.ConcurrentWriterCpgPass
9-
import io.appthreat.x2cpg.SourceFiles
1010

1111
import java.nio.file.Paths
1212
import java.util.concurrent.ConcurrentHashMap

platform/frontends/jssrc2cpg/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ astGenVersion := appProperties.value.getString("jssrc2cpg.astgen_version")
2020
libraryDependencies ++= Seq(
2121
"io.appthreat" %% "cpg2" % Versions.cpg,
2222
"com.lihaoyi" %% "upickle" % Versions.upickle,
23-
"com.fasterxml.jackson.core" % "jackson-databind" % "2.17.1",
23+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.17.2",
2424
"com.typesafe" % "config" % "1.4.3",
2525
"com.michaelpollmeier" % "versionsort" % "1.0.11",
2626
"org.scalatest" %% "scalatest" % Versions.scalatest % Test

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

+8-7
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ import java.util.regex.Pattern
1414
*/
1515
class ChennaiTagsPass(atom: Cpg) extends CpgPass(atom):
1616

17-
val language: String = atom.metaData.language.head
18-
private val FRAMEWORK_ROUTE = "framework-route"
19-
private val FRAMEWORK_INPUT = "framework-input"
20-
private val FRAMEWORK_OUTPUT = "framework-output"
17+
val language: String = atom.metaData.language.head
18+
private val FRAMEWORK_ROUTE = "framework-route"
19+
private val FRAMEWORK_INPUT = "framework-input"
20+
private val FRAMEWORK_OUTPUT = "framework-output"
21+
private val EscapedFileSeparator = Pattern.quote(java.io.File.separator)
2122

2223
private val PYTHON_ROUTES_CALL_REGEXES =
2324
Array(
24-
"django/(conf/)?urls.py:<module>.(path|re_path|url).*",
25-
".*(route|web\\.|add_resource).*"
25+
s"django$EscapedFileSeparator(conf$EscapedFileSeparator)?urls.py:<module>.(path|re_path|url).*".r,
26+
".*(route|web\\.|add_resource).*".r
2627
)
2728

2829
private def C_ROUTES_CALL_REGEXES = Array(
@@ -69,7 +70,7 @@ class ChennaiTagsPass(atom: Cpg) extends CpgPass(atom):
6970
private def tagPythonRoutes(dstGraph: DiffGraphBuilder): Unit =
7071
PYTHON_ROUTES_CALL_REGEXES.foreach { r =>
7172
atom.call
72-
.where(_.methodFullName(r))
73+
.where(_.methodFullName(r.toString()))
7374
.argument
7475
.isLiteral
7576
.newTagNode(FRAMEWORK_ROUTE)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "appthreat-chen"
3-
version = "2.1.1"
3+
version = "2.1.2"
44
description = "Code Hierarchy Exploration Net (chen)"
55
authors = ["Team AppThreat <cloud@appthreat.com>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)