Skip to content

Commit f59b32c

Browse files
authored
Tweaks to console commands (#69)
* Tweaks to console commands Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> * Removed antlr comment Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com> --------- Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent cd5871e commit f59b32c

File tree

9 files changed

+41
-10
lines changed

9 files changed

+41
-10
lines changed

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.0.6"
3+
ThisBuild / version := "2.0.7"
44
ThisBuild / scalaVersion := "3.3.1"
55

66
val cpgVersion = "1.0.0"

chenpy/logger.py

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class CustomHighlighter(RegexHighlighter):
4949
log_time=False,
5050
log_path=False,
5151
theme=custom_theme,
52-
width=int(os.getenv("COLUMNS", "270")),
5352
color_system="256",
5453
force_terminal=True,
5554
highlight=True,

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.0.6",
10+
"version": "2.0.7",
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

+30-1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,30 @@ class Console[T <: Project](
460460
table.add_row("Imports", "" + atom.imports.size)
461461
table.add_row("Literals", "" + atom.literal.size)
462462
table.add_row("Config Files", "" + atom.configFile.size)
463+
table.add_row(
464+
"Validation tags",
465+
"[#5A7C90]" + atom.tag.name("(validation|sanitization).*").name.size + "[/#5A7C90]"
466+
)
467+
table.add_row(
468+
"Unique packages",
469+
"[#5A7C90]" + atom.tag.name("pkg.*").name.dedup.size + "[/#5A7C90]"
470+
)
471+
table.add_row(
472+
"Framework tags",
473+
"[#5A7C90]" + atom.tag.name("framework.*").name.size + "[/#5A7C90]"
474+
)
475+
table.add_row(
476+
"Framework input",
477+
"[#5A7C90]" + atom.tag.name("framework-(input|route)").name.size + "[/#5A7C90]"
478+
)
479+
table.add_row(
480+
"Framework output",
481+
"[#5A7C90]" + atom.tag.name("framework-output").name.size + "[/#5A7C90]"
482+
)
483+
table.add_row(
484+
"Crypto tags",
485+
"[#5A7C90]" + atom.tag.name("crypto.*").name.size + "[/#5A7C90]"
486+
)
463487
val appliedOverlays = Overlays.appliedOverlays(atom)
464488
if appliedOverlays.nonEmpty then table.add_row("Overlays", "" + appliedOverlays.size)
465489
richConsole.clear()
@@ -517,7 +541,12 @@ class Console[T <: Project](
517541
.filterNot(_.methodFullName == "NULL")
518542
.toSet
519543
.foreach(c =>
520-
if !addedMethods.contains(c.methodFullName) then
544+
if !addedMethods.contains(
545+
c.methodFullName
546+
) && c.methodFullName != "<unknownFullName>" && !c.methodFullName.startsWith(
547+
"{ "
548+
)
549+
then
521550
mtree
522551
.add(
523552
c.methodFullName + (if c.callee(

meta.yaml

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

33
package:
44
name: chen

platform/frontends/x2cpg/src/main/resources/tags-vocab.txt

+2
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ jndi
8888
ldif
8989
jdbm
9090
kerberos
91+
oidc
92+
oauth2

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ class CdxPass(atom: Cpg) extends CpgPass(atom):
105105
properties.foreach { ns =>
106106
val nsstr = ns.hcursor.downField("value").as[String].getOrElse("")
107107
val nsname = ns.hcursor.downField("name").as[String].getOrElse("")
108-
// Skip the SrcFile property
109-
if nsname != "SrcFile" then
108+
// Skip the SrcFile, ResolvedUrl, GradleProfileName, cdx: properties
109+
if nsname != "SrcFile" && nsname != "ResolvedUrl" && nsname != "GradleProfileName" && !nsname.startsWith(
110+
"cdx:"
111+
)
112+
then
110113
nsstr
111114
.split("(\n|,)")
112115
.filterNot(_.startsWith("java."))

project/Versions.scala

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* reads version declarations from /build.sbt so that we can declare them in one place */
22
object Versions {
33
val cpg = parseVersion("cpgVersion")
4-
// Dont upgrade antlr to 4.10 or above since those versions require java 11 or higher which
5-
// causes problems upstreams.
64
val antlr = "4.13.1"
75
val scalatest = "3.2.17"
86
val cats = "3.5.3"

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.0.6"
3+
version = "2.0.7"
44
description = "Code Hierarchy Exploration Net (chen)"
55
authors = ["Team AppThreat <cloud@appthreat.com>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)