From c055fcd884158016b517620e82b3bde00c52a485 Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Sun, 14 Jan 2024 11:21:28 +0000 Subject: [PATCH] Readme update. Use odb2 1.0.0 Signed-off-by: Prabhu Subramanian --- README.md | 7 ++ build.sbt | 8 +- .../generated/nodes/NewNodes.scala | 116 +++++++++--------- 3 files changed, 67 insertions(+), 64 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2e3fdc --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Introduction + +This project is a fork of [codepropertygraph](https://github.com/ShiftLeftSecurity/codepropertygraph) and uses a custom [db](https://github.com/AppThreat/overflowdb2). Further, we have removed the dependency on slf4j and MDC to enable native-image generation. + +## License + +Apache-2.0 diff --git a/build.sbt b/build.sbt index 9cfb4e3..77e543b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,10 @@ name := "cpg2" ThisBuild / organization := "io.appthreat" -ThisBuild / version := "0.0.2" +ThisBuild / version := "1.0.0" ThisBuild / scalaVersion := "3.3.1" // parsed by project/Versions.scala -val overflowdbVersion = "0.0.3" +val overflowdbVersion = "1.0.0" val overflowdbCodegenVersion = "2.103" ThisBuild / Test / fork := true @@ -12,10 +12,6 @@ ThisBuild / Test / javaOptions += s"-Dlog4j2.configurationFile=file:${(ThisBuild // If we fork we immediately stumble upon https://github.com/sbt/sbt/issues/3892 and https://github.com/sbt/sbt/issues/3892 ThisBuild / Test / javaOptions += s"-Duser.dir=${(ThisBuild / baseDirectory).value}" -ThisBuild / libraryDependencies ++= Seq( - // `Optional` means "not transitive", but still included in "stage/lib" -) - publish / skip := true ThisBuild / resolvers ++= Seq( diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala index ed50ef0..7607458 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala @@ -6718,8 +6718,8 @@ class NewBinding override def properties: Map[String, Any] = var res = Map[String, Any]() if !(("") == methodFullName) then res += "METHOD_FULL_NAME" -> methodFullName - if !(("") == name) then res += "NAME" -> name - if !(("") == signature) then res += "SIGNATURE" -> signature + if !(("") == name) then res += "NAME" -> name + if !(("") == signature) then res += "SIGNATURE" -> signature res import NewBinding.{outNeighbors, inNeighbors} @@ -8070,7 +8070,7 @@ class NewBlock lineNumber.map { value => res += "LINE_NUMBER" -> value } if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -9458,11 +9458,11 @@ class NewCall res += "DYNAMIC_TYPE_HINT_FULL_NAME" -> dynamicTypeHintFullName lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == methodFullName) then res += "METHOD_FULL_NAME" -> methodFullName - if !(("") == name) then res += "NAME" -> name - if !((-1: Int) == order) then res += "ORDER" -> order + if !(("") == name) then res += "NAME" -> name + if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes - if !(("") == signature) then res += "SIGNATURE" -> signature + res += "POSSIBLE_TYPES" -> possibleTypes + if !(("") == signature) then res += "SIGNATURE" -> signature if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -10947,7 +10947,7 @@ class NewConfigFile override def properties: Map[String, Any] = var res = Map[String, Any]() if !(("") == content) then res += "CONTENT" -> content - if !(("") == name) then res += "NAME" -> name + if !(("") == name) then res += "NAME" -> name res import NewConfigFile.{outNeighbors, inNeighbors} @@ -12288,7 +12288,7 @@ class NewControlStructure if !(("") == controlStructureType) then res += "CONTROL_STRUCTURE_TYPE" -> controlStructureType lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !((-1: Int) == order) then res += "ORDER" -> order + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == parserTypeName) then res += "PARSER_TYPE_NAME" -> parserTypeName res @@ -12371,7 +12371,7 @@ class NewDependency override def properties: Map[String, Any] = var res = Map[String, Any]() dependencyGroupId.map { value => res += "DEPENDENCY_GROUP_ID" -> value } - if !(("") == name) then res += "NAME" -> name + if !(("") == name) then res += "NAME" -> name if !(("") == version) then res += "VERSION" -> version res @@ -13705,7 +13705,7 @@ class NewFieldIdentifier if !((-1: Int) == argumentIndex) then res += "ARGUMENT_INDEX" -> argumentIndex argumentName.map { value => res += "ARGUMENT_NAME" -> value } if !(("") == canonicalName) then res += "CANONICAL_NAME" -> canonicalName - if !(("") == code) then res += "CODE" -> code + if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } lineNumber.map { value => res += "LINE_NUMBER" -> value } if !((-1: Int) == order) then res += "ORDER" -> order @@ -16472,7 +16472,7 @@ class NewIdentifier if !(("") == name) then res += "NAME" -> name if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -19182,8 +19182,8 @@ class NewJumpLabel if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !(("") == name) then res += "NAME" -> name - if !((-1: Int) == order) then res += "ORDER" -> order + if !(("") == name) then res += "NAME" -> name + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == parserTypeName) then res += "PARSER_TYPE_NAME" -> parserTypeName res @@ -20519,11 +20519,11 @@ class NewJumpTarget override def properties: Map[String, Any] = var res = Map[String, Any]() if !((-1: Int) == argumentIndex) then res += "ARGUMENT_INDEX" -> argumentIndex - if !(("") == code) then res += "CODE" -> code + if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !(("") == name) then res += "NAME" -> name - if !((-1: Int) == order) then res += "ORDER" -> order + if !(("") == name) then res += "NAME" -> name + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == parserTypeName) then res += "PARSER_TYPE_NAME" -> parserTypeName res @@ -20595,7 +20595,7 @@ class NewKeyValuePair override def properties: Map[String, Any] = var res = Map[String, Any]() if !(("") == key) then res += "KEY" -> key - if !(("") == value) then res += "VALUE" -> value + if !(("") == value) then res += "VALUE" -> value res import NewKeyValuePair.{outNeighbors, inNeighbors} @@ -21944,7 +21944,7 @@ class NewLiteral lineNumber.map { value => res += "LINE_NUMBER" -> value } if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -23308,7 +23308,7 @@ class NewLocal if !(("") == name) then res += "NAME" -> name if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -23435,15 +23435,15 @@ class NewLocation override def properties: Map[String, Any] = var res = Map[String, Any]() - if !(("") == className) then res += "CLASS_NAME" -> className + if !(("") == className) then res += "CLASS_NAME" -> className if !(("") == classShortName) then res += "CLASS_SHORT_NAME" -> classShortName - if !(("") == filename) then res += "FILENAME" -> filename + if !(("") == filename) then res += "FILENAME" -> filename lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !(("") == methodFullName) then res += "METHOD_FULL_NAME" -> methodFullName + if !(("") == methodFullName) then res += "METHOD_FULL_NAME" -> methodFullName if !(("") == methodShortName) then res += "METHOD_SHORT_NAME" -> methodShortName - if !(("") == nodeLabel) then res += "NODE_LABEL" -> nodeLabel - if !(("") == packageName) then res += "PACKAGE_NAME" -> packageName - if !(("") == symbol) then res += "SYMBOL" -> symbol + if !(("") == nodeLabel) then res += "NODE_LABEL" -> nodeLabel + if !(("") == packageName) then res += "PACKAGE_NAME" -> packageName + if !(("") == symbol) then res += "SYMBOL" -> symbol node.map { value => res += "node" -> value } res @@ -24800,7 +24800,7 @@ class NewMember if !(("") == name) then res += "NAME" -> name if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -24894,10 +24894,10 @@ class NewMetaData override def properties: Map[String, Any] = var res = Map[String, Any]() hash.map { value => res += "HASH" -> value } - if !(("") == language) then res += "LANGUAGE" -> language + if !(("") == language) then res += "LANGUAGE" -> language if overlays != null && overlays.nonEmpty then res += "OVERLAYS" -> overlays - if !(("") == root) then res += "ROOT" -> root - if !(("") == version) then res += "VERSION" -> version + if !(("") == root) then res += "ROOT" -> root + if !(("") == version) then res += "VERSION" -> version res import NewMetaData.{outNeighbors, inNeighbors} @@ -26278,19 +26278,19 @@ class NewMethod override def properties: Map[String, Any] = var res = Map[String, Any]() if !(("") == astParentFullName) then - res += "AST_PARENT_FULL_NAME" -> astParentFullName + res += "AST_PARENT_FULL_NAME" -> astParentFullName if !(("") == astParentType) then res += "AST_PARENT_TYPE" -> astParentType - if !(("") == code) then res += "CODE" -> code + if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } columnNumberEnd.map { value => res += "COLUMN_NUMBER_END" -> value } - if !(("") == filename) then res += "FILENAME" -> filename + if !(("") == filename) then res += "FILENAME" -> filename if !(("") == fullName) then res += "FULL_NAME" -> fullName hash.map { value => res += "HASH" -> value } if !((false) == isExternal) then res += "IS_EXTERNAL" -> isExternal lineNumber.map { value => res += "LINE_NUMBER" -> value } lineNumberEnd.map { value => res += "LINE_NUMBER_END" -> value } - if !(("") == name) then res += "NAME" -> name - if !((-1: Int) == order) then res += "ORDER" -> order + if !(("") == name) then res += "NAME" -> name + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == signature) then res += "SIGNATURE" -> signature res @@ -27670,14 +27670,14 @@ class NewMethodParameterIn if dynamicTypeHintFullName != null && dynamicTypeHintFullName.nonEmpty then res += "DYNAMIC_TYPE_HINT_FULL_NAME" -> dynamicTypeHintFullName if !(("") == evaluationStrategy) then - res += "EVALUATION_STRATEGY" -> evaluationStrategy - if !((-1: Int) == index) then res += "INDEX" -> index + res += "EVALUATION_STRATEGY" -> evaluationStrategy + if !((-1: Int) == index) then res += "INDEX" -> index if !((false) == isVariadic) then res += "IS_VARIADIC" -> isVariadic lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == name) then res += "NAME" -> name if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -29038,12 +29038,12 @@ class NewMethodParameterOut if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } if !(("") == evaluationStrategy) then - res += "EVALUATION_STRATEGY" -> evaluationStrategy - if !((-1: Int) == index) then res += "INDEX" -> index + res += "EVALUATION_STRATEGY" -> evaluationStrategy + if !((-1: Int) == index) then res += "INDEX" -> index if !((false) == isVariadic) then res += "IS_VARIADIC" -> isVariadic lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !(("") == name) then res += "NAME" -> name - if !((-1: Int) == order) then res += "ORDER" -> order + if !(("") == name) then res += "NAME" -> name + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -30413,9 +30413,9 @@ class NewMethodRef res += "DYNAMIC_TYPE_HINT_FULL_NAME" -> dynamicTypeHintFullName lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == methodFullName) then res += "METHOD_FULL_NAME" -> methodFullName - if !((-1: Int) == order) then res += "ORDER" -> order + if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -31773,7 +31773,7 @@ class NewMethodReturn lineNumber.map { value => res += "LINE_NUMBER" -> value } if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -33104,7 +33104,7 @@ class NewModifier columnNumber.map { value => res += "COLUMN_NUMBER" -> value } lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == modifierType) then res += "MODIFIER_TYPE" -> modifierType - if !((-1: Int) == order) then res += "ORDER" -> order + if !((-1: Int) == order) then res += "ORDER" -> order res import NewModifier.{outNeighbors, inNeighbors} @@ -35762,7 +35762,7 @@ class NewNamespaceBlock var res = Map[String, Any]() if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } - if !(("") == filename) then res += "FILENAME" -> filename + if !(("") == filename) then res += "FILENAME" -> filename if !(("") == fullName) then res += "FULL_NAME" -> fullName lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == name) then res += "NAME" -> name @@ -37195,7 +37195,7 @@ class NewTag override def properties: Map[String, Any] = var res = Map[String, Any]() if !(("") == name) then res += "NAME" -> name - if !(("") == value) then res += "VALUE" -> value + if !(("") == value) then res += "VALUE" -> value res import NewTag.{outNeighbors, inNeighbors} @@ -37256,7 +37256,7 @@ class NewTagNodePair override def properties: Map[String, Any] = var res = Map[String, Any]() if !((null) == node) then res += "node" -> node - if !((null) == tag) then res += "tag" -> tag + if !((null) == tag) then res += "tag" -> tag res import NewTagNodePair.{outNeighbors, inNeighbors} @@ -38688,8 +38688,8 @@ class NewType override def properties: Map[String, Any] = var res = Map[String, Any]() - if !(("") == fullName) then res += "FULL_NAME" -> fullName - if !(("") == name) then res += "NAME" -> name + if !(("") == fullName) then res += "FULL_NAME" -> fullName + if !(("") == name) then res += "NAME" -> name if !(("") == typeDeclFullName) then res += "TYPE_DECL_FULL_NAME" -> typeDeclFullName res @@ -41367,14 +41367,14 @@ class NewTypeDecl var res = Map[String, Any]() aliasTypeFullName.map { value => res += "ALIAS_TYPE_FULL_NAME" -> value } if !(("") == astParentFullName) then - res += "AST_PARENT_FULL_NAME" -> astParentFullName + res += "AST_PARENT_FULL_NAME" -> astParentFullName if !(("") == astParentType) then res += "AST_PARENT_TYPE" -> astParentType - if !(("") == code) then res += "CODE" -> code + if !(("") == code) then res += "CODE" -> code columnNumber.map { value => res += "COLUMN_NUMBER" -> value } - if !(("") == filename) then res += "FILENAME" -> filename + if !(("") == filename) then res += "FILENAME" -> filename if !(("") == fullName) then res += "FULL_NAME" -> fullName if inheritsFromTypeFullName != null && inheritsFromTypeFullName.nonEmpty then - res += "INHERITS_FROM_TYPE_FULL_NAME" -> inheritsFromTypeFullName + res += "INHERITS_FROM_TYPE_FULL_NAME" -> inheritsFromTypeFullName if !((false) == isExternal) then res += "IS_EXTERNAL" -> isExternal lineNumber.map { value => res += "LINE_NUMBER" -> value } if !(("") == name) then res += "NAME" -> name @@ -44071,7 +44071,7 @@ class NewTypeRef lineNumber.map { value => res += "LINE_NUMBER" -> value } if !((-1: Int) == order) then res += "ORDER" -> order if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res @@ -45446,10 +45446,10 @@ class NewUnknown if dynamicTypeHintFullName != null && dynamicTypeHintFullName.nonEmpty then res += "DYNAMIC_TYPE_HINT_FULL_NAME" -> dynamicTypeHintFullName lineNumber.map { value => res += "LINE_NUMBER" -> value } - if !((-1: Int) == order) then res += "ORDER" -> order + if !((-1: Int) == order) then res += "ORDER" -> order if !(("") == parserTypeName) then res += "PARSER_TYPE_NAME" -> parserTypeName if possibleTypes != null && possibleTypes.nonEmpty then - res += "POSSIBLE_TYPES" -> possibleTypes + res += "POSSIBLE_TYPES" -> possibleTypes if !(("") == typeFullName) then res += "TYPE_FULL_NAME" -> typeFullName res