-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
821938d
commit e0c33c6
Showing
163 changed files
with
47,271 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cpg.bin | ||
target/ | ||
.idea/ | ||
/.bsp | ||
/joern-inst | ||
/workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version = 3.5.1 | ||
runner.dialect = scala213 | ||
preset = IntelliJ | ||
maxColumn = 120 | ||
align.preset = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Sample standalone application on top of joern | ||
============================================= | ||
|
||
A program that makes use of Joern to create a CPG and list all method | ||
names: | ||
|
||
``` | ||
sbt stage | ||
./standalone -Dlog4j.configurationFile=log4j2.xml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name := "standalone" | ||
ThisBuild/organization := "org.codeminers" | ||
ThisBuild/scalaVersion := "2.13.8" | ||
|
||
// parsed by project/Versions.scala, updated by updateDependencies.sh | ||
val cpgVersion = "1.3.612" | ||
val joernVersion = "1.2.3" | ||
val overflowdbVersion = "1.179" | ||
|
||
lazy val schema = Projects.schema | ||
lazy val domainClasses = Projects.domainClasses | ||
lazy val schemaExtender = Projects.schemaExtender | ||
|
||
dependsOn(domainClasses) | ||
|
||
libraryDependencies ++= Seq( | ||
"com.github.pathikrit" %% "better-files" % "3.9.2", | ||
"com.github.scopt" %% "scopt" % "4.1.0", | ||
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.20.0" % Optional, | ||
"io.joern" %% "x2cpg" % Versions.joern, | ||
"io.joern" %% "javasrc2cpg" % Versions.joern, | ||
"io.joern" %% "joern-cli" % Versions.joern, | ||
"io.joern" %% "semanticcpg" % Versions.joern, | ||
"io.joern" %% "semanticcpg" % Versions.joern % Test classifier "tests", | ||
"org.scalatest" %% "scalatest" % "3.2.15" % Test | ||
) | ||
|
||
|
||
ThisBuild/Compile/scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-language:implicitConversions", | ||
) | ||
|
||
enablePlugins(JavaAppPackaging) | ||
|
||
ThisBuild/licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) | ||
|
||
Global/onChangedBuildSource := ReloadOnSourceChanges | ||
|
||
ThisBuild / resolvers ++= Seq( | ||
Resolver.mavenLocal, | ||
"Sonatype OSS" at "https://oss.sonatype.org/content/repositories/public", | ||
"Atlassian" at "https://packages.atlassian.com/mvn/maven-atlassian-external", | ||
"Gradle Releases" at "https://repo.gradle.org/gradle/libs-releases/" | ||
) | ||
|
||
Compile/doc/sources := Seq.empty | ||
Compile/packageDoc/publishArtifact := false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name := "joern-standalone-domain-classes" | ||
|
||
libraryDependencies += "io.shiftleft" %% "overflowdb-traversal" % Versions.overflowdb | ||
|
||
lazy val generatedSrcDir = settingKey[File]("root for generated sources - we want to check those in") | ||
generatedSrcDir := (Compile/sourceDirectory).value / "generated" | ||
|
||
Compile/unmanagedSourceDirectories += generatedSrcDir.value | ||
Compile/compile := (Compile/compile).dependsOn(Projects.schema/Compile/generateDomainClasses).value | ||
|
||
Compile / scalacOptions --= Seq("-Xfatal-warnings", "-Wunused", "-Ywarn-unused") |
69 changes: 69 additions & 0 deletions
69
...es/src/main/generated/io/shiftleft/codepropertygraph/generated/ControlStructureTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package io.shiftleft.codepropertygraph.generated; | ||
|
||
import overflowdb.*; | ||
|
||
import java.util.Collection; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class ControlStructureTypes { | ||
|
||
/** Represents a break statement. Labeled breaks are expected to have a JUMP_LABEL | ||
node AST child with ORDER 1 */ | ||
public static final String BREAK = "BREAK"; | ||
|
||
/** Represents a continue statement. Labeled continues are expected to have a JUMP_LABEL | ||
node AST child with ORDER 1 */ | ||
public static final String CONTINUE = "CONTINUE"; | ||
|
||
/** Represents a while statement */ | ||
public static final String WHILE = "WHILE"; | ||
|
||
/** Represents a do statement */ | ||
public static final String DO = "DO"; | ||
|
||
/** Represents a for statement */ | ||
public static final String FOR = "FOR"; | ||
|
||
/** Represents a goto statement */ | ||
public static final String GOTO = "GOTO"; | ||
|
||
/** Represents an if statement */ | ||
public static final String IF = "IF"; | ||
|
||
/** Represents an else statement */ | ||
public static final String ELSE = "ELSE"; | ||
|
||
/** Represents a switch statement */ | ||
public static final String SWITCH = "SWITCH"; | ||
|
||
/** Represents a try statement */ | ||
public static final String TRY = "TRY"; | ||
|
||
/** Represents a throw statement */ | ||
public static final String THROW = "THROW"; | ||
|
||
/** Represents a match expression */ | ||
public static final String MATCH = "MATCH"; | ||
|
||
/** Represents a yield expression */ | ||
public static final String YIELD = "YIELD"; | ||
|
||
|
||
public static Set<String> ALL = new HashSet<String>() {{ | ||
add(BREAK); | ||
add(CONTINUE); | ||
add(WHILE); | ||
add(DO); | ||
add(FOR); | ||
add(GOTO); | ||
add(IF); | ||
add(ELSE); | ||
add(SWITCH); | ||
add(TRY); | ||
add(THROW); | ||
add(MATCH); | ||
add(YIELD); | ||
}}; | ||
|
||
} |
Oops, something went wrong.