Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chen for improved performance with header analysis #88

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/repotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
with:
repository: 'DefectDojo/django-DefectDojo'
path: 'repotests/django-DefectDojo'
- uses: actions/checkout@v3
with:
repository: 'nodejs/node'
path: 'repotests/nodejs'
- uses: coursier/cache-action@v6
- name: Set up JDK
uses: actions/setup-java@v3
Expand Down Expand Up @@ -79,6 +83,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
- run: |
./atom.sh usages -o /tmp/v8.atom -l h $GITHUB_WORKSPACE/repotests/nodejs/deps/v8 -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/v8.slices.json
./atom.sh usages -o /tmp/uv.atom -l h $GITHUB_WORKSPACE/repotests/nodejs/deps/uv -Dlog4j.configurationFile=log4j2.xml --slice-outfile /tmp/uv.slices.json
env:
JAVA_TOOL_OPTIONS: "-Dfile.encoding=UTF-8"
if: runner.os != 'Windows'
- run: |
npm install -g @cyclonedx/cdxgen --omit=optional
cdxgen -t java --deep -o $GITHUB_WORKSPACE/repotests/java-sec-code/bom.json $GITHUB_WORKSPACE/repotests/java-sec-code
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name := "atom"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "1.5.4"
ThisBuild / version := "1.5.5"
ThisBuild / scalaVersion := "3.3.1"

val chenVersion = "0.5.4"
val chenVersion = "0.6.0"

lazy val atom = Projects.atom

Expand Down
13 changes: 9 additions & 4 deletions src/main/scala/io/appthreat/atom/Atom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,12 @@ object Atom {
case "H" | "HPP" =>
new C2Atom()
.createCpg(
CConfig(includeComments = false, logProblems = false, includePathsAutoDiscovery = true)
CConfig(includeComments = false, logProblems = false, includePathsAutoDiscovery = false)
.withLogPreprocessor(false)
.withInputPath(config.inputPath.pathAsString)
.withOutputPath(outputAtomFile)
.withFunctionBodies(false)
.withIgnoredFilesRegex(".*(test|docs|examples|samples|mocks|Documentation|demos).*")
.withIgnoredFilesRegex(".*(test|docs|example|samples|mocks|Documentation|demos).*")
)
case Languages.C | Languages.NEWC | "CPP" | "C++" =>
new C2Cpg()
Expand All @@ -367,7 +367,7 @@ object Atom {
.withInputPath(config.inputPath.pathAsString)
.withOutputPath(outputAtomFile)
.withFunctionBodies(true)
.withIgnoredFilesRegex(".*(test|docs|examples|samples|mocks|Documentation|demos).*")
.withIgnoredFilesRegex(".*(test|docs|example|samples|mocks|Documentation|demos).*")
)
case "JAR" | "JIMPLE" | "ANDROID" | "APK" | "DEX" =>
new Jimple2Cpg()
Expand Down Expand Up @@ -444,7 +444,12 @@ object Atom {
case _ =>
}
generateSlice(config, ag)
ag.close()
try {
ag.close()
} catch {
case err: Throwable if err.getMessage == null => Left(err.getStackTrace.take(7).mkString("\n"))
case err: Throwable => Left(err.getMessage)
}
Right("Atom generation successful")
}
}
Expand Down
4 changes: 2 additions & 2 deletions wrapper/nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wrapper/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@appthreat/atom",
"version": "1.5.4",
"version": "1.5.5",
"description": "Create atom (⚛) representation for your application, packages and libraries",
"exports": "./index.js",
"type": "module",
Expand Down
Loading