Skip to content

Commit

Permalink
Tweaks to console commands (#69)
Browse files Browse the repository at this point in the history
* Tweaks to console commands

Signed-off-by: Prabhu Subramanian <[email protected]>

* Removed antlr comment

Signed-off-by: Prabhu Subramanian <[email protected]>

---------

Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Feb 1, 2024
1 parent cd5871e commit f59b32c
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 10 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.6"
ThisBuild / version := "2.0.7"
ThisBuild / scalaVersion := "3.3.1"

val cpgVersion = "1.0.0"
Expand Down
1 change: 0 additions & 1 deletion chenpy/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class CustomHighlighter(RegexHighlighter):
log_time=False,
log_path=False,
theme=custom_theme,
width=int(os.getenv("COLUMNS", "270")),
color_system="256",
force_terminal=True,
highlight=True,
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.6",
"version": "2.0.7",
"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
31 changes: 30 additions & 1 deletion console/src/main/scala/io/appthreat/console/Console.scala
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,30 @@ class Console[T <: Project](
table.add_row("Imports", "" + atom.imports.size)
table.add_row("Literals", "" + atom.literal.size)
table.add_row("Config Files", "" + atom.configFile.size)
table.add_row(
"Validation tags",
"[#5A7C90]" + atom.tag.name("(validation|sanitization).*").name.size + "[/#5A7C90]"
)
table.add_row(
"Unique packages",
"[#5A7C90]" + atom.tag.name("pkg.*").name.dedup.size + "[/#5A7C90]"
)
table.add_row(
"Framework tags",
"[#5A7C90]" + atom.tag.name("framework.*").name.size + "[/#5A7C90]"
)
table.add_row(
"Framework input",
"[#5A7C90]" + atom.tag.name("framework-(input|route)").name.size + "[/#5A7C90]"
)
table.add_row(
"Framework output",
"[#5A7C90]" + atom.tag.name("framework-output").name.size + "[/#5A7C90]"
)
table.add_row(
"Crypto tags",
"[#5A7C90]" + atom.tag.name("crypto.*").name.size + "[/#5A7C90]"
)
val appliedOverlays = Overlays.appliedOverlays(atom)
if appliedOverlays.nonEmpty then table.add_row("Overlays", "" + appliedOverlays.size)
richConsole.clear()
Expand Down Expand Up @@ -517,7 +541,12 @@ class Console[T <: Project](
.filterNot(_.methodFullName == "NULL")
.toSet
.foreach(c =>
if !addedMethods.contains(c.methodFullName) then
if !addedMethods.contains(
c.methodFullName
) && c.methodFullName != "<unknownFullName>" && !c.methodFullName.startsWith(
"{ "
)
then
mtree
.add(
c.methodFullName + (if c.callee(
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.6" %}
{% set version = "2.0.7" %}

package:
name: chen
Expand Down
2 changes: 2 additions & 0 deletions platform/frontends/x2cpg/src/main/resources/tags-vocab.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ jndi
ldif
jdbm
kerberos
oidc
oauth2
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ class CdxPass(atom: Cpg) extends CpgPass(atom):
properties.foreach { ns =>
val nsstr = ns.hcursor.downField("value").as[String].getOrElse("")
val nsname = ns.hcursor.downField("name").as[String].getOrElse("")
// Skip the SrcFile property
if nsname != "SrcFile" then
// Skip the SrcFile, ResolvedUrl, GradleProfileName, cdx: properties
if nsname != "SrcFile" && nsname != "ResolvedUrl" && nsname != "GradleProfileName" && !nsname.startsWith(
"cdx:"
)
then
nsstr
.split("(\n|,)")
.filterNot(_.startsWith("java."))
Expand Down
2 changes: 0 additions & 2 deletions project/Versions.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* reads version declarations from /build.sbt so that we can declare them in one place */
object Versions {
val cpg = parseVersion("cpgVersion")
// Dont upgrade antlr to 4.10 or above since those versions require java 11 or higher which
// causes problems upstreams.
val antlr = "4.13.1"
val scalatest = "3.2.17"
val cats = "3.5.3"
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.6"
version = "2.0.7"
description = "Code Hierarchy Exploration Net (chen)"
authors = ["Team AppThreat <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit f59b32c

Please sign in to comment.