From 7a3d6f246c72bff09349ebf0a5de146209584e98 Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Thu, 4 Jul 2019 15:32:26 +1200 Subject: [PATCH 1/4] finish codegen for latest tinkergraph --- build.sbt | 1 + codepropertygraph/build.sbt | 2 +- cpg1/build.sbt | 18 + .../generated/DispatchTypes.java | 14 + .../generated/EdgeKeyNames.java | 20 + .../codepropertygraph/generated/EdgeKeys.java | 20 + .../generated/EdgeTypes.java | 98 + .../generated/EvaluationStrategies.java | 17 + .../generated/Frameworks.java | 56 + .../generated/Languages.java | 23 + .../generated/ModifierTypes.java | 32 + .../generated/NodeKeyNames.java | 200 +++ .../generated/NodeKeyTypes.java | 73 + .../codepropertygraph/generated/NodeKeys.java | 1091 ++++++++++++ .../generated/NodeTypes.java | 194 ++ .../generated/Operators.java | 167 ++ .../generated/edges/Edges.scala | 1580 +++++++++++++++++ .../generated/nodes/NewNodes.scala | 1010 +++++++++++ .../generated/nodes/Nodes.scala | 381 ++++ project/DomainClassCreator.scala | 152 +- 20 files changed, 5125 insertions(+), 24 deletions(-) create mode 100644 cpg1/build.sbt create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala create mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala diff --git a/build.sbt b/build.sbt index 21c0b7e27..c2309f244 100644 --- a/build.sbt +++ b/build.sbt @@ -50,6 +50,7 @@ lazy val dataflowengine = Projects.dataflowengine lazy val cpgserver = Projects.cpgserver lazy val cpgvalidator = Projects.cpgvalidator lazy val cpg2overflowdb = Projects.cpg2overflowdb +lazy val cpg1 = project.in(file("cpg1")) ThisBuild/publishTo := sonatypePublishTo.value ThisBuild/scalacOptions ++= Seq("-deprecation", "-feature", "-language:implicitConversions") diff --git a/codepropertygraph/build.sbt b/codepropertygraph/build.sbt index 75465b764..e70d575e4 100644 --- a/codepropertygraph/build.sbt +++ b/codepropertygraph/build.sbt @@ -3,7 +3,7 @@ name := "codepropertygraph" dependsOn(Projects.protoBindings) libraryDependencies ++= Seq( - "io.shiftleft" % "tinkergraph-gremlin" % "3.3.4.16", + "io.shiftleft" % "tinkergraph-gremlin" % "3.3.4.17-MP-SNAPSHOT", "com.michaelpollmeier" %% "gremlin-scala" % "3.3.4.13", "com.google.guava" % "guava" % "21.0", "org.apache.commons" % "commons-lang3" % "3.5", diff --git a/cpg1/build.sbt b/cpg1/build.sbt new file mode 100644 index 000000000..fe3ffdbba --- /dev/null +++ b/cpg1/build.sbt @@ -0,0 +1,18 @@ +name := "cpg1" + +dependsOn(Projects.protoBindings) + +libraryDependencies ++= Seq( + "io.shiftleft" % "tinkergraph-gremlin" % "3.3.4.17-MP-SNAPSHOT", + "com.michaelpollmeier" %% "gremlin-scala" % "3.3.4.13", + "com.google.guava" % "guava" % "21.0", + "org.apache.commons" % "commons-lang3" % "3.5", + "commons-io" % "commons-io" % "2.5", + "org.scala-lang.modules" %% "scala-java8-compat" % "0.8.0", + "com.jsuereth" %% "scala-arm" % "2.0", + "com.github.scopt" %% "scopt" % "3.7.0", + "org.apache.logging.log4j" % "log4j-api" % "2.11.0", + "org.apache.logging.log4j" % "log4j-core" % "2.11.0", + "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.11.2" % Runtime, //redirect tinkerpop's slf4j logging to log4j + "org.scalatest" %% "scalatest" % "3.0.3" % Test +) diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java new file mode 100644 index 000000000..11b9e4119 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java @@ -0,0 +1,14 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class DispatchTypes { + +/** For statically dispatched calls the call target is known before program execution */ +public static final String STATIC_DISPATCH = "STATIC_DISPATCH"; + +/** For dynamically dispatched calls the target is determined during runtime */ +public static final String DYNAMIC_DISPATCH = "DYNAMIC_DISPATCH"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java new file mode 100644 index 000000000..8440234f0 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java @@ -0,0 +1,20 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class EdgeKeyNames { + +/** Defines whether a PROPAGATE edge creates an alias */ +public static final String ALIAS = "ALIAS"; + +/** The condition result under which a CFG edge is followed */ +public static final String CONDITION = "CONDITION"; + +/** Index of referenced CONTAINED node (0 based) - used together with cardinality=list */ +public static final String INDEX = "INDEX"; + +/** Local name of referenced CONTAINED node */ +public static final String LOCAL_NAME = "LOCAL_NAME"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java new file mode 100644 index 000000000..de24268f5 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java @@ -0,0 +1,20 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class EdgeKeys { + +/** Defines whether a PROPAGATE edge creates an alias */ +public static final Key ALIAS = new Key<>("ALIAS"); + +/** The condition result under which a CFG edge is followed */ +public static final Key CONDITION = new Key<>("CONDITION"); + +/** Index of referenced CONTAINED node (0 based) - used together with cardinality=list */ +public static final Key INDEX = new Key<>("INDEX"); + +/** Local name of referenced CONTAINED node */ +public static final Key LOCAL_NAME = new Key<>("LOCAL_NAME"); + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java new file mode 100644 index 000000000..a70ae838b --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java @@ -0,0 +1,98 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class EdgeTypes { + +/** Alias relation between types */ +public static final String ALIAS_OF = "ALIAS_OF"; + +/** Syntax child */ +public static final String AST = "AST"; + +/** Link between FRAMEWORK and FRAMEWORK_DATA nodes */ +public static final String ATTACHED_DATA = "ATTACHED_DATA"; + +/** Type argument binding to a type parameter */ +public static final String BINDS_TO = "BINDS_TO"; + +/** Referencing to e.g. a LOCAL */ +public static final String CALL = "CALL"; + +/** Function call argument */ +public static final String CALL_ARG = "CALL_ARG"; + +/** Function call output argument. Goes from METHOD_PARAMETER_OUT to call argument node */ +public static final String CALL_ARG_OUT = "CALL_ARG_OUT"; + +/** Function call return value */ +public static final String CALL_RET = "CALL_RET"; + +/** Represents the capturing of a variable into a closure */ +public static final String CAPTURE = "CAPTURE"; + +/** Connection between a captured LOCAL and the corresponding CLOSURE_BINDING */ +public static final String CAPTURED_BY = "CAPTURED_BY"; + +/** Control dependency graph */ +public static final String CDG = "CDG"; + +/** Control flow */ +public static final String CFG = "CFG"; + +/** Shortcut over multiple AST edges */ +public static final String CONTAINS = "CONTAINS"; + +/** Membership relation for a compound object */ +public static final String CONTAINS_NODE = "CONTAINS_NODE"; + +/** Points to dominated node in DOM tree */ +public static final String DOMINATE = "DOMINATE"; + +/** Link to evaluation type */ +public static final String EVAL_TYPE = "EVAL_TYPE"; + +/** Inheritance relation between types */ +public static final String INHERITS_FROM = "INHERITS_FROM"; + +/** */ +public static final String IS_SENSITIVE_DATA_DESCR_OF = "IS_SENSITIVE_DATA_DESCR_OF"; + +/** */ +public static final String IS_SENSITIVE_DATA_DESCR_OF_REF = "IS_SENSITIVE_DATA_DESCR_OF_REF"; + +/** */ +public static final String IS_SENSITIVE_DATA_OF_TYPE = "IS_SENSITIVE_DATA_OF_TYPE"; + +/** Links together corresponding METHOD_PARAMETER_IN and METHOD_PARAMETER_OUT nodes */ +public static final String PARAMETER_LINK = "PARAMETER_LINK"; + +/** Points to dominated node in post DOM tree */ +public static final String POST_DOMINATE = "POST_DOMINATE"; + +/** Encodes propagation of data from on node to another */ +public static final String PROPAGATE = "PROPAGATE"; + +/** Reaching definition edge */ +public static final String REACHING_DEF = "REACHING_DEF"; + +/** The receiver of a method call which is either an object or a pointer */ +public static final String RECEIVER = "RECEIVER"; + +/** A reference to e.g. a LOCAL */ +public static final String REF = "REF"; + +/** Indicates the concrete TYPE for references aka IDENTIFIER or CALL(those which return references) nodes */ +public static final String RESOLVED_TO = "RESOLVED_TO"; + +/** Edges from nodes to tags */ +public static final String TAGGED_BY = "TAGGED_BY"; + +/** Indicates taint removal. Only present between corresponding METHOD_PARAMETER_IN and METHOD_PARAMETER_OUT nodes */ +public static final String TAINT_REMOVE = "TAINT_REMOVE"; + +/** Indicates that a method is part of the vtable of a certain type declaration */ +public static final String VTABLE = "VTABLE"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java new file mode 100644 index 000000000..0d3eb8886 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java @@ -0,0 +1,17 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class EvaluationStrategies { + +/** A parameter or return of a function is passed by reference which means an address is used behind the scenes */ +public static final String BY_REFERENCE = "BY_REFERENCE"; + +/** Only applicable to object parameter or return values. The pointer to the object is passed by value but the object itself is not copied and changes to it are thus propagated out of the method context */ +public static final String BY_SHARING = "BY_SHARING"; + +/** A parameter or return of a function passed by value which means a flat copy is used */ +public static final String BY_VALUE = "BY_VALUE"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java new file mode 100644 index 000000000..f71681868 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java @@ -0,0 +1,56 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class Frameworks { + +/** Play framework */ +public static final String PLAY = "PLAY"; + +/** Google web toolkit */ +public static final String GWT = "GWT"; + +/** Java spring framework */ +public static final String SPRING = "SPRING"; + +/** Polyglot event-driven framework */ +public static final String VERTX = "VERTX"; + +/** JavaServer Faces */ +public static final String JSF = "JSF"; + +/** Java Servlet based frameworks */ +public static final String SERVLET = "SERVLET"; + +/** JAX-RS */ +public static final String JAXRS = "JAXRS"; + +/** Spark micro web framework */ +public static final String SPARK = "SPARK"; + +/** Microsoft ASP.NET Core */ +public static final String ASP_NET_CORE = "ASP_NET_CORE"; + +/** Microsoft ASP.NET Web API */ +public static final String ASP_NET_WEB_API = "ASP_NET_WEB_API"; + +/** Microsoft ASP.NET MVC */ +public static final String ASP_NET_MVC = "ASP_NET_MVC"; + +/** JAX-WS */ +public static final String JAXWS = "JAXWS"; + +/** Microsoft ASP.NET Web UI */ +public static final String ASP_NET_WEB_UI = "ASP_NET_WEB_UI"; + +/** Framework facilities directly provided by Java */ +public static final String JAVA_INTERNAL = "JAVA_INTERNAL"; + +/** Dropwizard framework */ +public static final String DROPWIZARD = "DROPWIZARD"; + +/** WCF HTTP and REST */ +public static final String WCF = "WCF"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java new file mode 100644 index 000000000..f56de62b8 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java @@ -0,0 +1,23 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class Languages { + +/** */ +public static final String JAVA = "JAVA"; + +/** */ +public static final String JAVASCRIPT = "JAVASCRIPT"; + +/** */ +public static final String GOLANG = "GOLANG"; + +/** */ +public static final String CSHARP = "CSHARP"; + +/** */ +public static final String C = "C"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java new file mode 100644 index 000000000..89551e52a --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java @@ -0,0 +1,32 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class ModifierTypes { + +/** The static modifier */ +public static final String STATIC = "STATIC"; + +/** The public modifier */ +public static final String PUBLIC = "PUBLIC"; + +/** The protected modifier */ +public static final String PROTECTED = "PROTECTED"; + +/** The private modifier */ +public static final String PRIVATE = "PRIVATE"; + +/** The abstract modifier */ +public static final String ABSTRACT = "ABSTRACT"; + +/** The native modifier */ +public static final String NATIVE = "NATIVE"; + +/** The constructor modifier */ +public static final String CONSTRUCTOR = "CONSTRUCTOR"; + +/** The virtual modifier */ +public static final String VIRTUAL = "VIRTUAL"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java new file mode 100644 index 000000000..36477e421 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java @@ -0,0 +1,200 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class NodeKeyNames { + +/** Type full name of which a TYPE_DECL is an alias of */ +public static final String ALIAS_TYPE_FULL_NAME = "ALIAS_TYPE_FULL_NAME"; + +/** */ +public static final String ANNOTATION_FULL_NAME = "ANNOTATION_FULL_NAME"; + +/** */ +public static final String ANNOTATION_NAME = "ANNOTATION_NAME"; + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final String ARGUMENT_INDEX = "ARGUMENT_INDEX"; + +/** The FULL_NAME of a the AST parent of an entity */ +public static final String AST_PARENT_FULL_NAME = "AST_PARENT_FULL_NAME"; + +/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ +public static final String AST_PARENT_TYPE = "AST_PARENT_TYPE"; + +/** Binary type signature */ +public static final String BINARY_SIGNATURE = "BINARY_SIGNATURE"; + +/** */ +public static final String CATEGORY = "CATEGORY"; + +/** */ +public static final String CLASS_NAME = "CLASS_NAME"; + +/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ +public static final String CLOSURE_BINDING_ID = "CLOSURE_BINDING_ID"; + +/** The original name of the (potentially mangled) captured variable */ +public static final String CLOSURE_ORIGINAL_NAME = "CLOSURE_ORIGINAL_NAME"; + +/** The code snippet the node represents */ +public static final String CODE = "CODE"; + +/** Column where the code starts */ +public static final String COLUMN_NUMBER = "COLUMN_NUMBER"; + +/** Column where the code ends */ +public static final String COLUMN_NUMBER_END = "COLUMN_NUMBER_END"; + +/** Content of CONFIG_FILE node */ +public static final String CONTENT = "CONTENT"; + +/** The group ID for a dependency */ +public static final String DEPENDENCY_GROUP_ID = "DEPENDENCY_GROUP_ID"; + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final String DEPTH_FIRST_ORDER = "DEPTH_FIRST_ORDER"; + +/** */ +public static final String DESCRIPTION = "DESCRIPTION"; + +/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ +public static final String DISPATCH_TYPE = "DISPATCH_TYPE"; + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final String EVALUATION_STRATEGY = "EVALUATION_STRATEGY"; + +/** */ +public static final String EVALUATION_TYPE = "EVALUATION_TYPE"; + +/** */ +public static final String FILENAME = "FILENAME"; + +/** */ +public static final String FINGERPRINT = "FINGERPRINT"; + +/** Full name of an element, e.g., the class name along, including its package */ +public static final String FULL_NAME = "FULL_NAME"; + +/** Marks that a method has at least one mapping defined from the policies */ +public static final String HAS_MAPPING = "HAS_MAPPING"; + +/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final String INHERITS_FROM_TYPE_FULL_NAME = "INHERITS_FROM_TYPE_FULL_NAME"; + +/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ +public static final String IS_EXTERNAL = "IS_EXTERNAL"; + +/** */ +public static final String IS_STATIC = "IS_STATIC"; + +/** The programming language this graph originates from */ +public static final String LANGUAGE = "LANGUAGE"; + +/** */ +public static final String LINE_NO = "LINE_NO"; + +/** Line where the code starts */ +public static final String LINE_NUMBER = "LINE_NUMBER"; + +/** Line where the code ends */ +public static final String LINE_NUMBER_END = "LINE_NUMBER_END"; + +/** */ +public static final String LINK = "LINK"; + +/** */ +public static final String LITERALS_TO_SINK = "LITERALS_TO_SINK"; + +/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ +public static final String METHOD_FULL_NAME = "METHOD_FULL_NAME"; + +/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ +public static final String METHOD_INST_FULL_NAME = "METHOD_INST_FULL_NAME"; + +/** */ +public static final String METHOD_NAME = "METHOD_NAME"; + +/** */ +public static final String METHOD_SHORT_NAME = "METHOD_SHORT_NAME"; + +/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ +public static final String MODIFIER_TYPE = "MODIFIER_TYPE"; + +/** Name of represented object, e.g., method name */ +public static final String NAME = "NAME"; + +/** */ +public static final String NODE_ID = "NODE_ID"; + +/** */ +public static final String NODE_LABEL = "NODE_LABEL"; + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final String ORDER = "ORDER"; + +/** */ +public static final String PACKAGE_NAME = "PACKAGE_NAME"; + +/** */ +public static final String PARAMETER = "PARAMETER"; + +/** */ +public static final String PARAMETER_INDEX = "PARAMETER_INDEX"; + +/** Type name emitted by parser, only present for logical type UNKNOWN */ +public static final String PARSER_TYPE_NAME = "PARSER_TYPE_NAME"; + +/** */ +public static final String PATH = "PATH"; + +/** */ +public static final String PATTERN = "PATTERN"; + +/** Indicates whether a call was already resolved. If not set this means not yet resolved */ +public static final String RESOLVED = "RESOLVED"; + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final String SCC_ID = "SCC_ID"; + +/** */ +public static final String SCORE = "SCORE"; + +/** Method signature */ +public static final String SIGNATURE = "SIGNATURE"; + +/** */ +public static final String SINK_TYPE = "SINK_TYPE"; + +/** */ +public static final String SOURCE_TYPE = "SOURCE_TYPE"; + +/** */ +public static final String SPID = "SPID"; + +/** */ +public static final String SYMBOL = "SYMBOL"; + +/** */ +public static final String TITLE = "TITLE"; + +/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ +public static final String TYPE_DECL_FULL_NAME = "TYPE_DECL_FULL_NAME"; + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final String TYPE_FULL_NAME = "TYPE_FULL_NAME"; + +/** Tag value */ +public static final String VALUE = "VALUE"; + +/** */ +public static final String VAR_TYPE = "VAR_TYPE"; + +/** A version, given as a string */ +public static final String VERSION = "VERSION"; + +/** */ +public static final String VULN_DESCR = "VULN_DESCR"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java new file mode 100644 index 000000000..bae4774ba --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java @@ -0,0 +1,73 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class NodeKeyTypes { + +public static final String ALIAS_TYPE_FULL_NAME = "string"; +public static final String ANNOTATION_FULL_NAME = "string"; +public static final String ANNOTATION_NAME = "string"; +public static final String ARGUMENT_INDEX = "int"; +public static final String AST_PARENT_FULL_NAME = "string"; +public static final String AST_PARENT_TYPE = "string"; +public static final String BINARY_SIGNATURE = "string"; +public static final String CATEGORY = "string"; +public static final String CLASS_NAME = "string"; +public static final String CLOSURE_BINDING_ID = "string"; +public static final String CLOSURE_ORIGINAL_NAME = "string"; +public static final String CODE = "string"; +public static final String COLUMN_NUMBER = "int"; +public static final String COLUMN_NUMBER_END = "int"; +public static final String CONTENT = "string"; +public static final String DEPENDENCY_GROUP_ID = "string"; +public static final String DEPTH_FIRST_ORDER = "int"; +public static final String DESCRIPTION = "string"; +public static final String DISPATCH_TYPE = "string"; +public static final String EVALUATION_STRATEGY = "string"; +public static final String EVALUATION_TYPE = "string"; +public static final String FILENAME = "string"; +public static final String FINGERPRINT = "string"; +public static final String FULL_NAME = "string"; +public static final String HAS_MAPPING = "boolean"; +public static final String INHERITS_FROM_TYPE_FULL_NAME = "string"; +public static final String IS_EXTERNAL = "boolean"; +public static final String IS_STATIC = "boolean"; +public static final String LANGUAGE = "string"; +public static final String LINE_NO = "string"; +public static final String LINE_NUMBER = "int"; +public static final String LINE_NUMBER_END = "int"; +public static final String LINK = "string"; +public static final String LITERALS_TO_SINK = "string"; +public static final String METHOD_FULL_NAME = "string"; +public static final String METHOD_INST_FULL_NAME = "string"; +public static final String METHOD_NAME = "string"; +public static final String METHOD_SHORT_NAME = "string"; +public static final String MODIFIER_TYPE = "string"; +public static final String NAME = "string"; +public static final String NODE_ID = "string"; +public static final String NODE_LABEL = "string"; +public static final String ORDER = "int"; +public static final String PACKAGE_NAME = "string"; +public static final String PARAMETER = "string"; +public static final String PARAMETER_INDEX = "int"; +public static final String PARSER_TYPE_NAME = "string"; +public static final String PATH = "string"; +public static final String PATTERN = "string"; +public static final String RESOLVED = "boolean"; +public static final String SCC_ID = "int"; +public static final String SCORE = "int"; +public static final String SIGNATURE = "string"; +public static final String SINK_TYPE = "string"; +public static final String SOURCE_TYPE = "string"; +public static final String SPID = "string"; +public static final String SYMBOL = "string"; +public static final String TITLE = "string"; +public static final String TYPE_DECL_FULL_NAME = "string"; +public static final String TYPE_FULL_NAME = "string"; +public static final String VALUE = "string"; +public static final String VAR_TYPE = "string"; +public static final String VERSION = "string"; +public static final String VULN_DESCR = "string"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java new file mode 100644 index 000000000..92bc75e93 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java @@ -0,0 +1,1091 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class NodeKeys { + +/** */ +public static final Key IS_STATIC = new Key<>("IS_STATIC"); + +/** */ +public static final Key PARAMETER_INDEX = new Key<>("PARAMETER_INDEX"); + +/** */ +public static final Key SCORE = new Key<>("SCORE"); + +/** */ +public static final Key ANNOTATION_FULL_NAME = new Key<>("ANNOTATION_FULL_NAME"); + +/** */ +public static final Key ANNOTATION_NAME = new Key<>("ANNOTATION_NAME"); + +/** */ +public static final Key CATEGORY = new Key<>("CATEGORY"); + +/** */ +public static final Key CLASS_NAME = new Key<>("CLASS_NAME"); + +/** */ +public static final Key DESCRIPTION = new Key<>("DESCRIPTION"); + +/** */ +public static final Key EVALUATION_TYPE = new Key<>("EVALUATION_TYPE"); + +/** */ +public static final Key FILENAME = new Key<>("FILENAME"); + +/** */ +public static final Key FINGERPRINT = new Key<>("FINGERPRINT"); + +/** */ +public static final Key LINE_NO = new Key<>("LINE_NO"); + +/** */ +public static final Key LINK = new Key<>("LINK"); + +/** */ +public static final Key LITERALS_TO_SINK = new Key<>("LITERALS_TO_SINK"); + +/** */ +public static final Key METHOD_NAME = new Key<>("METHOD_NAME"); + +/** */ +public static final Key METHOD_SHORT_NAME = new Key<>("METHOD_SHORT_NAME"); + +/** */ +public static final Key NODE_ID = new Key<>("NODE_ID"); + +/** */ +public static final Key NODE_LABEL = new Key<>("NODE_LABEL"); + +/** */ +public static final Key PACKAGE_NAME = new Key<>("PACKAGE_NAME"); + +/** */ +public static final Key PARAMETER = new Key<>("PARAMETER"); + +/** */ +public static final Key PATH = new Key<>("PATH"); + +/** */ +public static final Key PATTERN = new Key<>("PATTERN"); + +/** */ +public static final Key SINK_TYPE = new Key<>("SINK_TYPE"); + +/** */ +public static final Key SOURCE_TYPE = new Key<>("SOURCE_TYPE"); + +/** */ +public static final Key SPID = new Key<>("SPID"); + +/** */ +public static final Key SYMBOL = new Key<>("SYMBOL"); + +/** */ +public static final Key TITLE = new Key<>("TITLE"); + +/** */ +public static final Key VAR_TYPE = new Key<>("VAR_TYPE"); + +/** */ +public static final Key VULN_DESCR = new Key<>("VULN_DESCR"); + +/** A version, given as a string */ +public static final Key VERSION = new Key<>("VERSION"); + +/** Binary type signature */ +public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Content of CONFIG_FILE node */ +public static final Key CONTENT = new Key<>("CONTENT"); + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ +public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); + +/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ +public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); + +/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ +public static final Key MODIFIER_TYPE = new Key<>("MODIFIER_TYPE"); + +/** Indicates whether a call was already resolved. If not set this means not yet resolved */ +public static final Key RESOLVED = new Key<>("RESOLVED"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Marks that a method has at least one mapping defined from the policies */ +public static final Key HAS_MAPPING = new Key<>("HAS_MAPPING"); + +/** Method signature */ +public static final Key SIGNATURE = new Key<>("SIGNATURE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** Tag value */ +public static final Key VALUE = new Key<>("VALUE"); + +/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ +public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); + +/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ +public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); + +/** The FULL_NAME of a the AST parent of an entity */ +public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); + +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ +public static final Key DISPATCH_TYPE = new Key<>("DISPATCH_TYPE"); + +/** The group ID for a dependency */ +public static final Key DEPENDENCY_GROUP_ID = new Key<>("DEPENDENCY_GROUP_ID"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The original name of the (potentially mangled) captured variable */ +public static final Key CLOSURE_ORIGINAL_NAME = new Key<>("CLOSURE_ORIGINAL_NAME"); + +/** The programming language this graph originates from */ +public static final Key LANGUAGE = new Key<>("LANGUAGE"); + +/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ +public static final Key TYPE_DECL_FULL_NAME = new Key<>("TYPE_DECL_FULL_NAME"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key INHERITS_FROM_TYPE_FULL_NAME = new Key<>("INHERITS_FROM_TYPE_FULL_NAME"); + +/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ +public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); + +/** Type full name of which a TYPE_DECL is an alias of */ +public static final Key ALIAS_TYPE_FULL_NAME = new Key<>("ALIAS_TYPE_FULL_NAME"); + +/** Type name emitted by parser, only present for logical type UNKNOWN */ +public static final Key PARSER_TYPE_NAME = new Key<>("PARSER_TYPE_NAME"); + +/** A method annotation */ +public static class ANNOTATION { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +} + +/** A literal value assigned to an ANNOTATION_PARAMETER */ +public static class ANNOTATION_LITERAL { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +} + +/** Formal annotation parameter */ +public static class ANNOTATION_PARAMETER { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +} + +/** Assignment of annotation argument to annotation parameter */ +public static class ANNOTATION_PARAMETER_ASSIGN { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +} + +/** Initialization construct for arrays */ +public static class ARRAY_INITIALIZER { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +} + +/** A structuring block in the AST */ +public static class BLOCK { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** A (method)-call */ +public static class CALL { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ +public static final Key DISPATCH_TYPE = new Key<>("DISPATCH_TYPE"); + +/** Method signature */ +public static final Key SIGNATURE = new Key<>("SIGNATURE"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ +public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Indicates whether a call was already resolved. If not set this means not yet resolved */ +public static final Key RESOLVED = new Key<>("RESOLVED"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** */ +public static class CALL_CHAIN { +} + +/** */ +public static class CALL_SITE { +} + +/** Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method */ +public static class CLOSURE_BINDING { +/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ +public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); + +/** The original name of the (potentially mangled) captured variable */ +public static final Key CLOSURE_ORIGINAL_NAME = new Key<>("CLOSURE_ORIGINAL_NAME"); + +} + +/** A comment */ +public static class COMMENT { +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +} + +/** Configuration file contents. Might be in use by a framework */ +public static class CONFIG_FILE { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Content of CONFIG_FILE node */ +public static final Key CONTENT = new Key<>("CONTENT"); + +} + +/** This node represents a dependency */ +public static class DEPENDENCY { +/** A version, given as a string */ +public static final Key VERSION = new Key<>("VERSION"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** The group ID for a dependency */ +public static final Key DEPENDENCY_GROUP_ID = new Key<>("DEPENDENCY_GROUP_ID"); + +} + +/** */ +public static class DETACHED_TRACKING_POINT { +} + +/** Node representing a source file. Often also the AST root */ +public static class FILE { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +} + +/** */ +public static class FINDING { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** */ +public static final Key CATEGORY = new Key<>("CATEGORY"); + +/** */ +public static final Key TITLE = new Key<>("TITLE"); + +/** */ +public static final Key DESCRIPTION = new Key<>("DESCRIPTION"); + +/** */ +public static final Key SCORE = new Key<>("SCORE"); + +/** */ +public static final Key LINK = new Key<>("LINK"); + +/** */ +public static final Key VULN_DESCR = new Key<>("VULN_DESCR"); + +/** */ +public static final Key PARAMETER = new Key<>("PARAMETER"); + +/** */ +public static final Key METHOD_NAME = new Key<>("METHOD_NAME"); + +/** */ +public static final Key LINE_NO = new Key<>("LINE_NO"); + +/** */ +public static final Key FILENAME = new Key<>("FILENAME"); + +} + +/** */ +public static class FLOW { +} + +/** Indicates the usage of a framework. E.g. java spring. The name key is one of the values from frameworks list */ +public static class FRAMEWORK { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +} + +/** Data used by a framework */ +public static class FRAMEWORK_DATA { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Content of CONFIG_FILE node */ +public static final Key CONTENT = new Key<>("CONTENT"); + +} + +/** An arbitrary identifier/reference */ +public static class IDENTIFIER { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** */ +public static class IOFLOW { +/** */ +public static final Key FINGERPRINT = new Key<>("FINGERPRINT"); + +/** */ +public static final Key LITERALS_TO_SINK = new Key<>("LITERALS_TO_SINK"); + +} + +/** Literal/Constant */ +public static class LITERAL { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** A local variable */ +public static class LOCAL { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ +public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +} + +/** */ +public static class LOCATION { +/** */ +public static final Key SYMBOL = new Key<>("SYMBOL"); + +/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ +public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); + +/** */ +public static final Key METHOD_SHORT_NAME = new Key<>("METHOD_SHORT_NAME"); + +/** */ +public static final Key PACKAGE_NAME = new Key<>("PACKAGE_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** */ +public static final Key CLASS_NAME = new Key<>("CLASS_NAME"); + +/** */ +public static final Key NODE_LABEL = new Key<>("NODE_LABEL"); + +/** */ +public static final Key FILENAME = new Key<>("FILENAME"); + +} + +/** */ +public static class MATCH_INFO { +/** */ +public static final Key PATTERN = new Key<>("PATTERN"); + +/** */ +public static final Key CATEGORY = new Key<>("CATEGORY"); + +} + +/** Member of a class struct or union */ +public static class MEMBER { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +} + +/** Node to save meta data about the graph on its properties. Exactly one node of this type per graph */ +public static class META_DATA { +/** The programming language this graph originates from */ +public static final Key LANGUAGE = new Key<>("LANGUAGE"); + +/** A version, given as a string */ +public static final Key VERSION = new Key<>("VERSION"); + +/** */ +public static final Key SPID = new Key<>("SPID"); + +} + +/** A method/function/procedure */ +public static class METHOD { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +/** Method signature */ +public static final Key SIGNATURE = new Key<>("SIGNATURE"); + +/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ +public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); + +/** The FULL_NAME of a the AST parent of an entity */ +public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Marks that a method has at least one mapping defined from the policies */ +public static final Key HAS_MAPPING = new Key<>("HAS_MAPPING"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +/** Binary type signature */ +public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); + +} + +/** A method instance which always has to reference a method and may have type argument children if the referred to method is a template */ +public static class METHOD_INST { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +/** Method signature */ +public static final Key SIGNATURE = new Key<>("SIGNATURE"); + +/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ +public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); + +} + +/** This node represents a formal parameter going towards the callee side */ +public static class METHOD_PARAMETER_IN { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +} + +/** This node represents a formal parameter going towards the caller side */ +public static class METHOD_PARAMETER_OUT { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +} + +/** Reference to a method instance */ +public static class METHOD_REF { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ +public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** A formal method return */ +public static class METHOD_RETURN { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ +public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** */ +public static class METHOD_SUMMARY { +/** */ +public static final Key IS_STATIC = new Key<>("IS_STATIC"); + +/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ +public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); + +/** Binary type signature */ +public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); + +} + +/** The static-modifier */ +public static class MODIFIER { +/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ +public static final Key MODIFIER_TYPE = new Key<>("MODIFIER_TYPE"); + +} + +/** This node represents a namespace as a whole whereas the NAMESPACE_BLOCK is used for each grouping occurrence of a namespace in code. Single representing NAMESPACE node is required for easier navigation in the query language */ +public static class NAMESPACE { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +} + +/** A reference to a namespace */ +public static class NAMESPACE_BLOCK { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +} + +/** */ +public static class PROGRAM_POINT { +} + +/** */ +public static class READ { +} + +/** A return instruction */ +public static class RETURN { +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** */ +public static class ROUTE { +/** */ +public static final Key PATH = new Key<>("PATH"); + +} + +/** */ +public static class SENSITIVE_DATA_TYPE { +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +} + +/** */ +public static class SENSITIVE_MEMBER { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +} + +/** */ +public static class SENSITIVE_REFERENCE { +} + +/** */ +public static class SENSITIVE_VARIABLE { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +} + +/** */ +public static class SINK { +/** */ +public static final Key SINK_TYPE = new Key<>("SINK_TYPE"); + +} + +/** */ +public static class SOURCE { +/** */ +public static final Key SOURCE_TYPE = new Key<>("SOURCE_TYPE"); + +} + +/** */ +public static class SP_ANNOTATION_PARAMETER { +/** */ +public static final Key ANNOTATION_NAME = new Key<>("ANNOTATION_NAME"); + +/** */ +public static final Key ANNOTATION_FULL_NAME = new Key<>("ANNOTATION_FULL_NAME"); + +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Tag value */ +public static final Key VALUE = new Key<>("VALUE"); + +} + +/** */ +public static class SP_BLACKLIST { +} + +/** A string tag */ +public static class TAG { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Tag value */ +public static final Key VALUE = new Key<>("VALUE"); + +} + +/** Multiple tags */ +public static class TAGS { +} + +/** */ +public static class TAG_NODE_PAIR { +} + +/** */ +public static class TRANSFORM { +} + +/** */ +public static class TRANSFORMATION { +} + +/** A type which always has to reference a type declaration and may have type argument children if the referred to type declaration is a template */ +public static class TYPE { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ +public static final Key TYPE_DECL_FULL_NAME = new Key<>("TYPE_DECL_FULL_NAME"); + +} + +/** Argument for a TYPE_PARAMETER that belongs to a TYPE or METHOD_INST. It binds another TYPE to a TYPE_PARAMETER */ +public static class TYPE_ARGUMENT { +} + +/** A type declaration */ +public static class TYPE_DECL { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** Full name of an element, e.g., the class name along, including its package */ +public static final Key FULL_NAME = new Key<>("FULL_NAME"); + +/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ +public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); + +/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key INHERITS_FROM_TYPE_FULL_NAME = new Key<>("INHERITS_FROM_TYPE_FULL_NAME"); + +/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ +public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); + +/** The FULL_NAME of a the AST parent of an entity */ +public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); + +/** Type full name of which a TYPE_DECL is an alias of */ +public static final Key ALIAS_TYPE_FULL_NAME = new Key<>("ALIAS_TYPE_FULL_NAME"); + +} + +/** Type parameter of TYPE_DECL or METHOD */ +public static class TYPE_PARAMETER { +/** Name of represented object, e.g., method name */ +public static final Key NAME = new Key<>("NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +} + +/** A language-specific node */ +public static class UNKNOWN { +/** The code snippet the node represents */ +public static final Key CODE = new Key<>("CODE"); + +/** Type name emitted by parser, only present for logical type UNKNOWN */ +public static final Key PARSER_TYPE_NAME = new Key<>("PARSER_TYPE_NAME"); + +/** General ordering property. E.g. used to express the ordering of children in the AST */ +public static final Key ORDER = new Key<>("ORDER"); + +/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ +public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); + +/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ +public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); + +/** Line where the code starts */ +public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); + +/** Line where the code ends */ +public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); + +/** Column where the code starts */ +public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); + +/** Column where the code ends */ +public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); + +/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ +public static final Key SCC_ID = new Key<>("SCC_ID"); + +/** The depth first ordering number used to detect back edges in reducible CFGs */ +public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); + +} + +/** */ +public static class VARIABLE_INFO { +/** */ +public static final Key VAR_TYPE = new Key<>("VAR_TYPE"); + +/** */ +public static final Key EVALUATION_TYPE = new Key<>("EVALUATION_TYPE"); + +/** */ +public static final Key PARAMETER_INDEX = new Key<>("PARAMETER_INDEX"); + +} + +/** */ +public static class WRITE { +} + +/** This node records what package prefix is most common to all analysed classes in the CPG */ +public static class PACKAGE_PREFIX { +/** Tag value */ +public static final Key VALUE = new Key<>("VALUE"); + +} + + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java new file mode 100644 index 000000000..7ad59b500 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java @@ -0,0 +1,194 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class NodeTypes { + +/** A method annotation */ +public static final String ANNOTATION = "ANNOTATION"; + +/** A literal value assigned to an ANNOTATION_PARAMETER */ +public static final String ANNOTATION_LITERAL = "ANNOTATION_LITERAL"; + +/** Formal annotation parameter */ +public static final String ANNOTATION_PARAMETER = "ANNOTATION_PARAMETER"; + +/** Assignment of annotation argument to annotation parameter */ +public static final String ANNOTATION_PARAMETER_ASSIGN = "ANNOTATION_PARAMETER_ASSIGN"; + +/** Initialization construct for arrays */ +public static final String ARRAY_INITIALIZER = "ARRAY_INITIALIZER"; + +/** A structuring block in the AST */ +public static final String BLOCK = "BLOCK"; + +/** A (method)-call */ +public static final String CALL = "CALL"; + +/** */ +public static final String CALL_CHAIN = "CALL_CHAIN"; + +/** */ +public static final String CALL_SITE = "CALL_SITE"; + +/** Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method */ +public static final String CLOSURE_BINDING = "CLOSURE_BINDING"; + +/** A comment */ +public static final String COMMENT = "COMMENT"; + +/** Configuration file contents. Might be in use by a framework */ +public static final String CONFIG_FILE = "CONFIG_FILE"; + +/** This node represents a dependency */ +public static final String DEPENDENCY = "DEPENDENCY"; + +/** */ +public static final String DETACHED_TRACKING_POINT = "DETACHED_TRACKING_POINT"; + +/** Node representing a source file. Often also the AST root */ +public static final String FILE = "FILE"; + +/** */ +public static final String FINDING = "FINDING"; + +/** */ +public static final String FLOW = "FLOW"; + +/** Indicates the usage of a framework. E.g. java spring. The name key is one of the values from frameworks list */ +public static final String FRAMEWORK = "FRAMEWORK"; + +/** Data used by a framework */ +public static final String FRAMEWORK_DATA = "FRAMEWORK_DATA"; + +/** An arbitrary identifier/reference */ +public static final String IDENTIFIER = "IDENTIFIER"; + +/** */ +public static final String IOFLOW = "IOFLOW"; + +/** Literal/Constant */ +public static final String LITERAL = "LITERAL"; + +/** A local variable */ +public static final String LOCAL = "LOCAL"; + +/** */ +public static final String LOCATION = "LOCATION"; + +/** */ +public static final String MATCH_INFO = "MATCH_INFO"; + +/** Member of a class struct or union */ +public static final String MEMBER = "MEMBER"; + +/** Node to save meta data about the graph on its properties. Exactly one node of this type per graph */ +public static final String META_DATA = "META_DATA"; + +/** A method/function/procedure */ +public static final String METHOD = "METHOD"; + +/** A method instance which always has to reference a method and may have type argument children if the referred to method is a template */ +public static final String METHOD_INST = "METHOD_INST"; + +/** This node represents a formal parameter going towards the callee side */ +public static final String METHOD_PARAMETER_IN = "METHOD_PARAMETER_IN"; + +/** This node represents a formal parameter going towards the caller side */ +public static final String METHOD_PARAMETER_OUT = "METHOD_PARAMETER_OUT"; + +/** Reference to a method instance */ +public static final String METHOD_REF = "METHOD_REF"; + +/** A formal method return */ +public static final String METHOD_RETURN = "METHOD_RETURN"; + +/** */ +public static final String METHOD_SUMMARY = "METHOD_SUMMARY"; + +/** The static-modifier */ +public static final String MODIFIER = "MODIFIER"; + +/** This node represents a namespace as a whole whereas the NAMESPACE_BLOCK is used for each grouping occurrence of a namespace in code. Single representing NAMESPACE node is required for easier navigation in the query language */ +public static final String NAMESPACE = "NAMESPACE"; + +/** A reference to a namespace */ +public static final String NAMESPACE_BLOCK = "NAMESPACE_BLOCK"; + +/** */ +public static final String PROGRAM_POINT = "PROGRAM_POINT"; + +/** */ +public static final String READ = "READ"; + +/** A return instruction */ +public static final String RETURN = "RETURN"; + +/** */ +public static final String ROUTE = "ROUTE"; + +/** */ +public static final String SENSITIVE_DATA_TYPE = "SENSITIVE_DATA_TYPE"; + +/** */ +public static final String SENSITIVE_MEMBER = "SENSITIVE_MEMBER"; + +/** */ +public static final String SENSITIVE_REFERENCE = "SENSITIVE_REFERENCE"; + +/** */ +public static final String SENSITIVE_VARIABLE = "SENSITIVE_VARIABLE"; + +/** */ +public static final String SINK = "SINK"; + +/** */ +public static final String SOURCE = "SOURCE"; + +/** */ +public static final String SP_ANNOTATION_PARAMETER = "SP_ANNOTATION_PARAMETER"; + +/** */ +public static final String SP_BLACKLIST = "SP_BLACKLIST"; + +/** A string tag */ +public static final String TAG = "TAG"; + +/** Multiple tags */ +public static final String TAGS = "TAGS"; + +/** */ +public static final String TAG_NODE_PAIR = "TAG_NODE_PAIR"; + +/** */ +public static final String TRANSFORM = "TRANSFORM"; + +/** */ +public static final String TRANSFORMATION = "TRANSFORMATION"; + +/** A type which always has to reference a type declaration and may have type argument children if the referred to type declaration is a template */ +public static final String TYPE = "TYPE"; + +/** Argument for a TYPE_PARAMETER that belongs to a TYPE or METHOD_INST. It binds another TYPE to a TYPE_PARAMETER */ +public static final String TYPE_ARGUMENT = "TYPE_ARGUMENT"; + +/** A type declaration */ +public static final String TYPE_DECL = "TYPE_DECL"; + +/** Type parameter of TYPE_DECL or METHOD */ +public static final String TYPE_PARAMETER = "TYPE_PARAMETER"; + +/** A language-specific node */ +public static final String UNKNOWN = "UNKNOWN"; + +/** */ +public static final String VARIABLE_INFO = "VARIABLE_INFO"; + +/** */ +public static final String WRITE = "WRITE"; + +/** This node records what package prefix is most common to all analysed classes in the CPG */ +public static final String PACKAGE_PREFIX = "PACKAGE_PREFIX"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java new file mode 100644 index 000000000..fba682a26 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java @@ -0,0 +1,167 @@ +package io.shiftleft.codepropertygraph.generated; + +import gremlin.scala.Key; + +public class Operators { + +/** */ +public static final String addition = ".addition"; + +/** */ +public static final String subtraction = ".subtraction"; + +/** */ +public static final String multiplication = ".multiplication"; + +/** */ +public static final String division = ".division"; + +/** */ +public static final String exponentiation = ".exponentiation"; + +/** */ +public static final String modulo = ".modulo"; + +/** */ +public static final String shiftLeft = ".shiftLeft"; + +/** Shift right padding with zeros */ +public static final String logicalShiftRight = ".logicalShiftRight"; + +/** Shift right preserving the sign */ +public static final String arithmeticShiftRight = ".arithmeticShiftRight"; + +/** */ +public static final String not = ".not"; + +/** */ +public static final String and = ".and"; + +/** */ +public static final String or = ".or"; + +/** */ +public static final String xor = ".xor"; + +/** */ +public static final String assignmentPlus = ".assignmentPlus"; + +/** */ +public static final String assignmentMinus = ".assignmentMinus"; + +/** */ +public static final String assignmentMultiplication = ".assignmentMultiplication"; + +/** */ +public static final String assignmentDivision = ".assignmentDivision"; + +/** */ +public static final String assignmentExponentiation = ".assignmentExponentiation"; + +/** */ +public static final String assignmentModulo = ".assignmentModulo"; + +/** */ +public static final String assignmentShiftLeft = ".assignmentShiftLeft"; + +/** */ +public static final String assignmentLogicalShifRight = ".assignmentLogicalShifRight"; + +/** */ +public static final String assignmentArithmeticShiftRight = ".assignmentArithmeticShiftRight"; + +/** */ +public static final String assignmentAnd = ".assignmentAnd"; + +/** */ +public static final String assignmentOr = ".assignmentOr"; + +/** */ +public static final String assignmentXor = ".assignmentXor"; + +/** */ +public static final String assignment = ".assignment"; + +/** E.g. `a = -b` */ +public static final String minus = ".minus"; + +/** E.g. `a = +b` */ +public static final String plus = ".plus"; + +/** */ +public static final String preIncrement = ".preIncrement"; + +/** */ +public static final String preDecrement = ".preDecrement"; + +/** */ +public static final String postIncrement = ".postIncrement"; + +/** */ +public static final String postDecrement = ".postDecrement"; + +/** */ +public static final String logicalNot = ".logicalNot"; + +/** */ +public static final String logicalOr = ".logicalOr"; + +/** */ +public static final String logicalAnd = ".logicalAnd"; + +/** */ +public static final String equals = ".equals"; + +/** */ +public static final String notEquals = ".notEquals"; + +/** */ +public static final String greaterThan = ".greaterThan"; + +/** */ +public static final String lessThan = ".lessThan"; + +/** */ +public static final String greaterEqualsThan = ".greaterEqualsThan"; + +/** */ +public static final String lessEqualsThan = ".lessEqualsThan"; + +/** */ +public static final String instanceOf = ".instanceOf"; + +/** E.g. in C: `a.b` but not! in Java */ +public static final String memberAccess = ".memberAccess"; + +/** E.g. in C: `a->b` and `a.b` in Java */ +public static final String indirectMemberAccess = ".indirectMemberAccess"; + +/** E.g. in C: `a[b]` but not! in Java */ +public static final String computedMemberAccess = ".computedMemberAccess"; + +/** E.g. in C++: `a->*b` and a[b] in Java */ +public static final String indirectComputedMemberAccess = ".indirectComputedMemberAccess"; + +/** E.g. in C: `*a` */ +public static final String indirection = ".indirection"; + +/** Deletes a property from a namespace. E.g. `a=3; delete a; a == undefined; */ +public static final String delete = ".delete"; + +/** E.g. `a ? consequent : alternate`. In future probably also used for if statements */ +public static final String conditional = ".conditional"; + +/** Type casts of any sort */ +public static final String cast = ".cast"; + +/** Comparison between two arguments with the results: 0 == equal, negative == left < right, positive == left > right */ +public static final String compare = ".compare"; + +/** Returns the address of a given object */ +public static final String addressOf = ".addressOf"; + +/** Returns the size of a given object */ +public static final String sizeOf = ".sizeOf"; + + +} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala new file mode 100644 index 000000000..6380a30c0 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala @@ -0,0 +1,1580 @@ + package io.shiftleft.codepropertygraph.generated.edges + + import java.lang.{Boolean => JBoolean, Long => JLong} + import java.util.{HashMap => JHashMap, Set => JSet, TreeMap} + import org.apache.tinkerpop.gremlin.structure.Property + import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} + import org.apache.tinkerpop.gremlin.tinkergraph.structure.{EdgeRef, SpecializedElementFactory, SpecializedTinkerEdge, TinkerGraph, TinkerProperty, TinkerVertex, VertexRef} + import scala.collection.JavaConverters._ + + object Factories { +// lazy val All: List[SpecializedElementFactory.ForEdge[_]] = List(AliasOf.Factory, Ast.Factory, AttachedData.Factory, BindsTo.Factory, Call.Factory, CallArg.Factory, CallArgOut.Factory, CallRet.Factory, Capture.Factory, CapturedBy.Factory, Cdg.Factory, Cfg.Factory, Contains.Factory, ContainsNode.Factory, Dominate.Factory, EvalType.Factory, InheritsFrom.Factory, IsSensitiveDataDescrOf.Factory, IsSensitiveDataDescrOfRef.Factory, IsSensitiveDataOfType.Factory, ParameterLink.Factory, PostDominate.Factory, Propagate.Factory, ReachingDef.Factory, Receiver.Factory, Ref.Factory, ResolvedTo.Factory, TaggedBy.Factory, TaintRemove.Factory, Vtable.Factory) +// lazy val AllAsJava: java.util.List[SpecializedElementFactory.ForEdge[_]] = All.asJava + } + + +object ContainsNode { + val Label = "CONTAINS_NODE" + object Keys { + val LocalName = "LOCAL_NAME" + object Indices { + val LocalName = 0 + } + + val All: JSet[String] = Set(LocalName).asJava + val KeyToValue: Map[String, ContainsNodeDb => Any] = Map( + LocalName -> { instance: ContainsNodeDb => instance.localName()}, + ) + } + + val Factory = new SpecializedElementFactory.ForEdge[ContainsNodeDb] { + override val forLabel = ContainsNode.Label + + override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = + new ContainsNodeDb(graph, id, outVertex, inVertex) + + override def createEdgeRef(edge: ContainsNodeDb) = ContainsNode(edge) + + override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = + ContainsNode(id, graph) + + /* XXX0 new part start*/ + override def propertyNamesByIndex() = { + val ret = new JHashMap[Integer, String] + ret.put(ContainsNode.Keys.Indices.LocalName, ContainsNode.Keys.LocalName) + ret + } + override def propertyTypeByIndex() = { + val ret = new JHashMap[Integer, Class[_]] + ret.put(ContainsNode.Keys.Indices.LocalName, classOf[String]) + ret + } + /* XXX0 new part end*/ + } + + def apply(wrapped: ContainsNodeDb) = new EdgeRef(wrapped) with ContainsNode + def apply(id: Long, graph: TinkerGraph) = + new EdgeRef[ContainsNodeDb](id, ContainsNode.Label, graph) with ContainsNode +} + trait ContainsNode extends EdgeRef[ContainsNodeDb] + class ContainsNodeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) + extends SpecializedTinkerEdge(_graph, _id, _outVertex, ContainsNode.Label, _inVertex, ContainsNode.Keys.All) { + + /* XXX0 new part start */ + private var _localName: Option[String] = None +def localName(): Option[String] = _localName + /* XXX0 new part end */ + + /* XXX0 new part start */ + override def propertiesByStorageIdx = { + val properties = new TreeMap[Integer, Object] + // TODO optimise: load all properties in one go rather than lazily + localName.map { value => properties.put(ContainsNode.Keys.Indices.LocalName, value) } + properties + } + /* XXX0 new part end */ + + override protected def specificProperty[A](key: String): Property[A] = + ContainsNode.Keys.KeyToValue.get(key) match { + case None => Property.empty[A] + case Some(fieldAccess) => + fieldAccess(this) match { + case null | None => Property.empty[A] + case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) + case value => new TinkerProperty(this, key, value.asInstanceOf[A]) + } + } + + override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { + if (key == "LOCAL_NAME") this._localName = Option(value).asInstanceOf[Option[String]] + else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") + property(key) + } + + override protected def removeSpecificProperty(key: String): Unit = + if (key == "LOCAL_NAME") this._localName = null + else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") + } + + +// object AliasOf { +// val Label = "ALIAS_OF" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, AliasOfDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[AliasOfDb] { +// override val forLabel = AliasOf.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new AliasOfDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: AliasOfDb) = AliasOf(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// AliasOf(id, graph) +// } + +// def apply(wrapped: AliasOfDb) = new EdgeRef(wrapped) with AliasOf +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[AliasOfDb](id, AliasOf.Label, graph) with AliasOf +// } +// trait AliasOf extends EdgeRef[AliasOfDb] +// class AliasOfDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, AliasOf.Label, _inVertex, AliasOf.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// AliasOf.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Ast { +// val Label = "AST" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, AstDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[AstDb] { +// override val forLabel = Ast.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new AstDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: AstDb) = Ast(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Ast(id, graph) +// } + +// def apply(wrapped: AstDb) = new EdgeRef(wrapped) with Ast +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[AstDb](id, Ast.Label, graph) with Ast +// } +// trait Ast extends EdgeRef[AstDb] +// class AstDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Ast.Label, _inVertex, Ast.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Ast.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object AttachedData { +// val Label = "ATTACHED_DATA" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, AttachedDataDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[AttachedDataDb] { +// override val forLabel = AttachedData.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new AttachedDataDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: AttachedDataDb) = AttachedData(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// AttachedData(id, graph) +// } + +// def apply(wrapped: AttachedDataDb) = new EdgeRef(wrapped) with AttachedData +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[AttachedDataDb](id, AttachedData.Label, graph) with AttachedData +// } +// trait AttachedData extends EdgeRef[AttachedDataDb] +// class AttachedDataDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, AttachedData.Label, _inVertex, AttachedData.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// AttachedData.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object BindsTo { +// val Label = "BINDS_TO" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, BindsToDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[BindsToDb] { +// override val forLabel = BindsTo.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new BindsToDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: BindsToDb) = BindsTo(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// BindsTo(id, graph) +// } + +// def apply(wrapped: BindsToDb) = new EdgeRef(wrapped) with BindsTo +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[BindsToDb](id, BindsTo.Label, graph) with BindsTo +// } +// trait BindsTo extends EdgeRef[BindsToDb] +// class BindsToDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, BindsTo.Label, _inVertex, BindsTo.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// BindsTo.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Call { +// val Label = "CALL" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CallDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CallDb] { +// override val forLabel = Call.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CallDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CallDb) = Call(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Call(id, graph) +// } + +// def apply(wrapped: CallDb) = new EdgeRef(wrapped) with Call +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CallDb](id, Call.Label, graph) with Call +// } +// trait Call extends EdgeRef[CallDb] +// class CallDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Call.Label, _inVertex, Call.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Call.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object CallArg { +// val Label = "CALL_ARG" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CallArgDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CallArgDb] { +// override val forLabel = CallArg.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CallArgDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CallArgDb) = CallArg(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// CallArg(id, graph) +// } + +// def apply(wrapped: CallArgDb) = new EdgeRef(wrapped) with CallArg +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CallArgDb](id, CallArg.Label, graph) with CallArg +// } +// trait CallArg extends EdgeRef[CallArgDb] +// class CallArgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallArg.Label, _inVertex, CallArg.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// CallArg.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object CallArgOut { +// val Label = "CALL_ARG_OUT" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CallArgOutDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CallArgOutDb] { +// override val forLabel = CallArgOut.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CallArgOutDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CallArgOutDb) = CallArgOut(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// CallArgOut(id, graph) +// } + +// def apply(wrapped: CallArgOutDb) = new EdgeRef(wrapped) with CallArgOut +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CallArgOutDb](id, CallArgOut.Label, graph) with CallArgOut +// } +// trait CallArgOut extends EdgeRef[CallArgOutDb] +// class CallArgOutDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallArgOut.Label, _inVertex, CallArgOut.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// CallArgOut.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object CallRet { +// val Label = "CALL_RET" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CallRetDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CallRetDb] { +// override val forLabel = CallRet.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CallRetDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CallRetDb) = CallRet(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// CallRet(id, graph) +// } + +// def apply(wrapped: CallRetDb) = new EdgeRef(wrapped) with CallRet +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CallRetDb](id, CallRet.Label, graph) with CallRet +// } +// trait CallRet extends EdgeRef[CallRetDb] +// class CallRetDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallRet.Label, _inVertex, CallRet.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// CallRet.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Capture { +// val Label = "CAPTURE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CaptureDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CaptureDb] { +// override val forLabel = Capture.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CaptureDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CaptureDb) = Capture(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Capture(id, graph) +// } + +// def apply(wrapped: CaptureDb) = new EdgeRef(wrapped) with Capture +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CaptureDb](id, Capture.Label, graph) with Capture +// } +// trait Capture extends EdgeRef[CaptureDb] +// class CaptureDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Capture.Label, _inVertex, Capture.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Capture.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object CapturedBy { +// val Label = "CAPTURED_BY" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CapturedByDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CapturedByDb] { +// override val forLabel = CapturedBy.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CapturedByDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CapturedByDb) = CapturedBy(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// CapturedBy(id, graph) +// } + +// def apply(wrapped: CapturedByDb) = new EdgeRef(wrapped) with CapturedBy +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CapturedByDb](id, CapturedBy.Label, graph) with CapturedBy +// } +// trait CapturedBy extends EdgeRef[CapturedByDb] +// class CapturedByDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CapturedBy.Label, _inVertex, CapturedBy.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// CapturedBy.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Cdg { +// val Label = "CDG" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CdgDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CdgDb] { +// override val forLabel = Cdg.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CdgDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CdgDb) = Cdg(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Cdg(id, graph) +// } + +// def apply(wrapped: CdgDb) = new EdgeRef(wrapped) with Cdg +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CdgDb](id, Cdg.Label, graph) with Cdg +// } +// trait Cdg extends EdgeRef[CdgDb] +// class CdgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Cdg.Label, _inVertex, Cdg.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Cdg.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Cfg { +// val Label = "CFG" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, CfgDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[CfgDb] { +// override val forLabel = Cfg.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new CfgDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: CfgDb) = Cfg(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Cfg(id, graph) +// } + +// def apply(wrapped: CfgDb) = new EdgeRef(wrapped) with Cfg +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[CfgDb](id, Cfg.Label, graph) with Cfg +// } +// trait Cfg extends EdgeRef[CfgDb] +// class CfgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Cfg.Label, _inVertex, Cfg.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Cfg.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Contains { +// val Label = "CONTAINS" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, ContainsDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[ContainsDb] { +// override val forLabel = Contains.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new ContainsDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: ContainsDb) = Contains(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Contains(id, graph) +// } + +// def apply(wrapped: ContainsDb) = new EdgeRef(wrapped) with Contains +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[ContainsDb](id, Contains.Label, graph) with Contains +// } +// trait Contains extends EdgeRef[ContainsDb] +// class ContainsDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Contains.Label, _inVertex, Contains.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Contains.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Dominate { +// val Label = "DOMINATE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, DominateDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[DominateDb] { +// override val forLabel = Dominate.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new DominateDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: DominateDb) = Dominate(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Dominate(id, graph) +// } + +// def apply(wrapped: DominateDb) = new EdgeRef(wrapped) with Dominate +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[DominateDb](id, Dominate.Label, graph) with Dominate +// } +// trait Dominate extends EdgeRef[DominateDb] +// class DominateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Dominate.Label, _inVertex, Dominate.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Dominate.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object EvalType { +// val Label = "EVAL_TYPE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, EvalTypeDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[EvalTypeDb] { +// override val forLabel = EvalType.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new EvalTypeDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: EvalTypeDb) = EvalType(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// EvalType(id, graph) +// } + +// def apply(wrapped: EvalTypeDb) = new EdgeRef(wrapped) with EvalType +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[EvalTypeDb](id, EvalType.Label, graph) with EvalType +// } +// trait EvalType extends EdgeRef[EvalTypeDb] +// class EvalTypeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, EvalType.Label, _inVertex, EvalType.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// EvalType.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object InheritsFrom { +// val Label = "INHERITS_FROM" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, InheritsFromDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[InheritsFromDb] { +// override val forLabel = InheritsFrom.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new InheritsFromDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: InheritsFromDb) = InheritsFrom(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// InheritsFrom(id, graph) +// } + +// def apply(wrapped: InheritsFromDb) = new EdgeRef(wrapped) with InheritsFrom +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[InheritsFromDb](id, InheritsFrom.Label, graph) with InheritsFrom +// } +// trait InheritsFrom extends EdgeRef[InheritsFromDb] +// class InheritsFromDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, InheritsFrom.Label, _inVertex, InheritsFrom.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// InheritsFrom.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object IsSensitiveDataDescrOf { +// val Label = "IS_SENSITIVE_DATA_DESCR_OF" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, IsSensitiveDataDescrOfDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataDescrOfDb] { +// override val forLabel = IsSensitiveDataDescrOf.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new IsSensitiveDataDescrOfDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: IsSensitiveDataDescrOfDb) = IsSensitiveDataDescrOf(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// IsSensitiveDataDescrOf(id, graph) +// } + +// def apply(wrapped: IsSensitiveDataDescrOfDb) = new EdgeRef(wrapped) with IsSensitiveDataDescrOf +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[IsSensitiveDataDescrOfDb](id, IsSensitiveDataDescrOf.Label, graph) with IsSensitiveDataDescrOf +// } +// trait IsSensitiveDataDescrOf extends EdgeRef[IsSensitiveDataDescrOfDb] +// class IsSensitiveDataDescrOfDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataDescrOf.Label, _inVertex, IsSensitiveDataDescrOf.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// IsSensitiveDataDescrOf.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object IsSensitiveDataDescrOfRef { +// val Label = "IS_SENSITIVE_DATA_DESCR_OF_REF" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, IsSensitiveDataDescrOfRefDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataDescrOfRefDb] { +// override val forLabel = IsSensitiveDataDescrOfRef.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new IsSensitiveDataDescrOfRefDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: IsSensitiveDataDescrOfRefDb) = IsSensitiveDataDescrOfRef(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// IsSensitiveDataDescrOfRef(id, graph) +// } + +// def apply(wrapped: IsSensitiveDataDescrOfRefDb) = new EdgeRef(wrapped) with IsSensitiveDataDescrOfRef +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[IsSensitiveDataDescrOfRefDb](id, IsSensitiveDataDescrOfRef.Label, graph) with IsSensitiveDataDescrOfRef +// } +// trait IsSensitiveDataDescrOfRef extends EdgeRef[IsSensitiveDataDescrOfRefDb] +// class IsSensitiveDataDescrOfRefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataDescrOfRef.Label, _inVertex, IsSensitiveDataDescrOfRef.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// IsSensitiveDataDescrOfRef.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object IsSensitiveDataOfType { +// val Label = "IS_SENSITIVE_DATA_OF_TYPE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, IsSensitiveDataOfTypeDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataOfTypeDb] { +// override val forLabel = IsSensitiveDataOfType.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new IsSensitiveDataOfTypeDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: IsSensitiveDataOfTypeDb) = IsSensitiveDataOfType(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// IsSensitiveDataOfType(id, graph) +// } + +// def apply(wrapped: IsSensitiveDataOfTypeDb) = new EdgeRef(wrapped) with IsSensitiveDataOfType +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[IsSensitiveDataOfTypeDb](id, IsSensitiveDataOfType.Label, graph) with IsSensitiveDataOfType +// } +// trait IsSensitiveDataOfType extends EdgeRef[IsSensitiveDataOfTypeDb] +// class IsSensitiveDataOfTypeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataOfType.Label, _inVertex, IsSensitiveDataOfType.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// IsSensitiveDataOfType.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object ParameterLink { +// val Label = "PARAMETER_LINK" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, ParameterLinkDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[ParameterLinkDb] { +// override val forLabel = ParameterLink.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new ParameterLinkDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: ParameterLinkDb) = ParameterLink(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// ParameterLink(id, graph) +// } + +// def apply(wrapped: ParameterLinkDb) = new EdgeRef(wrapped) with ParameterLink +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[ParameterLinkDb](id, ParameterLink.Label, graph) with ParameterLink +// } +// trait ParameterLink extends EdgeRef[ParameterLinkDb] +// class ParameterLinkDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ParameterLink.Label, _inVertex, ParameterLink.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// ParameterLink.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object PostDominate { +// val Label = "POST_DOMINATE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, PostDominateDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[PostDominateDb] { +// override val forLabel = PostDominate.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new PostDominateDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: PostDominateDb) = PostDominate(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// PostDominate(id, graph) +// } + +// def apply(wrapped: PostDominateDb) = new EdgeRef(wrapped) with PostDominate +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[PostDominateDb](id, PostDominate.Label, graph) with PostDominate +// } +// trait PostDominate extends EdgeRef[PostDominateDb] +// class PostDominateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, PostDominate.Label, _inVertex, PostDominate.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// PostDominate.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Propagate { +// val Label = "PROPAGATE" +// object Keys { +// val All: JSet[String] = Set("ALIAS").asJava +// val KeyToValue: Map[String, PropagateDb => Any] = Map( +// "ALIAS" -> { instance: PropagateDb => instance.alias()} +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[PropagateDb] { +// override val forLabel = Propagate.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new PropagateDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: PropagateDb) = Propagate(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Propagate(id, graph) +// } + +// def apply(wrapped: PropagateDb) = new EdgeRef(wrapped) with Propagate +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[PropagateDb](id, Propagate.Label, graph) with Propagate +// } +// trait Propagate extends EdgeRef[PropagateDb] +// class PropagateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Propagate.Label, _inVertex, Propagate.Keys.All) { + +// private var _alias: JBoolean = null +// def alias(): JBoolean = _alias +// override protected def specificProperty[A](key: String): Property[A] = +// Propagate.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// if (key == "ALIAS") this._alias = value.asInstanceOf[JBoolean] +// else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// if (key == "ALIAS") this._alias = null +// else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object ReachingDef { +// val Label = "REACHING_DEF" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, ReachingDefDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[ReachingDefDb] { +// override val forLabel = ReachingDef.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new ReachingDefDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: ReachingDefDb) = ReachingDef(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// ReachingDef(id, graph) +// } + +// def apply(wrapped: ReachingDefDb) = new EdgeRef(wrapped) with ReachingDef +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[ReachingDefDb](id, ReachingDef.Label, graph) with ReachingDef +// } +// trait ReachingDef extends EdgeRef[ReachingDefDb] +// class ReachingDefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ReachingDef.Label, _inVertex, ReachingDef.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// ReachingDef.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Receiver { +// val Label = "RECEIVER" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, ReceiverDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[ReceiverDb] { +// override val forLabel = Receiver.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new ReceiverDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: ReceiverDb) = Receiver(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Receiver(id, graph) +// } + +// def apply(wrapped: ReceiverDb) = new EdgeRef(wrapped) with Receiver +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[ReceiverDb](id, Receiver.Label, graph) with Receiver +// } +// trait Receiver extends EdgeRef[ReceiverDb] +// class ReceiverDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Receiver.Label, _inVertex, Receiver.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Receiver.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Ref { +// val Label = "REF" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, RefDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[RefDb] { +// override val forLabel = Ref.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new RefDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: RefDb) = Ref(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Ref(id, graph) +// } + +// def apply(wrapped: RefDb) = new EdgeRef(wrapped) with Ref +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[RefDb](id, Ref.Label, graph) with Ref +// } +// trait Ref extends EdgeRef[RefDb] +// class RefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Ref.Label, _inVertex, Ref.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Ref.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object ResolvedTo { +// val Label = "RESOLVED_TO" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, ResolvedToDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[ResolvedToDb] { +// override val forLabel = ResolvedTo.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new ResolvedToDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: ResolvedToDb) = ResolvedTo(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// ResolvedTo(id, graph) +// } + +// def apply(wrapped: ResolvedToDb) = new EdgeRef(wrapped) with ResolvedTo +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[ResolvedToDb](id, ResolvedTo.Label, graph) with ResolvedTo +// } +// trait ResolvedTo extends EdgeRef[ResolvedToDb] +// class ResolvedToDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ResolvedTo.Label, _inVertex, ResolvedTo.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// ResolvedTo.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object TaggedBy { +// val Label = "TAGGED_BY" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, TaggedByDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[TaggedByDb] { +// override val forLabel = TaggedBy.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new TaggedByDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: TaggedByDb) = TaggedBy(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// TaggedBy(id, graph) +// } + +// def apply(wrapped: TaggedByDb) = new EdgeRef(wrapped) with TaggedBy +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[TaggedByDb](id, TaggedBy.Label, graph) with TaggedBy +// } +// trait TaggedBy extends EdgeRef[TaggedByDb] +// class TaggedByDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, TaggedBy.Label, _inVertex, TaggedBy.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// TaggedBy.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object TaintRemove { +// val Label = "TAINT_REMOVE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, TaintRemoveDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[TaintRemoveDb] { +// override val forLabel = TaintRemove.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new TaintRemoveDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: TaintRemoveDb) = TaintRemove(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// TaintRemove(id, graph) +// } + +// def apply(wrapped: TaintRemoveDb) = new EdgeRef(wrapped) with TaintRemove +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[TaintRemoveDb](id, TaintRemove.Label, graph) with TaintRemove +// } +// trait TaintRemove extends EdgeRef[TaintRemoveDb] +// class TaintRemoveDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, TaintRemove.Label, _inVertex, TaintRemove.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// TaintRemove.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + + +// object Vtable { +// val Label = "VTABLE" +// object Keys { +// val All: JSet[String] = Set().asJava +// val KeyToValue: Map[String, VtableDb => Any] = Map( + +// ) +// } + +// val Factory = new SpecializedElementFactory.ForEdge[VtableDb] { +// override val forLabel = Vtable.Label + +// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// new VtableDb(graph, id, outVertex, inVertex) + +// override def createEdgeRef(edge: VtableDb) = Vtable(edge) + +// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = +// Vtable(id, graph) +// } + +// def apply(wrapped: VtableDb) = new EdgeRef(wrapped) with Vtable +// def apply(id: Long, graph: TinkerGraph) = +// new EdgeRef[VtableDb](id, Vtable.Label, graph) with Vtable +// } +// trait Vtable extends EdgeRef[VtableDb] +// class VtableDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) +// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Vtable.Label, _inVertex, Vtable.Keys.All) { + + +// override protected def specificProperty[A](key: String): Property[A] = +// Vtable.Keys.KeyToValue.get(key) match { +// case None => Property.empty[A] +// case Some(fieldAccess) => +// fieldAccess(this) match { +// case null | None => Property.empty[A] +// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) +// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) +// } +// } + +// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// property(key) +// } + +// override protected def removeSpecificProperty(key: String): Unit = +// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") +// } + diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala new file mode 100644 index 000000000..dc0a5b362 --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala @@ -0,0 +1,1010 @@ + + package io.shiftleft.codepropertygraph.generated.nodes + + import java.lang.{Boolean => JBoolean, Long => JLong} + import java.util.{Map => JMap, Set => JSet} + + /** base type for all nodes that can be added to a graph, e.g. the diffgraph */ + trait NewNode extends Node { + def label: String + def properties: Map[String, Any] + def containedNodesByLocalName: Map[String, List[Node]] + def allContainedNodes: List[Node] = containedNodesByLocalName.values.flatten.toList + } + + +// case class NewAnnotation(code: String ="" , name: String ="" , fullName: String ="" ) extends NewNode with AnnotationBase { +// override val label = "ANNOTATION" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("FULL_NAME" -> fullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewAnnotationLiteral(code: String ="" , name: String ="" , order: Integer = -1) extends NewNode with AnnotationLiteralBase { +// override val label = "ANNOTATION_LITERAL" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("ORDER" -> order )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewAnnotationParameter(code: String ="" ) extends NewNode with AnnotationParameterBase { +// override val label = "ANNOTATION_PARAMETER" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewAnnotationParameterAssign(code: String ="" ) extends NewNode with AnnotationParameterAssignBase { +// override val label = "ANNOTATION_PARAMETER_ASSIGN" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewArrayInitializer(code: String ="" ) extends NewNode with ArrayInitializerBase { +// override val label = "ARRAY_INITIALIZER" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewBlock(code: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with BlockBase { +// override val label = "BLOCK" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewCall(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, dispatchType: String ="" , signature: String ="" , typeFullName: String ="" , methodInstFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, resolved: Option[JBoolean] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with CallBase { +// override val label = "CALL" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("DISPATCH_TYPE" -> dispatchType ), +// ("SIGNATURE" -> signature ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("METHOD_INST_FULL_NAME" -> methodInstFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("RESOLVED" -> resolved ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewCallChain(val methods: List[MethodBase] = List(), val calls: List[CallBase] = List()) extends NewNode with CallChainBase { +// override val label = "CALL_CHAIN" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("methods" -> methods) + ("calls" -> calls) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewCallSite(val method: MethodBase , val call: CallBase , val callerMethod: MethodBase ) extends NewNode with CallSiteBase { +// override val label = "CALL_SITE" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("method" -> (method :: Nil)) + ("call" -> (call :: Nil)) + ("callerMethod" -> (callerMethod :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewClosureBinding(closureBindingId: Option[String] = None, evaluationStrategy: String ="" , closureOriginalName: Option[String] = None) extends NewNode with ClosureBindingBase { +// override val label = "CLOSURE_BINDING" +// override val properties: Map[String, Any] = +// Map(("CLOSURE_BINDING_ID" -> closureBindingId ), +// ("EVALUATION_STRATEGY" -> evaluationStrategy ), +// ("CLOSURE_ORIGINAL_NAME" -> closureOriginalName )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewComment(lineNumber: Option[Integer] = None, code: String ="" ) extends NewNode with CommentBase { +// override val label = "COMMENT" +// override val properties: Map[String, Any] = +// Map(("LINE_NUMBER" -> lineNumber ), +// ("CODE" -> code )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewConfigFile(name: String ="" , content: String ="" ) extends NewNode with ConfigFileBase { +// override val label = "CONFIG_FILE" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("CONTENT" -> content )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewDependency(version: String ="" , name: String ="" , dependencyGroupId: Option[String] = None) extends NewNode with DependencyBase { +// override val label = "DEPENDENCY" +// override val properties: Map[String, Any] = +// Map(("VERSION" -> version ), +// ("NAME" -> name ), +// ("DEPENDENCY_GROUP_ID" -> dependencyGroupId )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewDetachedTrackingPoint(val cfgNode: CfgNodeBase ) extends NewNode with DetachedTrackingPointBase { +// override val label = "DETACHED_TRACKING_POINT" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("cfgNode" -> (cfgNode :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewFile(name: String ="" ) extends NewNode with FileBase { +// override val label = "FILE" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewFinding(name: String ="" , category: String ="" , title: String ="" , description: String ="" , score: Integer = -1, link: String ="" , vulnDescr: String ="" , parameter: String ="" , methodName: String ="" , lineNo: String ="" , filename: String ="" , val ioflows: List[IoflowBase] = List(), val methods: List[MethodBase] = List()) extends NewNode with FindingBase { +// override val label = "FINDING" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("CATEGORY" -> category ), +// ("TITLE" -> title ), +// ("DESCRIPTION" -> description ), +// ("SCORE" -> score ), +// ("LINK" -> link ), +// ("VULN_DESCR" -> vulnDescr ), +// ("PARAMETER" -> parameter ), +// ("METHOD_NAME" -> methodName ), +// ("LINE_NO" -> lineNo ), +// ("FILENAME" -> filename )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("ioflows" -> ioflows) + ("methods" -> methods) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewFlow(val points: List[ProgramPointBase] = List(), val source: SourceBase , val sink: SinkBase , val transformations: List[TransformationBase] = List(), val branchPoints: List[TrackingPointBase] = List(), val cfgNodes: List[CfgNodeBase] = List()) extends NewNode with FlowBase { +// override val label = "FLOW" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("points" -> points) + ("source" -> (source :: Nil)) + ("sink" -> (sink :: Nil)) + ("transformations" -> transformations) + ("branchPoints" -> branchPoints) + ("cfgNodes" -> cfgNodes) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewFramework(name: String ="" ) extends NewNode with FrameworkBase { +// override val label = "FRAMEWORK" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewFrameworkData(name: String ="" , content: String ="" ) extends NewNode with FrameworkDataBase { +// override val label = "FRAMEWORK_DATA" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("CONTENT" -> content )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewIdentifier(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with IdentifierBase { +// override val label = "IDENTIFIER" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewIoflow(fingerprint: String ="" , literalsToSink: List[String] = List(), val dataTags: List[TagBase] = List(), val sourceDescriptorTags: List[TagBase] = List(), val sinkDescriptorTags: List[TagBase] = List(), val source: SourceBase , val sink: SinkBase , val transforms: List[TransformBase] = List(), val sourceDescriptorFlows: List[FlowBase] = List(), val sinkDescriptorFlows: List[FlowBase] = List(), val primaryFlow: FlowBase , val triggerMethods: List[MethodBase] = List()) extends NewNode with IoflowBase { +// override val label = "IOFLOW" +// override val properties: Map[String, Any] = +// Map(("FINGERPRINT" -> fingerprint ), +// ("LITERALS_TO_SINK" -> literalsToSink )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("dataTags" -> dataTags) + ("sourceDescriptorTags" -> sourceDescriptorTags) + ("sinkDescriptorTags" -> sinkDescriptorTags) + ("source" -> (source :: Nil)) + ("sink" -> (sink :: Nil)) + ("transforms" -> transforms) + ("sourceDescriptorFlows" -> sourceDescriptorFlows) + ("sinkDescriptorFlows" -> sinkDescriptorFlows) + ("primaryFlow" -> (primaryFlow :: Nil)) + ("triggerMethods" -> triggerMethods) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewLiteral(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with LiteralBase { +// override val label = "LITERAL" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewLocal(code: String ="" , name: String ="" , closureBindingId: Option[String] = None, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with LocalBase { +// override val label = "LOCAL" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("CLOSURE_BINDING_ID" -> closureBindingId ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewLocation(symbol: String ="" , methodFullName: String ="" , methodShortName: String ="" , packageName: String ="" , lineNumber: Option[Integer] = None, className: String ="" , nodeLabel: String ="" , filename: String ="" , val node: Option[Node] = None) extends NewNode with LocationBase { +// override val label = "LOCATION" +// override val properties: Map[String, Any] = +// Map(("SYMBOL" -> symbol ), +// ("METHOD_FULL_NAME" -> methodFullName ), +// ("METHOD_SHORT_NAME" -> methodShortName ), +// ("PACKAGE_NAME" -> packageName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("CLASS_NAME" -> className ), +// ("NODE_LABEL" -> nodeLabel ), +// ("FILENAME" -> filename )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> node.toList) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMatchInfo(pattern: String ="" , category: String ="" ) extends NewNode with MatchInfoBase { +// override val label = "MATCH_INFO" +// override val properties: Map[String, Any] = +// Map(("PATTERN" -> pattern ), +// ("CATEGORY" -> category )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMember(code: String ="" , name: String ="" , typeFullName: String ="" ) extends NewNode with MemberBase { +// override val label = "MEMBER" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("NAME" -> name ), +// ("TYPE_FULL_NAME" -> typeFullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMetaData(language: String ="" , version: String ="" , spid: Option[String] = None) extends NewNode with MetaDataBase { +// override val label = "META_DATA" +// override val properties: Map[String, Any] = +// Map(("LANGUAGE" -> language ), +// ("VERSION" -> version ), +// ("SPID" -> spid )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethod(name: String ="" , fullName: String ="" , signature: String ="" , astParentType: String ="" , astParentFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, hasMapping: Option[JBoolean] = None, depthFirstOrder: Option[Integer] = None, binarySignature: Option[String] = None) extends NewNode with MethodBase { +// override val label = "METHOD" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("FULL_NAME" -> fullName ), +// ("SIGNATURE" -> signature ), +// ("AST_PARENT_TYPE" -> astParentType ), +// ("AST_PARENT_FULL_NAME" -> astParentFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("HAS_MAPPING" -> hasMapping ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder ), +// ("BINARY_SIGNATURE" -> binarySignature )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodInst(name: String ="" , fullName: String ="" , signature: String ="" , methodFullName: String ="" ) extends NewNode with MethodInstBase { +// override val label = "METHOD_INST" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("FULL_NAME" -> fullName ), +// ("SIGNATURE" -> signature ), +// ("METHOD_FULL_NAME" -> methodFullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodParameterIn(code: String ="" , order: Integer = -1, name: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with MethodParameterInBase { +// override val label = "METHOD_PARAMETER_IN" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("ORDER" -> order ), +// ("NAME" -> name ), +// ("EVALUATION_STRATEGY" -> evaluationStrategy ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodParameterOut(code: String ="" , order: Integer = -1, name: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with MethodParameterOutBase { +// override val label = "METHOD_PARAMETER_OUT" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("ORDER" -> order ), +// ("NAME" -> name ), +// ("EVALUATION_STRATEGY" -> evaluationStrategy ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodRef(code: String ="" , order: Integer = -1, argumentIndex: Integer = -1, methodInstFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with MethodRefBase { +// override val label = "METHOD_REF" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("METHOD_INST_FULL_NAME" -> methodInstFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodReturn(code: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, depthFirstOrder: Option[Integer] = None) extends NewNode with MethodReturnBase { +// override val label = "METHOD_RETURN" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("EVALUATION_STRATEGY" -> evaluationStrategy ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewMethodSummary(isStatic: JBoolean , isExternal: JBoolean , binarySignature: Option[String] = None, val method: MethodBase , val parameters: List[MethodParameterInBase] = List(), val outParameters: List[MethodParameterOutBase] = List(), val returnParameter: MethodReturnBase , val paramTypes: List[TypeBase] = List(), val returnParameterType: TypeBase , val tags: List[TagBase] = List(), val paramTags: List[TagsBase] = List(), val outParamTags: List[TagsBase] = List(), val returnParamTags: List[TagBase] = List(), val annotationParameters: List[SpAnnotationParameterBase] = List(), val modifiers: List[ModifierBase] = List(), val routes: List[RouteBase] = List()) extends NewNode with MethodSummaryBase { +// override val label = "METHOD_SUMMARY" +// override val properties: Map[String, Any] = +// Map(("IS_STATIC" -> isStatic ), +// ("IS_EXTERNAL" -> isExternal ), +// ("BINARY_SIGNATURE" -> binarySignature )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("method" -> (method :: Nil)) + ("parameters" -> parameters) + ("outParameters" -> outParameters) + ("returnParameter" -> (returnParameter :: Nil)) + ("paramTypes" -> paramTypes) + ("returnParameterType" -> (returnParameterType :: Nil)) + ("tags" -> tags) + ("paramTags" -> paramTags) + ("outParamTags" -> outParamTags) + ("returnParamTags" -> returnParamTags) + ("annotationParameters" -> annotationParameters) + ("modifiers" -> modifiers) + ("routes" -> routes) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewModifier(modifierType: String ="" ) extends NewNode with ModifierBase { +// override val label = "MODIFIER" +// override val properties: Map[String, Any] = +// Map(("MODIFIER_TYPE" -> modifierType )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewNamespace(name: String ="" ) extends NewNode with NamespaceBase { +// override val label = "NAMESPACE" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewNamespaceBlock(name: String ="" , fullName: String ="" ) extends NewNode with NamespaceBlockBase { +// override val label = "NAMESPACE_BLOCK" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("FULL_NAME" -> fullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewProgramPoint(val elem: TrackingPointBase , val method: Option[MethodBase] = None, val methodTags: List[TagBase] = List(), val paramTags: List[TagBase] = List()) extends NewNode with ProgramPointBase { +// override val label = "PROGRAM_POINT" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("elem" -> (elem :: Nil)) + ("method" -> method.toList) + ("methodTags" -> methodTags) + ("paramTags" -> paramTags) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewRead(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val source: SourceBase ) extends NewNode with ReadBase { +// override val label = "READ" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("source" -> (source :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewReturn(lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, order: Integer = -1, argumentIndex: Integer = -1, code: String ="" , sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with ReturnBase { +// override val label = "RETURN" +// override val properties: Map[String, Any] = +// Map(("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("CODE" -> code ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewRoute(path: String ="" ) extends NewNode with RouteBase { +// override val label = "ROUTE" +// override val properties: Map[String, Any] = +// Map(("PATH" -> path )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSensitiveDataType(fullName: String ="" , val names: List[MatchInfoBase] = List(), val members: List[SensitiveMemberBase] = List()) extends NewNode with SensitiveDataTypeBase { +// override val label = "SENSITIVE_DATA_TYPE" +// override val properties: Map[String, Any] = +// Map(("FULL_NAME" -> fullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) + ("members" -> members) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSensitiveMember(name: String ="" , val names: List[MatchInfoBase] = List()) extends NewNode with SensitiveMemberBase { +// override val label = "SENSITIVE_MEMBER" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSensitiveReference(val ioflows: List[IoflowBase] = List()) extends NewNode with SensitiveReferenceBase { +// override val label = "SENSITIVE_REFERENCE" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("ioflows" -> ioflows) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSensitiveVariable(name: String ="" , val names: List[MatchInfoBase] = List(), val evalType: TypeBase ) extends NewNode with SensitiveVariableBase { +// override val label = "SENSITIVE_VARIABLE" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) + ("evalType" -> (evalType :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSink(sinkType: String ="" , val node: TrackingPointBase , val method: MethodBase , val methodTags: List[TagBase] = List(), val callingMethod: Option[MethodBase] = None, val callsite: Option[CallBase] = None, val parameterIn: Option[MethodParameterInBase] = None, val parameterInTags: List[TagBase] = List()) extends NewNode with SinkBase { +// override val label = "SINK" +// override val properties: Map[String, Any] = +// Map(("SINK_TYPE" -> sinkType )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) + ("method" -> (method :: Nil)) + ("methodTags" -> methodTags) + ("callingMethod" -> callingMethod.toList) + ("callsite" -> callsite.toList) + ("parameterIn" -> parameterIn.toList) + ("parameterInTags" -> parameterInTags) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSource(sourceType: String ="" , val node: TrackingPointBase , val method: MethodBase , val methodTags: List[TagBase] = List(), val callingMethod: Option[MethodBase] = None, val callsite: Option[CallBase] = None, val tags: List[TagBase] = List(), val nodeType: TypeBase ) extends NewNode with SourceBase { +// override val label = "SOURCE" +// override val properties: Map[String, Any] = +// Map(("SOURCE_TYPE" -> sourceType )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) + ("method" -> (method :: Nil)) + ("methodTags" -> methodTags) + ("callingMethod" -> callingMethod.toList) + ("callsite" -> callsite.toList) + ("tags" -> tags) + ("nodeType" -> (nodeType :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSpAnnotationParameter(annotationName: String ="" , annotationFullName: String ="" , name: String ="" , value: String ="" ) extends NewNode with SpAnnotationParameterBase { +// override val label = "SP_ANNOTATION_PARAMETER" +// override val properties: Map[String, Any] = +// Map(("ANNOTATION_NAME" -> annotationName ), +// ("ANNOTATION_FULL_NAME" -> annotationFullName ), +// ("NAME" -> name ), +// ("VALUE" -> value )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewSpBlacklist(val tags: List[TagBase] = List()) extends NewNode with SpBlacklistBase { +// override val label = "SP_BLACKLIST" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tags" -> tags) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTag(name: String ="" , value: String ="" ) extends NewNode with TagBase { +// override val label = "TAG" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("VALUE" -> value )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTags(val tags: List[TagBase] = List()) extends NewNode with TagsBase { +// override val label = "TAGS" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tags" -> tags) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTagNodePair(val tag: TagBase , val node: Node ) extends NewNode with TagNodePairBase { +// override val label = "TAG_NODE_PAIR" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tag" -> (tag :: Nil)) + ("node" -> (node :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTransform(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val call: CallBase , val sink: SinkBase ) extends NewNode with TransformBase { +// override val label = "TRANSFORM" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("call" -> (call :: Nil)) + ("sink" -> (sink :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTransformation(val node: TrackingPointBase ) extends NewNode with TransformationBase { +// override val label = "TRANSFORMATION" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewType(name: String ="" , fullName: String ="" , typeDeclFullName: String ="" ) extends NewNode with TypeBase { +// override val label = "TYPE" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("FULL_NAME" -> fullName ), +// ("TYPE_DECL_FULL_NAME" -> typeDeclFullName )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTypeArgument() extends NewNode with TypeArgumentBase { +// override val label = "TYPE_ARGUMENT" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTypeDecl(name: String ="" , fullName: String ="" , isExternal: JBoolean , inheritsFromTypeFullName: List[String] = List(), astParentType: String ="" , astParentFullName: String ="" , aliasTypeFullName: Option[String] = None) extends NewNode with TypeDeclBase { +// override val label = "TYPE_DECL" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("FULL_NAME" -> fullName ), +// ("IS_EXTERNAL" -> isExternal ), +// ("INHERITS_FROM_TYPE_FULL_NAME" -> inheritsFromTypeFullName ), +// ("AST_PARENT_TYPE" -> astParentType ), +// ("AST_PARENT_FULL_NAME" -> astParentFullName ), +// ("ALIAS_TYPE_FULL_NAME" -> aliasTypeFullName )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewTypeParameter(name: String ="" , order: Integer = -1) extends NewNode with TypeParameterBase { +// override val label = "TYPE_PARAMETER" +// override val properties: Map[String, Any] = +// Map(("NAME" -> name ), +// ("ORDER" -> order )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewUnknown(code: String ="" , parserTypeName: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with UnknownBase { +// override val label = "UNKNOWN" +// override val properties: Map[String, Any] = +// Map(("CODE" -> code ), +// ("PARSER_TYPE_NAME" -> parserTypeName ), +// ("ORDER" -> order ), +// ("ARGUMENT_INDEX" -> argumentIndex ), +// ("TYPE_FULL_NAME" -> typeFullName ), +// ("LINE_NUMBER" -> lineNumber ), +// ("LINE_NUMBER_END" -> lineNumberEnd ), +// ("COLUMN_NUMBER" -> columnNumber ), +// ("COLUMN_NUMBER_END" -> columnNumberEnd ), +// ("SCC_ID" -> sccId ), +// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewVariableInfo(varType: String ="" , evaluationType: String ="" , parameterIndex: Option[Integer] = None) extends NewNode with VariableInfoBase { +// override val label = "VARIABLE_INFO" +// override val properties: Map[String, Any] = +// Map(("VAR_TYPE" -> varType ), +// ("EVALUATION_TYPE" -> evaluationType ), +// ("PARAMETER_INDEX" -> parameterIndex )).filterNot { case (k,v) => +// v == null || v == None +// } +// .map { +// case (k, v: Option[_]) => (k,v.get) +// case other => other +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewWrite(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val sink: SinkBase , val flows: List[FlowBase] = List()) extends NewNode with WriteBase { +// override val label = "WRITE" +// override val properties: Map[String, Any] = Map.empty +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("sink" -> (sink :: Nil)) + ("flows" -> flows) + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + + +// case class NewPackagePrefix(value: String ="" ) extends NewNode with PackagePrefixBase { +// override val label = "PACKAGE_PREFIX" +// override val properties: Map[String, Any] = +// Map(("VALUE" -> value )).filterNot { case (k,v) => +// v == null || v == None +// } + +// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + +// override def accept[T](visitor: NodeVisitor[T]): T = ??? +// } + diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala new file mode 100644 index 000000000..08f7ab0ea --- /dev/null +++ b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala @@ -0,0 +1,381 @@ + package io.shiftleft.codepropertygraph.generated.nodes + + import gremlin.scala._ + import io.shiftleft.codepropertygraph.generated.EdgeKeys + import java.lang.{Boolean => JBoolean, Long => JLong} + import java.util.{Collections => JCollections, HashMap => JHashMap, Iterator => JIterator, Map => JMap, Set => JSet, TreeMap} + import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} + import org.apache.tinkerpop.gremlin.tinkergraph.structure.{SpecializedElementFactory, SpecializedTinkerVertex, TinkerGraph, TinkerVertexProperty, VertexRef} + import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils + import scala.collection.JavaConverters._ + + + + object Block { + implicit val marshaller: Marshallable[BlockDb] = new Marshallable[BlockDb] { + override def fromCC(cc: BlockDb): FromCC = ??? + override def toCC(element: Element): BlockDb = element.asInstanceOf[BlockDb] + } + val Label = "BLOCK" + object Keys { + val Code = "CODE" +val LineNumber = "LINE_NUMBER" + /* XXX0 new part start */ + object Indices { + val Code = 0 + val LineNumber = 1 + } + /* XXX0 new part end */ + val All: JSet[String] = Set(Code, LineNumber).asJava + val KeyToValue: Map[String, BlockDb => Any] = Map( + "CODE" -> { instance: BlockDb => instance.code}, + "LINE_NUMBER" -> { instance: BlockDb => instance.lineNumber.orNull}, + ) + } + object Edges { + val In: Set[String] = Set("CALL_ARG_OUT","RECEIVER","CDG","REACHING_DEF","CONTAINS_NODE","CONTAINS","CFG","AST","DOMINATE","POST_DOMINATE") + val Out: Set[String] = Set("AST","CFG","CALL_ARG","EVAL_TYPE","REACHING_DEF","CONTAINS_NODE") + } + + val Factory = new SpecializedElementFactory.ForVertex[BlockDb] { + override val forLabel = Block.Label + + override def createVertex(id: JLong, graph: TinkerGraph) = new BlockDb(id, graph) + override def createVertexRef(vertex: BlockDb) = Block(vertex) + override def createVertexRef(id: JLong, graph: TinkerGraph) = Block(id, graph) + + /* XXX0 new part start*/ + override def propertyNamesByIndex() = { + val ret = new JHashMap[Integer, String] + ret.put(Block.Keys.Indices.Code, Block.Keys.Code) + ret.put(Block.Keys.Indices.LineNumber, Block.Keys.LineNumber) + ret + } + override def propertyTypeByIndex() = { + val ret = new JHashMap[Integer, Class[_]] + ret.put(Block.Keys.Indices.Code, classOf[String]) + ret.put(Block.Keys.Indices.LineNumber, classOf[Integer]) + ret + } + /* XXX0 new part end*/ + } + + def apply(wrapped: BlockDb) = new VertexRef(wrapped) with Block + def apply(id: Long, graph: TinkerGraph) = + new VertexRef[BlockDb](id, Block.Label, graph) with Block + } + +trait Block extends VertexRef[BlockDb] with BlockBase with StoredNode with Expression { +override def code = get().code +override def lineNumber = get().lineNumber + + + // don't worry about + def columnNumber: Option[Integer] = ??? + def columnNumberEnd: Option[Integer] = ??? + def lineNumberEnd: Option[Integer] = ??? + def order: Integer = ??? + + override def accept[T](visitor: NodeVisitor[T]): T = { + visitor.visit(this) + } + override def valueMap: JMap[String, AnyRef] = get.valueMap + override def productElement(n: Int): Any = get.productElement(n) + override def productPrefix = "Block" + override def productArity = 2 + 1 // add one for id, leaving out `_graph` + override def canEqual(that: Any): Boolean = get.canEqual(that) +} + trait BlockBase extends Node with ExpressionBase with HasCode with HasLineNumber { + def asStored : StoredNode = this.asInstanceOf[StoredNode] + } + + class BlockDb(private val _id: JLong, private val _graph: TinkerGraph) + extends SpecializedTinkerVertex(_id, Block.Label, _graph) with StoredNode with Expression with BlockBase { + + override def allowedInEdgeLabels() = Block.Edges.In.asJava + override def allowedOutEdgeLabels() = Block.Edges.Out.asJava + override def specificKeys() = Block.Keys.All + + /* all properties */ + override def valueMap: JMap[String, AnyRef] = { + /* XXX0 new part start */ + // TODO optimise: load all properties in one go + val properties = new JHashMap[String, AnyRef] + properties.put("CODE", code) +lineNumber.map { value => properties.put("LINE_NUMBER", value) } + /* XXX0 new part end */ + properties +} + + private var _code: String = null + /* XXX0 new part start */ + def code(): String = { + if (_code == null) + _code = graph.readProperty(this, Block.Keys.Indices.Code, classOf[String]).asInstanceOf[String] + validateMandatoryProperty(Block.Keys.Code, _code) + _code + } + /* XXX0 new part end */ + + /* XXX0 new part start */ +private var _lineNumber: Option[Integer] = None + def lineNumber(): Option[Integer] = { + if (_lineNumber == null) + _lineNumber = Option(graph.readProperty(this, Block.Keys.Indices.LineNumber, classOf[Integer]).asInstanceOf[Integer]) + _lineNumber + } + /* XXX0 new part end */ + + /* XXX0 new part start */ + override def propertiesByStorageIdx = { + val properties = new TreeMap[Integer, Object] + // TODO optimise: load all properties in one go + properties.put(Block.Keys.Indices.Code, code); + lineNumber.map { value => properties.put(Block.Keys.Indices.LineNumber, value) } + properties + } + /* XXX0 new part end */ + + + override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[BlockDb] + override def productElement(n: Int): Any = + n match { + case 0 => _id + case 1 => code() +case 2 => lineNumber() + } + + override def productPrefix = "Block" + override def productArity = 2 + 1 // add one for id, leaving out `_graph` + + /* performance optimisation to save instantiating an iterator for each property lookup */ + override protected def specificProperty[A](key: String): VertexProperty[A] = { + Block.Keys.KeyToValue.get(key) match { + case None => VertexProperty.empty[A] + case Some(fieldAccess) => + fieldAccess(this) match { + case null | None => VertexProperty.empty[A] + case values: List[_] => throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(key) + case Some(value) => new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A]) + case value => new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A]) + } + } + } + + override protected def specificProperties[A](key: String): JIterator[VertexProperty[A]] = { + Block.Keys.KeyToValue.get(key) match { + case None => JCollections.emptyIterator[VertexProperty[A]] + case Some(fieldAccess) => + fieldAccess(this) match { + case null => JCollections.emptyIterator[VertexProperty[A]] + case values: List[_] => + values.map { value => + new TinkerVertexProperty(-1, this, key, value).asInstanceOf[VertexProperty[A]] + }.toIterator.asJava + case value => IteratorUtils.of(new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A])) + } + } + } + + override protected def updateSpecificProperty[A](cardinality: VertexProperty.Cardinality, key: String, value: A): VertexProperty[A] = { + if (key == "CODE") this._code = value.asInstanceOf[String] + else if (key == "LINE_NUMBER") this._lineNumber = Option(value).asInstanceOf[Option[Integer]] + else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") + new TinkerVertexProperty(-1, this, key, value) + } + + override protected def removeSpecificProperty(key: String): Unit = + if (key == "CODE") this._code = null + else if (key == "LINE_NUMBER") this._lineNumber = null + else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") + + // don't worry about + def columnNumber: Option[Integer] = ??? + def columnNumberEnd: Option[Integer] = ??? + def lineNumberEnd: Option[Integer] = ??? + def order: Integer = ??? + } + + trait Node extends Product { + def accept[T](visitor: NodeVisitor[T]): T = ??? + } + + /* making use of the fact that SpecializedVertex is also our domain node */ + trait StoredNode extends Vertex with Node { + /* underlying vertex in the graph database. + * since this is a StoredNode, this is always set */ + def underlying: Vertex = this + + // This is required for accessing the id from java code which only has a reference to StoredNode at hand. + // Java does not seem to be capable of calling methods from java classes if a scala trait is in the inheritance + // chain. + def getId: JLong = underlying.id.asInstanceOf[JLong] + + /* all properties plus label and id */ + def toMap: Map[String, Any] = { + val map = valueMap + map.put("_label", label) + map.put("_id", getId) + map.asScala.toMap + } + + /* all properties */ + def valueMap: JMap[String, AnyRef] + } + + trait NodeVisitor[T] { +// def visit(node: Annotation): T = ??? +// def visit(node: AnnotationLiteral): T = ??? +// def visit(node: AnnotationParameter): T = ??? +// def visit(node: AnnotationParameterAssign): T = ??? +// def visit(node: ArrayInitializer): T = ??? +def visit(node: Block): T = ??? +// def visit(node: Call): T = ??? +// def visit(node: CallChain): T = ??? +// def visit(node: CallSite): T = ??? +// def visit(node: ClosureBinding): T = ??? +// def visit(node: Comment): T = ??? +// def visit(node: ConfigFile): T = ??? +// def visit(node: Dependency): T = ??? +// def visit(node: DetachedTrackingPoint): T = ??? +// def visit(node: File): T = ??? +// def visit(node: Finding): T = ??? +// def visit(node: Flow): T = ??? +// def visit(node: Framework): T = ??? +// def visit(node: FrameworkData): T = ??? +// def visit(node: Identifier): T = ??? +// def visit(node: Ioflow): T = ??? +// def visit(node: Literal): T = ??? +// def visit(node: Local): T = ??? +// def visit(node: Location): T = ??? +// def visit(node: MatchInfo): T = ??? +// def visit(node: Member): T = ??? +// def visit(node: MetaData): T = ??? +// def visit(node: Method): T = ??? +// def visit(node: MethodInst): T = ??? +// def visit(node: MethodParameterIn): T = ??? +// def visit(node: MethodParameterOut): T = ??? +// def visit(node: MethodRef): T = ??? +// def visit(node: MethodReturn): T = ??? +// def visit(node: MethodSummary): T = ??? +// def visit(node: Modifier): T = ??? +// def visit(node: Namespace): T = ??? +// def visit(node: NamespaceBlock): T = ??? +// def visit(node: ProgramPoint): T = ??? +// def visit(node: Read): T = ??? +// def visit(node: Return): T = ??? +// def visit(node: Route): T = ??? +// def visit(node: SensitiveDataType): T = ??? +// def visit(node: SensitiveMember): T = ??? +// def visit(node: SensitiveReference): T = ??? +// def visit(node: SensitiveVariable): T = ??? +// def visit(node: Sink): T = ??? +// def visit(node: Source): T = ??? +// def visit(node: SpAnnotationParameter): T = ??? +// def visit(node: SpBlacklist): T = ??? +// def visit(node: Tag): T = ??? +// def visit(node: Tags): T = ??? +// def visit(node: TagNodePair): T = ??? +// def visit(node: Transform): T = ??? +// def visit(node: Transformation): T = ??? +// def visit(node: Type): T = ??? +// def visit(node: TypeArgument): T = ??? +// def visit(node: TypeDecl): T = ??? +// def visit(node: TypeParameter): T = ??? +// def visit(node: Unknown): T = ??? +// def visit(node: VariableInfo): T = ??? +// def visit(node: Write): T = ??? +// def visit(node: PackagePrefix): T = ??? +// def visit(node: Declaration): T = ??? +// def visit(node: Expression): T = ??? +// def visit(node: LocalLike): T = ??? +// def visit(node: CfgNode): T = ??? +// def visit(node: TrackingPoint): T = ??? +// def visit(node: WithinMethod): T = ??? + } +trait DeclarationBase extends Node with HasName + trait Declaration extends StoredNode with DeclarationBase + +trait ExpressionBase extends Node with HasCode with HasOrder with TrackingPointBase with CfgNodeBase + trait Expression extends StoredNode with ExpressionBase with TrackingPoint with CfgNode + +trait LocalLikeBase extends Node with HasName + trait LocalLike extends StoredNode with LocalLikeBase + +trait CfgNodeBase extends Node with HasLineNumber with HasLineNumberEnd with HasColumnNumber with HasColumnNumberEnd with WithinMethodBase + trait CfgNode extends StoredNode with CfgNodeBase with WithinMethod + +trait TrackingPointBase extends Node with WithinMethodBase + trait TrackingPoint extends StoredNode with TrackingPointBase with WithinMethod + +trait WithinMethodBase extends Node + trait WithinMethod extends StoredNode with WithinMethodBase + trait HasAliasTypeFullName { def aliasTypeFullName: Option[String] } +trait HasAnnotationFullName { def annotationFullName: String } +trait HasAnnotationName { def annotationName: String } +trait HasArgumentIndex { def argumentIndex: Integer } +trait HasAstParentFullName { def astParentFullName: String } +trait HasAstParentType { def astParentType: String } +trait HasBinarySignature { def binarySignature: Option[String] } +trait HasCategory { def category: String } +trait HasClassName { def className: String } +trait HasClosureBindingId { def closureBindingId: Option[String] } +trait HasClosureOriginalName { def closureOriginalName: Option[String] } +trait HasCode { def code: String } +trait HasColumnNumber { def columnNumber: Option[Integer] } +trait HasColumnNumberEnd { def columnNumberEnd: Option[Integer] } +trait HasContent { def content: String } +trait HasDependencyGroupId { def dependencyGroupId: Option[String] } +trait HasDepthFirstOrder { def depthFirstOrder: Option[Integer] } +trait HasDescription { def description: String } +trait HasDispatchType { def dispatchType: String } +trait HasEvaluationStrategy { def evaluationStrategy: String } +trait HasEvaluationType { def evaluationType: String } +trait HasFilename { def filename: String } +trait HasFingerprint { def fingerprint: String } +trait HasFullName { def fullName: String } +trait HasHasMapping { def hasMapping: Option[JBoolean] } +trait HasInheritsFromTypeFullName { def inheritsFromTypeFullName: List[String] } +trait HasIsExternal { def isExternal: JBoolean } +trait HasIsStatic { def isStatic: JBoolean } +trait HasLanguage { def language: String } +trait HasLineNo { def lineNo: String } +trait HasLineNumber { def lineNumber: Option[Integer] } +trait HasLineNumberEnd { def lineNumberEnd: Option[Integer] } +trait HasLink { def link: String } +trait HasLiteralsToSink { def literalsToSink: List[String] } +trait HasMethodFullName { def methodFullName: String } +trait HasMethodInstFullName { def methodInstFullName: String } +trait HasMethodName { def methodName: String } +trait HasMethodShortName { def methodShortName: String } +trait HasModifierType { def modifierType: String } +trait HasName { def name: String } +trait HasNodeId { def nodeId: String } +trait HasNodeLabel { def nodeLabel: String } +trait HasOrder { def order: Integer } +trait HasPackageName { def packageName: String } +trait HasParameter { def parameter: String } +trait HasParameterIndex { def parameterIndex: Option[Integer] } +trait HasParserTypeName { def parserTypeName: String } +trait HasPath { def path: String } +trait HasPattern { def pattern: String } +trait HasResolved { def resolved: Option[JBoolean] } +trait HasSccId { def sccId: Integer } +trait HasScore { def score: Integer } +trait HasSignature { def signature: String } +trait HasSinkType { def sinkType: String } +trait HasSourceType { def sourceType: String } +trait HasSpid { def spid: Option[String] } +trait HasSymbol { def symbol: String } +trait HasTitle { def title: String } +trait HasTypeDeclFullName { def typeDeclFullName: String } +trait HasTypeFullName { def typeFullName: String } +trait HasValue { def value: String } +trait HasVarType { def varType: String } +trait HasVersion { def version: String } +trait HasVulnDescr { def vulnDescr: String } + +// object Factories { +// lazy val All: List[SpecializedElementFactory.ForVertex[_]] = List(Annotation.Factory, AnnotationLiteral.Factory, AnnotationParameter.Factory, AnnotationParameterAssign.Factory, ArrayInitializer.Factory, Block.Factory, Call.Factory, CallChain.Factory, CallSite.Factory, ClosureBinding.Factory, Comment.Factory, ConfigFile.Factory, Dependency.Factory, DetachedTrackingPoint.Factory, File.Factory, Finding.Factory, Flow.Factory, Framework.Factory, FrameworkData.Factory, Identifier.Factory, Ioflow.Factory, Literal.Factory, Local.Factory, Location.Factory, MatchInfo.Factory, Member.Factory, MetaData.Factory, Method.Factory, MethodInst.Factory, MethodParameterIn.Factory, MethodParameterOut.Factory, MethodRef.Factory, MethodReturn.Factory, MethodSummary.Factory, Modifier.Factory, Namespace.Factory, NamespaceBlock.Factory, ProgramPoint.Factory, Read.Factory, Return.Factory, Route.Factory, SensitiveDataType.Factory, SensitiveMember.Factory, SensitiveReference.Factory, SensitiveVariable.Factory, Sink.Factory, Source.Factory, SpAnnotationParameter.Factory, SpBlacklist.Factory, Tag.Factory, Tags.Factory, TagNodePair.Factory, Transform.Factory, Transformation.Factory, Type.Factory, TypeArgument.Factory, TypeDecl.Factory, TypeParameter.Factory, Unknown.Factory, VariableInfo.Factory, Write.Factory, PackagePrefix.Factory) +// lazy val AllAsJava: java.util.List[SpecializedElementFactory.ForVertex[_]] = All.asJava +// } diff --git a/project/DomainClassCreator.scala b/project/DomainClassCreator.scala index 9a273a11b..d2da48bfc 100644 --- a/project/DomainClassCreator.scala +++ b/project/DomainClassCreator.scala @@ -51,7 +51,7 @@ object DomainClassCreator { package $edgesPackage import java.lang.{Boolean => JBoolean, Long => JLong} - import java.util.{Set => JSet} + import java.util.{HashMap => JHashMap, Set => JSet, TreeMap} import org.apache.tinkerpop.gremlin.structure.Property import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} import org.apache.tinkerpop.gremlin.tinkergraph.structure.{EdgeRef, SpecializedElementFactory, SpecializedTinkerEdge, TinkerGraph, TinkerProperty, TinkerVertex, VertexRef} @@ -91,16 +91,36 @@ object DomainClassCreator { val edgeClassName = edgeType.className val edgeClassNameDb = s"${edgeClassName}Db" val keysQuoted = keys.map('"' + _.name + '"') - val keyToValueMap = keys - .map { key => - s""" "${key.name}" -> { instance: $edgeClassNameDb => instance.${camelCase(key.name)}()}""" - } - .mkString(",\n") + val keyConstants = keys.map(key => s"""val ${camelCase(key.name).capitalize} = "${key.name}" """).mkString("\n") + + val keyToValueMap = keys.map { key => + s""" "${key.name}" -> { instance: $edgeClassNameDb => instance.${camelCase(key.name)}()}""" + }.mkString(",\n") + + //note: schema changes will change the binary format - we could define constants in the schema to avoid that + val keysWithIndex = keys.zipWithIndex + val keyIndexConstants = keysWithIndex.map { case (key, idx) => + s"""val ${camelCase(key.name).capitalize} = $idx""" + }.mkString("\n") + + val propertyNamesByIndex = keysWithIndex.map { case (key, idx) => + val keyName = camelCase(key.name).capitalize + s"""ret.put($edgeClassName.Keys.Indices.$keyName, $edgeClassName.Keys.$keyName)""" + }.mkString("\n") + + val propertyTypeByIndex = keysWithIndex.map { case (key, idx) => + val keyName = camelCase(key.name).capitalize + s"""ret.put($edgeClassName.Keys.Indices.$keyName, classOf[${getBaseType(key)}])""" + }.mkString("\n") val companionObject = s""" |object $edgeClassName { | val Label = "${edgeType.name}" | object Keys { + | $keyConstants + | object Indices { + | $keyIndexConstants + | } | val All: JSet[String] = Set(${keysQuoted.mkString(", ")}).asJava | val KeyToValue: Map[String, $edgeClassNameDb => Any] = Map( | $keyToValueMap @@ -117,6 +137,18 @@ object DomainClassCreator { | | override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = | ${edgeClassName}(id, graph) + | + | override def propertyNamesByIndex() = { + | val ret = new JHashMap[Integer, String] + | $propertyNamesByIndex + | ret + | } + | + | override def propertyTypeByIndex() = { + | val ret = new JHashMap[Integer, Class[_]] + | $propertyTypeByIndex + | ret + | } | } | | def apply(wrapped: $edgeClassNameDb) = new EdgeRef(wrapped) with $edgeClassName @@ -131,7 +163,10 @@ object DomainClassCreator { class ${edgeClassNameDb}(_graph: TinkerGraph, _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) extends SpecializedTinkerEdge(_graph, _id, _outVertex, $edgeClassName.Label, _inVertex, $edgeClassName.Keys.All) { - ${propertyBasedFields(keys)} + ${propertyBasedFields(edgeClassName, keys)} + + ${propertiesByStorageIdx(edgeClassName, keys)} + override protected def specificProperty[A](key: String): Property[A] = $edgeClassName.Keys.KeyToValue.get(key) match { case None => Property.empty[A] @@ -187,7 +222,7 @@ object DomainClassCreator { import gremlin.scala._ import io.shiftleft.codepropertygraph.generated.EdgeKeys import java.lang.{Boolean => JBoolean, Long => JLong} - import java.util.{Collections => JCollections, HashMap => JHashMap, Iterator => JIterator, Map => JMap, Set => JSet} + import java.util.{Collections => JCollections, HashMap => JHashMap, Iterator => JIterator, Map => JMap, Set => JSet, TreeMap} import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} import org.apache.tinkerpop.gremlin.tinkergraph.structure.{SpecializedElementFactory, SpecializedTinkerVertex, TinkerGraph, TinkerVertexProperty, VertexRef} import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils @@ -314,6 +349,23 @@ object DomainClassCreator { keys: List[Property], nodeToInEdges: mutable.MultiMap[String, String]) = { val keyConstants = keys.map(key => s"""val ${camelCase(key.name).capitalize} = "${key.name}" """).mkString("\n") + + //note: schema changes will change the binary format - we could define constants in the schema to avoid that + val keysWithIndex = keys.zipWithIndex + val keyIndexConstants = keysWithIndex.map { case (key, idx) => + s"""val ${camelCase(key.name).capitalize} = $idx""" + }.mkString("\n") + + val propertyNamesByIndex = keysWithIndex.map { case (key, idx) => + val keyName = camelCase(key.name).capitalize + s"""ret.put(${nodeType.className}.Keys.Indices.$keyName, ${nodeType.className}.Keys.$keyName)""" + }.mkString("\n") + + val propertyTypeByIndex = keysWithIndex.map { case (key, idx) => + val keyName = camelCase(key.name).capitalize + s"""ret.put(${nodeType.className}.Keys.Indices.$keyName, classOf[${getBaseType(key)}])""" + }.mkString("\n") + val keyToValueMap = keys .map { property: Property => getHigherType(property) match { @@ -322,8 +374,7 @@ object DomainClassCreator { case HigherValueType.Option => s""" "${property.name}" -> { instance: ${nodeType.classNameDb} => instance.${camelCase(property.name)}.orNull}""" } - } - .mkString(",\n") + } .mkString(",\n") def outEdges(nodeType: NodeType): List[String] = { nodeType.outEdges.map(_.edgeName) @@ -343,6 +394,9 @@ object DomainClassCreator { val Label = "${nodeType.name}" object Keys { $keyConstants + object Indices { + $keyIndexConstants + } val All: JSet[String] = Set(${keys .map { key => camelCase(key.name).capitalize @@ -363,6 +417,17 @@ object DomainClassCreator { override def createVertex(id: JLong, graph: TinkerGraph) = new ${nodeType.classNameDb}(id, graph) override def createVertexRef(vertex: ${nodeType.classNameDb}) = ${nodeType.className}(vertex) override def createVertexRef(id: JLong, graph: TinkerGraph) = ${nodeType.className}(id, graph) + override def propertyNamesByIndex() = { + val ret = new JHashMap[Integer, String] + $propertyNamesByIndex + ret + } + + override def propertyTypeByIndex() = { + val ret = new JHashMap[Integer, Class[_]] + $propertyTypeByIndex + ret + } } def apply(wrapped: ${nodeType.classNameDb}) = new VertexRef(wrapped) with ${nodeType.className} @@ -394,7 +459,7 @@ object DomainClassCreator { val memberName = camelCase(key.name) Cardinality.fromName(key.cardinality) match { case Cardinality.One => - s"""if (${memberName} != null) { properties.put("${key.name}", ${memberName}) }""" + s"""properties.put("${key.name}", ${memberName})""" case Cardinality.ZeroOrOne => s"""${memberName}.map { value => properties.put("${key.name}", value) }""" case Cardinality.List => // need java list, e.g. for VertexSerializer @@ -521,9 +586,12 @@ object DomainClassCreator { override def specificKeys() = ${nodeType.className}.Keys.All /* all properties */ + // TODO optimise: load all properties in one go override def valueMap: JMap[String, AnyRef] = $valueMapImpl - ${propertyBasedFields(keys)} + ${propertyBasedFields(nodeType.className, keys)} + + ${propertiesByStorageIdx(nodeType.className, keys)} override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[${nodeType.classNameDb}] override def productElement(n: Int): Any = @@ -845,31 +913,69 @@ object Utils { case HigherValueType.List => s"List[${getBaseType(property)}]" } - def propertyBasedFields(properties: List[Property]): String = + def propertyBasedFields(elementName: String, properties: List[Property]): String = properties.map { property => val name = camelCase(property.name) + val nameCapitalized = name.capitalize + val tpeBase = getBaseType(property) val tpe = getCompleteType(property) + val readProperty = s"graph().asInstanceOf[TinkerGraph].readProperty(this, $elementName.Keys.Indices.$nameCapitalized, classOf[$tpeBase])" getHigherType(property) match { case HigherValueType.None => - /** TODO: rather than returning `null`, throw an exception, since this is a schema violation: - s"""|var _$name: $tpe = null - |def $name: $tpe = - | if (_$name == null) { - | throw new AssertionError("property $name is mandatory but hasn't been initialised yet") - |} else { _$name } """.stripMargin - */ s"""|private var _$name: $tpe = null - |def $name(): $tpe = _$name""".stripMargin + |def $name(): $tpe = { + | if (_$name == null) { + | _$name = $readProperty.asInstanceOf[$tpeBase] + | } + | validateMandatoryProperty($elementName.Keys.$nameCapitalized, _$name) + | _$name + |}""".stripMargin case HigherValueType.Option => s"""|private var _$name: $tpe = None - |def $name(): $tpe = _$name""".stripMargin + |def $name(): $tpe = { + | if (_$name == null) { + | _$name = Option($readProperty).asInstanceOf[$tpe] + | } + | _$name + |}""".stripMargin case HigherValueType.List => s"""|private var _$name: $tpe = Nil - |def $name(): $tpe = _$name""".stripMargin + |def $name(): $tpe = { + | if (_$name == null) { + | val property = $readProperty + | if (property == null) _$name = Nil + | else _$name = property.asInstanceOf[$tpe] + | } + | _$name + |}""".stripMargin } }.mkString("\n\n") + def propertiesByStorageIdx(elementName: String, keys: List[Property]): String = { + val putKeysImpl = keys.map { key: Property => + val memberName = camelCase(key.name) + val memberNameCapitalized = memberName.capitalize + val propertyAccessor = s"$elementName.Keys.Indices.$memberNameCapitalized" + Cardinality.fromName(key.cardinality) match { + case Cardinality.One => + s"""properties.put($propertyAccessor, $memberName)""" + case Cardinality.ZeroOrOne => + s"""${memberName}.map { value => properties.put($propertyAccessor, value) }""" + case Cardinality.List => // need java list, e.g. for VertexSerializer + s"""if (${memberName}.nonEmpty) { properties.put($propertyAccessor, $memberName.asJava) }""" + } + }.mkString("\n") + + s""" + |override def propertiesByStorageIdx = { + | val properties = new TreeMap[Integer, Object] + | // TODO optimise: load all properties in one go + | $putKeysImpl + | properties + |}""".stripMargin + } + def updateSpecificPropertyBody(properties: List[Property]): String = { val caseNotFound = s"""PropertyErrorRegister.logPropertyErrorIfFirst(getClass, key)""" From cd5ca97b7c9b01e1f13bf925b9fc7f517b221ba9 Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Sun, 7 Jul 2019 05:25:47 +1200 Subject: [PATCH 2/4] cleanup --- build.sbt | 1 - cpg1/build.sbt | 18 - .../generated/DispatchTypes.java | 14 - .../generated/EdgeKeyNames.java | 20 - .../codepropertygraph/generated/EdgeKeys.java | 20 - .../generated/EdgeTypes.java | 98 - .../generated/EvaluationStrategies.java | 17 - .../generated/Frameworks.java | 56 - .../generated/Languages.java | 23 - .../generated/ModifierTypes.java | 32 - .../generated/NodeKeyNames.java | 200 --- .../generated/NodeKeyTypes.java | 73 - .../codepropertygraph/generated/NodeKeys.java | 1091 ------------ .../generated/NodeTypes.java | 194 -- .../generated/Operators.java | 167 -- .../generated/edges/Edges.scala | 1580 ----------------- .../generated/nodes/NewNodes.scala | 1010 ----------- .../generated/nodes/Nodes.scala | 381 ---- 18 files changed, 4995 deletions(-) delete mode 100644 cpg1/build.sbt delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala delete mode 100644 cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala diff --git a/build.sbt b/build.sbt index c2309f244..21c0b7e27 100644 --- a/build.sbt +++ b/build.sbt @@ -50,7 +50,6 @@ lazy val dataflowengine = Projects.dataflowengine lazy val cpgserver = Projects.cpgserver lazy val cpgvalidator = Projects.cpgvalidator lazy val cpg2overflowdb = Projects.cpg2overflowdb -lazy val cpg1 = project.in(file("cpg1")) ThisBuild/publishTo := sonatypePublishTo.value ThisBuild/scalacOptions ++= Seq("-deprecation", "-feature", "-language:implicitConversions") diff --git a/cpg1/build.sbt b/cpg1/build.sbt deleted file mode 100644 index fe3ffdbba..000000000 --- a/cpg1/build.sbt +++ /dev/null @@ -1,18 +0,0 @@ -name := "cpg1" - -dependsOn(Projects.protoBindings) - -libraryDependencies ++= Seq( - "io.shiftleft" % "tinkergraph-gremlin" % "3.3.4.17-MP-SNAPSHOT", - "com.michaelpollmeier" %% "gremlin-scala" % "3.3.4.13", - "com.google.guava" % "guava" % "21.0", - "org.apache.commons" % "commons-lang3" % "3.5", - "commons-io" % "commons-io" % "2.5", - "org.scala-lang.modules" %% "scala-java8-compat" % "0.8.0", - "com.jsuereth" %% "scala-arm" % "2.0", - "com.github.scopt" %% "scopt" % "3.7.0", - "org.apache.logging.log4j" % "log4j-api" % "2.11.0", - "org.apache.logging.log4j" % "log4j-core" % "2.11.0", - "org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.11.2" % Runtime, //redirect tinkerpop's slf4j logging to log4j - "org.scalatest" %% "scalatest" % "3.0.3" % Test -) diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java deleted file mode 100644 index 11b9e4119..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/DispatchTypes.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class DispatchTypes { - -/** For statically dispatched calls the call target is known before program execution */ -public static final String STATIC_DISPATCH = "STATIC_DISPATCH"; - -/** For dynamically dispatched calls the target is determined during runtime */ -public static final String DYNAMIC_DISPATCH = "DYNAMIC_DISPATCH"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java deleted file mode 100644 index 8440234f0..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeyNames.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class EdgeKeyNames { - -/** Defines whether a PROPAGATE edge creates an alias */ -public static final String ALIAS = "ALIAS"; - -/** The condition result under which a CFG edge is followed */ -public static final String CONDITION = "CONDITION"; - -/** Index of referenced CONTAINED node (0 based) - used together with cardinality=list */ -public static final String INDEX = "INDEX"; - -/** Local name of referenced CONTAINED node */ -public static final String LOCAL_NAME = "LOCAL_NAME"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java deleted file mode 100644 index de24268f5..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeKeys.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class EdgeKeys { - -/** Defines whether a PROPAGATE edge creates an alias */ -public static final Key ALIAS = new Key<>("ALIAS"); - -/** The condition result under which a CFG edge is followed */ -public static final Key CONDITION = new Key<>("CONDITION"); - -/** Index of referenced CONTAINED node (0 based) - used together with cardinality=list */ -public static final Key INDEX = new Key<>("INDEX"); - -/** Local name of referenced CONTAINED node */ -public static final Key LOCAL_NAME = new Key<>("LOCAL_NAME"); - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java deleted file mode 100644 index a70ae838b..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EdgeTypes.java +++ /dev/null @@ -1,98 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class EdgeTypes { - -/** Alias relation between types */ -public static final String ALIAS_OF = "ALIAS_OF"; - -/** Syntax child */ -public static final String AST = "AST"; - -/** Link between FRAMEWORK and FRAMEWORK_DATA nodes */ -public static final String ATTACHED_DATA = "ATTACHED_DATA"; - -/** Type argument binding to a type parameter */ -public static final String BINDS_TO = "BINDS_TO"; - -/** Referencing to e.g. a LOCAL */ -public static final String CALL = "CALL"; - -/** Function call argument */ -public static final String CALL_ARG = "CALL_ARG"; - -/** Function call output argument. Goes from METHOD_PARAMETER_OUT to call argument node */ -public static final String CALL_ARG_OUT = "CALL_ARG_OUT"; - -/** Function call return value */ -public static final String CALL_RET = "CALL_RET"; - -/** Represents the capturing of a variable into a closure */ -public static final String CAPTURE = "CAPTURE"; - -/** Connection between a captured LOCAL and the corresponding CLOSURE_BINDING */ -public static final String CAPTURED_BY = "CAPTURED_BY"; - -/** Control dependency graph */ -public static final String CDG = "CDG"; - -/** Control flow */ -public static final String CFG = "CFG"; - -/** Shortcut over multiple AST edges */ -public static final String CONTAINS = "CONTAINS"; - -/** Membership relation for a compound object */ -public static final String CONTAINS_NODE = "CONTAINS_NODE"; - -/** Points to dominated node in DOM tree */ -public static final String DOMINATE = "DOMINATE"; - -/** Link to evaluation type */ -public static final String EVAL_TYPE = "EVAL_TYPE"; - -/** Inheritance relation between types */ -public static final String INHERITS_FROM = "INHERITS_FROM"; - -/** */ -public static final String IS_SENSITIVE_DATA_DESCR_OF = "IS_SENSITIVE_DATA_DESCR_OF"; - -/** */ -public static final String IS_SENSITIVE_DATA_DESCR_OF_REF = "IS_SENSITIVE_DATA_DESCR_OF_REF"; - -/** */ -public static final String IS_SENSITIVE_DATA_OF_TYPE = "IS_SENSITIVE_DATA_OF_TYPE"; - -/** Links together corresponding METHOD_PARAMETER_IN and METHOD_PARAMETER_OUT nodes */ -public static final String PARAMETER_LINK = "PARAMETER_LINK"; - -/** Points to dominated node in post DOM tree */ -public static final String POST_DOMINATE = "POST_DOMINATE"; - -/** Encodes propagation of data from on node to another */ -public static final String PROPAGATE = "PROPAGATE"; - -/** Reaching definition edge */ -public static final String REACHING_DEF = "REACHING_DEF"; - -/** The receiver of a method call which is either an object or a pointer */ -public static final String RECEIVER = "RECEIVER"; - -/** A reference to e.g. a LOCAL */ -public static final String REF = "REF"; - -/** Indicates the concrete TYPE for references aka IDENTIFIER or CALL(those which return references) nodes */ -public static final String RESOLVED_TO = "RESOLVED_TO"; - -/** Edges from nodes to tags */ -public static final String TAGGED_BY = "TAGGED_BY"; - -/** Indicates taint removal. Only present between corresponding METHOD_PARAMETER_IN and METHOD_PARAMETER_OUT nodes */ -public static final String TAINT_REMOVE = "TAINT_REMOVE"; - -/** Indicates that a method is part of the vtable of a certain type declaration */ -public static final String VTABLE = "VTABLE"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java deleted file mode 100644 index 0d3eb8886..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/EvaluationStrategies.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class EvaluationStrategies { - -/** A parameter or return of a function is passed by reference which means an address is used behind the scenes */ -public static final String BY_REFERENCE = "BY_REFERENCE"; - -/** Only applicable to object parameter or return values. The pointer to the object is passed by value but the object itself is not copied and changes to it are thus propagated out of the method context */ -public static final String BY_SHARING = "BY_SHARING"; - -/** A parameter or return of a function passed by value which means a flat copy is used */ -public static final String BY_VALUE = "BY_VALUE"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java deleted file mode 100644 index f71681868..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Frameworks.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class Frameworks { - -/** Play framework */ -public static final String PLAY = "PLAY"; - -/** Google web toolkit */ -public static final String GWT = "GWT"; - -/** Java spring framework */ -public static final String SPRING = "SPRING"; - -/** Polyglot event-driven framework */ -public static final String VERTX = "VERTX"; - -/** JavaServer Faces */ -public static final String JSF = "JSF"; - -/** Java Servlet based frameworks */ -public static final String SERVLET = "SERVLET"; - -/** JAX-RS */ -public static final String JAXRS = "JAXRS"; - -/** Spark micro web framework */ -public static final String SPARK = "SPARK"; - -/** Microsoft ASP.NET Core */ -public static final String ASP_NET_CORE = "ASP_NET_CORE"; - -/** Microsoft ASP.NET Web API */ -public static final String ASP_NET_WEB_API = "ASP_NET_WEB_API"; - -/** Microsoft ASP.NET MVC */ -public static final String ASP_NET_MVC = "ASP_NET_MVC"; - -/** JAX-WS */ -public static final String JAXWS = "JAXWS"; - -/** Microsoft ASP.NET Web UI */ -public static final String ASP_NET_WEB_UI = "ASP_NET_WEB_UI"; - -/** Framework facilities directly provided by Java */ -public static final String JAVA_INTERNAL = "JAVA_INTERNAL"; - -/** Dropwizard framework */ -public static final String DROPWIZARD = "DROPWIZARD"; - -/** WCF HTTP and REST */ -public static final String WCF = "WCF"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java deleted file mode 100644 index f56de62b8..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Languages.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class Languages { - -/** */ -public static final String JAVA = "JAVA"; - -/** */ -public static final String JAVASCRIPT = "JAVASCRIPT"; - -/** */ -public static final String GOLANG = "GOLANG"; - -/** */ -public static final String CSHARP = "CSHARP"; - -/** */ -public static final String C = "C"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java deleted file mode 100644 index 89551e52a..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/ModifierTypes.java +++ /dev/null @@ -1,32 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class ModifierTypes { - -/** The static modifier */ -public static final String STATIC = "STATIC"; - -/** The public modifier */ -public static final String PUBLIC = "PUBLIC"; - -/** The protected modifier */ -public static final String PROTECTED = "PROTECTED"; - -/** The private modifier */ -public static final String PRIVATE = "PRIVATE"; - -/** The abstract modifier */ -public static final String ABSTRACT = "ABSTRACT"; - -/** The native modifier */ -public static final String NATIVE = "NATIVE"; - -/** The constructor modifier */ -public static final String CONSTRUCTOR = "CONSTRUCTOR"; - -/** The virtual modifier */ -public static final String VIRTUAL = "VIRTUAL"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java deleted file mode 100644 index 36477e421..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyNames.java +++ /dev/null @@ -1,200 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class NodeKeyNames { - -/** Type full name of which a TYPE_DECL is an alias of */ -public static final String ALIAS_TYPE_FULL_NAME = "ALIAS_TYPE_FULL_NAME"; - -/** */ -public static final String ANNOTATION_FULL_NAME = "ANNOTATION_FULL_NAME"; - -/** */ -public static final String ANNOTATION_NAME = "ANNOTATION_NAME"; - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final String ARGUMENT_INDEX = "ARGUMENT_INDEX"; - -/** The FULL_NAME of a the AST parent of an entity */ -public static final String AST_PARENT_FULL_NAME = "AST_PARENT_FULL_NAME"; - -/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ -public static final String AST_PARENT_TYPE = "AST_PARENT_TYPE"; - -/** Binary type signature */ -public static final String BINARY_SIGNATURE = "BINARY_SIGNATURE"; - -/** */ -public static final String CATEGORY = "CATEGORY"; - -/** */ -public static final String CLASS_NAME = "CLASS_NAME"; - -/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ -public static final String CLOSURE_BINDING_ID = "CLOSURE_BINDING_ID"; - -/** The original name of the (potentially mangled) captured variable */ -public static final String CLOSURE_ORIGINAL_NAME = "CLOSURE_ORIGINAL_NAME"; - -/** The code snippet the node represents */ -public static final String CODE = "CODE"; - -/** Column where the code starts */ -public static final String COLUMN_NUMBER = "COLUMN_NUMBER"; - -/** Column where the code ends */ -public static final String COLUMN_NUMBER_END = "COLUMN_NUMBER_END"; - -/** Content of CONFIG_FILE node */ -public static final String CONTENT = "CONTENT"; - -/** The group ID for a dependency */ -public static final String DEPENDENCY_GROUP_ID = "DEPENDENCY_GROUP_ID"; - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final String DEPTH_FIRST_ORDER = "DEPTH_FIRST_ORDER"; - -/** */ -public static final String DESCRIPTION = "DESCRIPTION"; - -/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ -public static final String DISPATCH_TYPE = "DISPATCH_TYPE"; - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final String EVALUATION_STRATEGY = "EVALUATION_STRATEGY"; - -/** */ -public static final String EVALUATION_TYPE = "EVALUATION_TYPE"; - -/** */ -public static final String FILENAME = "FILENAME"; - -/** */ -public static final String FINGERPRINT = "FINGERPRINT"; - -/** Full name of an element, e.g., the class name along, including its package */ -public static final String FULL_NAME = "FULL_NAME"; - -/** Marks that a method has at least one mapping defined from the policies */ -public static final String HAS_MAPPING = "HAS_MAPPING"; - -/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final String INHERITS_FROM_TYPE_FULL_NAME = "INHERITS_FROM_TYPE_FULL_NAME"; - -/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ -public static final String IS_EXTERNAL = "IS_EXTERNAL"; - -/** */ -public static final String IS_STATIC = "IS_STATIC"; - -/** The programming language this graph originates from */ -public static final String LANGUAGE = "LANGUAGE"; - -/** */ -public static final String LINE_NO = "LINE_NO"; - -/** Line where the code starts */ -public static final String LINE_NUMBER = "LINE_NUMBER"; - -/** Line where the code ends */ -public static final String LINE_NUMBER_END = "LINE_NUMBER_END"; - -/** */ -public static final String LINK = "LINK"; - -/** */ -public static final String LITERALS_TO_SINK = "LITERALS_TO_SINK"; - -/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ -public static final String METHOD_FULL_NAME = "METHOD_FULL_NAME"; - -/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ -public static final String METHOD_INST_FULL_NAME = "METHOD_INST_FULL_NAME"; - -/** */ -public static final String METHOD_NAME = "METHOD_NAME"; - -/** */ -public static final String METHOD_SHORT_NAME = "METHOD_SHORT_NAME"; - -/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ -public static final String MODIFIER_TYPE = "MODIFIER_TYPE"; - -/** Name of represented object, e.g., method name */ -public static final String NAME = "NAME"; - -/** */ -public static final String NODE_ID = "NODE_ID"; - -/** */ -public static final String NODE_LABEL = "NODE_LABEL"; - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final String ORDER = "ORDER"; - -/** */ -public static final String PACKAGE_NAME = "PACKAGE_NAME"; - -/** */ -public static final String PARAMETER = "PARAMETER"; - -/** */ -public static final String PARAMETER_INDEX = "PARAMETER_INDEX"; - -/** Type name emitted by parser, only present for logical type UNKNOWN */ -public static final String PARSER_TYPE_NAME = "PARSER_TYPE_NAME"; - -/** */ -public static final String PATH = "PATH"; - -/** */ -public static final String PATTERN = "PATTERN"; - -/** Indicates whether a call was already resolved. If not set this means not yet resolved */ -public static final String RESOLVED = "RESOLVED"; - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final String SCC_ID = "SCC_ID"; - -/** */ -public static final String SCORE = "SCORE"; - -/** Method signature */ -public static final String SIGNATURE = "SIGNATURE"; - -/** */ -public static final String SINK_TYPE = "SINK_TYPE"; - -/** */ -public static final String SOURCE_TYPE = "SOURCE_TYPE"; - -/** */ -public static final String SPID = "SPID"; - -/** */ -public static final String SYMBOL = "SYMBOL"; - -/** */ -public static final String TITLE = "TITLE"; - -/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ -public static final String TYPE_DECL_FULL_NAME = "TYPE_DECL_FULL_NAME"; - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final String TYPE_FULL_NAME = "TYPE_FULL_NAME"; - -/** Tag value */ -public static final String VALUE = "VALUE"; - -/** */ -public static final String VAR_TYPE = "VAR_TYPE"; - -/** A version, given as a string */ -public static final String VERSION = "VERSION"; - -/** */ -public static final String VULN_DESCR = "VULN_DESCR"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java deleted file mode 100644 index bae4774ba..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeyTypes.java +++ /dev/null @@ -1,73 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class NodeKeyTypes { - -public static final String ALIAS_TYPE_FULL_NAME = "string"; -public static final String ANNOTATION_FULL_NAME = "string"; -public static final String ANNOTATION_NAME = "string"; -public static final String ARGUMENT_INDEX = "int"; -public static final String AST_PARENT_FULL_NAME = "string"; -public static final String AST_PARENT_TYPE = "string"; -public static final String BINARY_SIGNATURE = "string"; -public static final String CATEGORY = "string"; -public static final String CLASS_NAME = "string"; -public static final String CLOSURE_BINDING_ID = "string"; -public static final String CLOSURE_ORIGINAL_NAME = "string"; -public static final String CODE = "string"; -public static final String COLUMN_NUMBER = "int"; -public static final String COLUMN_NUMBER_END = "int"; -public static final String CONTENT = "string"; -public static final String DEPENDENCY_GROUP_ID = "string"; -public static final String DEPTH_FIRST_ORDER = "int"; -public static final String DESCRIPTION = "string"; -public static final String DISPATCH_TYPE = "string"; -public static final String EVALUATION_STRATEGY = "string"; -public static final String EVALUATION_TYPE = "string"; -public static final String FILENAME = "string"; -public static final String FINGERPRINT = "string"; -public static final String FULL_NAME = "string"; -public static final String HAS_MAPPING = "boolean"; -public static final String INHERITS_FROM_TYPE_FULL_NAME = "string"; -public static final String IS_EXTERNAL = "boolean"; -public static final String IS_STATIC = "boolean"; -public static final String LANGUAGE = "string"; -public static final String LINE_NO = "string"; -public static final String LINE_NUMBER = "int"; -public static final String LINE_NUMBER_END = "int"; -public static final String LINK = "string"; -public static final String LITERALS_TO_SINK = "string"; -public static final String METHOD_FULL_NAME = "string"; -public static final String METHOD_INST_FULL_NAME = "string"; -public static final String METHOD_NAME = "string"; -public static final String METHOD_SHORT_NAME = "string"; -public static final String MODIFIER_TYPE = "string"; -public static final String NAME = "string"; -public static final String NODE_ID = "string"; -public static final String NODE_LABEL = "string"; -public static final String ORDER = "int"; -public static final String PACKAGE_NAME = "string"; -public static final String PARAMETER = "string"; -public static final String PARAMETER_INDEX = "int"; -public static final String PARSER_TYPE_NAME = "string"; -public static final String PATH = "string"; -public static final String PATTERN = "string"; -public static final String RESOLVED = "boolean"; -public static final String SCC_ID = "int"; -public static final String SCORE = "int"; -public static final String SIGNATURE = "string"; -public static final String SINK_TYPE = "string"; -public static final String SOURCE_TYPE = "string"; -public static final String SPID = "string"; -public static final String SYMBOL = "string"; -public static final String TITLE = "string"; -public static final String TYPE_DECL_FULL_NAME = "string"; -public static final String TYPE_FULL_NAME = "string"; -public static final String VALUE = "string"; -public static final String VAR_TYPE = "string"; -public static final String VERSION = "string"; -public static final String VULN_DESCR = "string"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java deleted file mode 100644 index 92bc75e93..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeKeys.java +++ /dev/null @@ -1,1091 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class NodeKeys { - -/** */ -public static final Key IS_STATIC = new Key<>("IS_STATIC"); - -/** */ -public static final Key PARAMETER_INDEX = new Key<>("PARAMETER_INDEX"); - -/** */ -public static final Key SCORE = new Key<>("SCORE"); - -/** */ -public static final Key ANNOTATION_FULL_NAME = new Key<>("ANNOTATION_FULL_NAME"); - -/** */ -public static final Key ANNOTATION_NAME = new Key<>("ANNOTATION_NAME"); - -/** */ -public static final Key CATEGORY = new Key<>("CATEGORY"); - -/** */ -public static final Key CLASS_NAME = new Key<>("CLASS_NAME"); - -/** */ -public static final Key DESCRIPTION = new Key<>("DESCRIPTION"); - -/** */ -public static final Key EVALUATION_TYPE = new Key<>("EVALUATION_TYPE"); - -/** */ -public static final Key FILENAME = new Key<>("FILENAME"); - -/** */ -public static final Key FINGERPRINT = new Key<>("FINGERPRINT"); - -/** */ -public static final Key LINE_NO = new Key<>("LINE_NO"); - -/** */ -public static final Key LINK = new Key<>("LINK"); - -/** */ -public static final Key LITERALS_TO_SINK = new Key<>("LITERALS_TO_SINK"); - -/** */ -public static final Key METHOD_NAME = new Key<>("METHOD_NAME"); - -/** */ -public static final Key METHOD_SHORT_NAME = new Key<>("METHOD_SHORT_NAME"); - -/** */ -public static final Key NODE_ID = new Key<>("NODE_ID"); - -/** */ -public static final Key NODE_LABEL = new Key<>("NODE_LABEL"); - -/** */ -public static final Key PACKAGE_NAME = new Key<>("PACKAGE_NAME"); - -/** */ -public static final Key PARAMETER = new Key<>("PARAMETER"); - -/** */ -public static final Key PATH = new Key<>("PATH"); - -/** */ -public static final Key PATTERN = new Key<>("PATTERN"); - -/** */ -public static final Key SINK_TYPE = new Key<>("SINK_TYPE"); - -/** */ -public static final Key SOURCE_TYPE = new Key<>("SOURCE_TYPE"); - -/** */ -public static final Key SPID = new Key<>("SPID"); - -/** */ -public static final Key SYMBOL = new Key<>("SYMBOL"); - -/** */ -public static final Key TITLE = new Key<>("TITLE"); - -/** */ -public static final Key VAR_TYPE = new Key<>("VAR_TYPE"); - -/** */ -public static final Key VULN_DESCR = new Key<>("VULN_DESCR"); - -/** A version, given as a string */ -public static final Key VERSION = new Key<>("VERSION"); - -/** Binary type signature */ -public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Content of CONFIG_FILE node */ -public static final Key CONTENT = new Key<>("CONTENT"); - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ -public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); - -/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ -public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); - -/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ -public static final Key MODIFIER_TYPE = new Key<>("MODIFIER_TYPE"); - -/** Indicates whether a call was already resolved. If not set this means not yet resolved */ -public static final Key RESOLVED = new Key<>("RESOLVED"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Marks that a method has at least one mapping defined from the policies */ -public static final Key HAS_MAPPING = new Key<>("HAS_MAPPING"); - -/** Method signature */ -public static final Key SIGNATURE = new Key<>("SIGNATURE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** Tag value */ -public static final Key VALUE = new Key<>("VALUE"); - -/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ -public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); - -/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ -public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); - -/** The FULL_NAME of a the AST parent of an entity */ -public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); - -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ -public static final Key DISPATCH_TYPE = new Key<>("DISPATCH_TYPE"); - -/** The group ID for a dependency */ -public static final Key DEPENDENCY_GROUP_ID = new Key<>("DEPENDENCY_GROUP_ID"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The original name of the (potentially mangled) captured variable */ -public static final Key CLOSURE_ORIGINAL_NAME = new Key<>("CLOSURE_ORIGINAL_NAME"); - -/** The programming language this graph originates from */ -public static final Key LANGUAGE = new Key<>("LANGUAGE"); - -/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ -public static final Key TYPE_DECL_FULL_NAME = new Key<>("TYPE_DECL_FULL_NAME"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key INHERITS_FROM_TYPE_FULL_NAME = new Key<>("INHERITS_FROM_TYPE_FULL_NAME"); - -/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ -public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); - -/** Type full name of which a TYPE_DECL is an alias of */ -public static final Key ALIAS_TYPE_FULL_NAME = new Key<>("ALIAS_TYPE_FULL_NAME"); - -/** Type name emitted by parser, only present for logical type UNKNOWN */ -public static final Key PARSER_TYPE_NAME = new Key<>("PARSER_TYPE_NAME"); - -/** A method annotation */ -public static class ANNOTATION { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -} - -/** A literal value assigned to an ANNOTATION_PARAMETER */ -public static class ANNOTATION_LITERAL { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -} - -/** Formal annotation parameter */ -public static class ANNOTATION_PARAMETER { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -} - -/** Assignment of annotation argument to annotation parameter */ -public static class ANNOTATION_PARAMETER_ASSIGN { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -} - -/** Initialization construct for arrays */ -public static class ARRAY_INITIALIZER { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -} - -/** A structuring block in the AST */ -public static class BLOCK { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** A (method)-call */ -public static class CALL { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The dispatch type of a call, which is either static or dynamic. See dispatchTypes */ -public static final Key DISPATCH_TYPE = new Key<>("DISPATCH_TYPE"); - -/** Method signature */ -public static final Key SIGNATURE = new Key<>("SIGNATURE"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ -public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Indicates whether a call was already resolved. If not set this means not yet resolved */ -public static final Key RESOLVED = new Key<>("RESOLVED"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** */ -public static class CALL_CHAIN { -} - -/** */ -public static class CALL_SITE { -} - -/** Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method */ -public static class CLOSURE_BINDING { -/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ -public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); - -/** The original name of the (potentially mangled) captured variable */ -public static final Key CLOSURE_ORIGINAL_NAME = new Key<>("CLOSURE_ORIGINAL_NAME"); - -} - -/** A comment */ -public static class COMMENT { -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -} - -/** Configuration file contents. Might be in use by a framework */ -public static class CONFIG_FILE { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Content of CONFIG_FILE node */ -public static final Key CONTENT = new Key<>("CONTENT"); - -} - -/** This node represents a dependency */ -public static class DEPENDENCY { -/** A version, given as a string */ -public static final Key VERSION = new Key<>("VERSION"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** The group ID for a dependency */ -public static final Key DEPENDENCY_GROUP_ID = new Key<>("DEPENDENCY_GROUP_ID"); - -} - -/** */ -public static class DETACHED_TRACKING_POINT { -} - -/** Node representing a source file. Often also the AST root */ -public static class FILE { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -} - -/** */ -public static class FINDING { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** */ -public static final Key CATEGORY = new Key<>("CATEGORY"); - -/** */ -public static final Key TITLE = new Key<>("TITLE"); - -/** */ -public static final Key DESCRIPTION = new Key<>("DESCRIPTION"); - -/** */ -public static final Key SCORE = new Key<>("SCORE"); - -/** */ -public static final Key LINK = new Key<>("LINK"); - -/** */ -public static final Key VULN_DESCR = new Key<>("VULN_DESCR"); - -/** */ -public static final Key PARAMETER = new Key<>("PARAMETER"); - -/** */ -public static final Key METHOD_NAME = new Key<>("METHOD_NAME"); - -/** */ -public static final Key LINE_NO = new Key<>("LINE_NO"); - -/** */ -public static final Key FILENAME = new Key<>("FILENAME"); - -} - -/** */ -public static class FLOW { -} - -/** Indicates the usage of a framework. E.g. java spring. The name key is one of the values from frameworks list */ -public static class FRAMEWORK { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -} - -/** Data used by a framework */ -public static class FRAMEWORK_DATA { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Content of CONFIG_FILE node */ -public static final Key CONTENT = new Key<>("CONTENT"); - -} - -/** An arbitrary identifier/reference */ -public static class IDENTIFIER { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** */ -public static class IOFLOW { -/** */ -public static final Key FINGERPRINT = new Key<>("FINGERPRINT"); - -/** */ -public static final Key LITERALS_TO_SINK = new Key<>("LITERALS_TO_SINK"); - -} - -/** Literal/Constant */ -public static class LITERAL { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** A local variable */ -public static class LOCAL { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Identifier which uniquely describes a CLOSURE_BINDING. This property is used to match captured LOCAL nodes with the corresponding CLOSURE_BINDING nodes */ -public static final Key CLOSURE_BINDING_ID = new Key<>("CLOSURE_BINDING_ID"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -} - -/** */ -public static class LOCATION { -/** */ -public static final Key SYMBOL = new Key<>("SYMBOL"); - -/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ -public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); - -/** */ -public static final Key METHOD_SHORT_NAME = new Key<>("METHOD_SHORT_NAME"); - -/** */ -public static final Key PACKAGE_NAME = new Key<>("PACKAGE_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** */ -public static final Key CLASS_NAME = new Key<>("CLASS_NAME"); - -/** */ -public static final Key NODE_LABEL = new Key<>("NODE_LABEL"); - -/** */ -public static final Key FILENAME = new Key<>("FILENAME"); - -} - -/** */ -public static class MATCH_INFO { -/** */ -public static final Key PATTERN = new Key<>("PATTERN"); - -/** */ -public static final Key CATEGORY = new Key<>("CATEGORY"); - -} - -/** Member of a class struct or union */ -public static class MEMBER { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -} - -/** Node to save meta data about the graph on its properties. Exactly one node of this type per graph */ -public static class META_DATA { -/** The programming language this graph originates from */ -public static final Key LANGUAGE = new Key<>("LANGUAGE"); - -/** A version, given as a string */ -public static final Key VERSION = new Key<>("VERSION"); - -/** */ -public static final Key SPID = new Key<>("SPID"); - -} - -/** A method/function/procedure */ -public static class METHOD { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -/** Method signature */ -public static final Key SIGNATURE = new Key<>("SIGNATURE"); - -/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ -public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); - -/** The FULL_NAME of a the AST parent of an entity */ -public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Marks that a method has at least one mapping defined from the policies */ -public static final Key HAS_MAPPING = new Key<>("HAS_MAPPING"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -/** Binary type signature */ -public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); - -} - -/** A method instance which always has to reference a method and may have type argument children if the referred to method is a template */ -public static class METHOD_INST { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -/** Method signature */ -public static final Key SIGNATURE = new Key<>("SIGNATURE"); - -/** The FULL_NAME of a method. Used to link METHOD_INST and METHOD nodes. It is required to have exactly one METHOD node for each METHOD_FULL_NAME */ -public static final Key METHOD_FULL_NAME = new Key<>("METHOD_FULL_NAME"); - -} - -/** This node represents a formal parameter going towards the callee side */ -public static class METHOD_PARAMETER_IN { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -} - -/** This node represents a formal parameter going towards the caller side */ -public static class METHOD_PARAMETER_OUT { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -} - -/** Reference to a method instance */ -public static class METHOD_REF { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The FULL_NAME of a method instance. Used to link CALL and METHOD_REF nodes to METHOD_INST nodes. There needs to be at least one METHOD_INST node for each METHOD_INST_FULL_NAME */ -public static final Key METHOD_INST_FULL_NAME = new Key<>("METHOD_INST_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** A formal method return */ -public static class METHOD_RETURN { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Evaluation strategy for function parameters and return values. One of the values in "evaluationStrategies" */ -public static final Key EVALUATION_STRATEGY = new Key<>("EVALUATION_STRATEGY"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** */ -public static class METHOD_SUMMARY { -/** */ -public static final Key IS_STATIC = new Key<>("IS_STATIC"); - -/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ -public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); - -/** Binary type signature */ -public static final Key BINARY_SIGNATURE = new Key<>("BINARY_SIGNATURE"); - -} - -/** The static-modifier */ -public static class MODIFIER { -/** Indicates the modifier which is represented by a MODIFIER node. See modifierTypes */ -public static final Key MODIFIER_TYPE = new Key<>("MODIFIER_TYPE"); - -} - -/** This node represents a namespace as a whole whereas the NAMESPACE_BLOCK is used for each grouping occurrence of a namespace in code. Single representing NAMESPACE node is required for easier navigation in the query language */ -public static class NAMESPACE { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -} - -/** A reference to a namespace */ -public static class NAMESPACE_BLOCK { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -} - -/** */ -public static class PROGRAM_POINT { -} - -/** */ -public static class READ { -} - -/** A return instruction */ -public static class RETURN { -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** */ -public static class ROUTE { -/** */ -public static final Key PATH = new Key<>("PATH"); - -} - -/** */ -public static class SENSITIVE_DATA_TYPE { -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -} - -/** */ -public static class SENSITIVE_MEMBER { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -} - -/** */ -public static class SENSITIVE_REFERENCE { -} - -/** */ -public static class SENSITIVE_VARIABLE { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -} - -/** */ -public static class SINK { -/** */ -public static final Key SINK_TYPE = new Key<>("SINK_TYPE"); - -} - -/** */ -public static class SOURCE { -/** */ -public static final Key SOURCE_TYPE = new Key<>("SOURCE_TYPE"); - -} - -/** */ -public static class SP_ANNOTATION_PARAMETER { -/** */ -public static final Key ANNOTATION_NAME = new Key<>("ANNOTATION_NAME"); - -/** */ -public static final Key ANNOTATION_FULL_NAME = new Key<>("ANNOTATION_FULL_NAME"); - -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Tag value */ -public static final Key VALUE = new Key<>("VALUE"); - -} - -/** */ -public static class SP_BLACKLIST { -} - -/** A string tag */ -public static class TAG { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Tag value */ -public static final Key VALUE = new Key<>("VALUE"); - -} - -/** Multiple tags */ -public static class TAGS { -} - -/** */ -public static class TAG_NODE_PAIR { -} - -/** */ -public static class TRANSFORM { -} - -/** */ -public static class TRANSFORMATION { -} - -/** A type which always has to reference a type declaration and may have type argument children if the referred to type declaration is a template */ -public static class TYPE { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -/** The static type decl of a TYPE. This property is matched against the FULL_NAME of TYPE_DECL nodes. It is required to have exactly one TYPE_DECL for each different TYPE_DECL_FULL_NAME */ -public static final Key TYPE_DECL_FULL_NAME = new Key<>("TYPE_DECL_FULL_NAME"); - -} - -/** Argument for a TYPE_PARAMETER that belongs to a TYPE or METHOD_INST. It binds another TYPE to a TYPE_PARAMETER */ -public static class TYPE_ARGUMENT { -} - -/** A type declaration */ -public static class TYPE_DECL { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** Full name of an element, e.g., the class name along, including its package */ -public static final Key FULL_NAME = new Key<>("FULL_NAME"); - -/** Indicates that the construct is external, that is, it is referenced but not defined in the code */ -public static final Key IS_EXTERNAL = new Key<>("IS_EXTERNAL"); - -/** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key INHERITS_FROM_TYPE_FULL_NAME = new Key<>("INHERITS_FROM_TYPE_FULL_NAME"); - -/** The type of the AST parent. Since this is only used in some parts of the graph the list does not include all possible parents by intention. Possible parents: METHOD, TYPE_DECL, NAMESPACE_BLOCK */ -public static final Key AST_PARENT_TYPE = new Key<>("AST_PARENT_TYPE"); - -/** The FULL_NAME of a the AST parent of an entity */ -public static final Key AST_PARENT_FULL_NAME = new Key<>("AST_PARENT_FULL_NAME"); - -/** Type full name of which a TYPE_DECL is an alias of */ -public static final Key ALIAS_TYPE_FULL_NAME = new Key<>("ALIAS_TYPE_FULL_NAME"); - -} - -/** Type parameter of TYPE_DECL or METHOD */ -public static class TYPE_PARAMETER { -/** Name of represented object, e.g., method name */ -public static final Key NAME = new Key<>("NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -} - -/** A language-specific node */ -public static class UNKNOWN { -/** The code snippet the node represents */ -public static final Key CODE = new Key<>("CODE"); - -/** Type name emitted by parser, only present for logical type UNKNOWN */ -public static final Key PARSER_TYPE_NAME = new Key<>("PARSER_TYPE_NAME"); - -/** General ordering property. E.g. used to express the ordering of children in the AST */ -public static final Key ORDER = new Key<>("ORDER"); - -/** The index of a call argument. This is used for the association between arguments and parameters. This property is different from ORDER for named arguments because of the required reordering to align arguments with parameters */ -public static final Key ARGUMENT_INDEX = new Key<>("ARGUMENT_INDEX"); - -/** The static type of an entity. E.g. expressions, local, parameters etc. This property is matched against the FULL_NAME of TYPE nodes and thus it is required to have at least one TYPE node for each TYPE_FULL_NAME */ -public static final Key TYPE_FULL_NAME = new Key<>("TYPE_FULL_NAME"); - -/** Line where the code starts */ -public static final Key LINE_NUMBER = new Key<>("LINE_NUMBER"); - -/** Line where the code ends */ -public static final Key LINE_NUMBER_END = new Key<>("LINE_NUMBER_END"); - -/** Column where the code starts */ -public static final Key COLUMN_NUMBER = new Key<>("COLUMN_NUMBER"); - -/** Column where the code ends */ -public static final Key COLUMN_NUMBER_END = new Key<>("COLUMN_NUMBER_END"); - -/** Strongly connected component(SCC) ID which is equal for all expressions in the same component. The SCC IDs start from 0 for each method */ -public static final Key SCC_ID = new Key<>("SCC_ID"); - -/** The depth first ordering number used to detect back edges in reducible CFGs */ -public static final Key DEPTH_FIRST_ORDER = new Key<>("DEPTH_FIRST_ORDER"); - -} - -/** */ -public static class VARIABLE_INFO { -/** */ -public static final Key VAR_TYPE = new Key<>("VAR_TYPE"); - -/** */ -public static final Key EVALUATION_TYPE = new Key<>("EVALUATION_TYPE"); - -/** */ -public static final Key PARAMETER_INDEX = new Key<>("PARAMETER_INDEX"); - -} - -/** */ -public static class WRITE { -} - -/** This node records what package prefix is most common to all analysed classes in the CPG */ -public static class PACKAGE_PREFIX { -/** Tag value */ -public static final Key VALUE = new Key<>("VALUE"); - -} - - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java deleted file mode 100644 index 7ad59b500..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/NodeTypes.java +++ /dev/null @@ -1,194 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class NodeTypes { - -/** A method annotation */ -public static final String ANNOTATION = "ANNOTATION"; - -/** A literal value assigned to an ANNOTATION_PARAMETER */ -public static final String ANNOTATION_LITERAL = "ANNOTATION_LITERAL"; - -/** Formal annotation parameter */ -public static final String ANNOTATION_PARAMETER = "ANNOTATION_PARAMETER"; - -/** Assignment of annotation argument to annotation parameter */ -public static final String ANNOTATION_PARAMETER_ASSIGN = "ANNOTATION_PARAMETER_ASSIGN"; - -/** Initialization construct for arrays */ -public static final String ARRAY_INITIALIZER = "ARRAY_INITIALIZER"; - -/** A structuring block in the AST */ -public static final String BLOCK = "BLOCK"; - -/** A (method)-call */ -public static final String CALL = "CALL"; - -/** */ -public static final String CALL_CHAIN = "CALL_CHAIN"; - -/** */ -public static final String CALL_SITE = "CALL_SITE"; - -/** Represents the binding of a LOCAL or METHOD_PARAMETER_IN into the closure of a method */ -public static final String CLOSURE_BINDING = "CLOSURE_BINDING"; - -/** A comment */ -public static final String COMMENT = "COMMENT"; - -/** Configuration file contents. Might be in use by a framework */ -public static final String CONFIG_FILE = "CONFIG_FILE"; - -/** This node represents a dependency */ -public static final String DEPENDENCY = "DEPENDENCY"; - -/** */ -public static final String DETACHED_TRACKING_POINT = "DETACHED_TRACKING_POINT"; - -/** Node representing a source file. Often also the AST root */ -public static final String FILE = "FILE"; - -/** */ -public static final String FINDING = "FINDING"; - -/** */ -public static final String FLOW = "FLOW"; - -/** Indicates the usage of a framework. E.g. java spring. The name key is one of the values from frameworks list */ -public static final String FRAMEWORK = "FRAMEWORK"; - -/** Data used by a framework */ -public static final String FRAMEWORK_DATA = "FRAMEWORK_DATA"; - -/** An arbitrary identifier/reference */ -public static final String IDENTIFIER = "IDENTIFIER"; - -/** */ -public static final String IOFLOW = "IOFLOW"; - -/** Literal/Constant */ -public static final String LITERAL = "LITERAL"; - -/** A local variable */ -public static final String LOCAL = "LOCAL"; - -/** */ -public static final String LOCATION = "LOCATION"; - -/** */ -public static final String MATCH_INFO = "MATCH_INFO"; - -/** Member of a class struct or union */ -public static final String MEMBER = "MEMBER"; - -/** Node to save meta data about the graph on its properties. Exactly one node of this type per graph */ -public static final String META_DATA = "META_DATA"; - -/** A method/function/procedure */ -public static final String METHOD = "METHOD"; - -/** A method instance which always has to reference a method and may have type argument children if the referred to method is a template */ -public static final String METHOD_INST = "METHOD_INST"; - -/** This node represents a formal parameter going towards the callee side */ -public static final String METHOD_PARAMETER_IN = "METHOD_PARAMETER_IN"; - -/** This node represents a formal parameter going towards the caller side */ -public static final String METHOD_PARAMETER_OUT = "METHOD_PARAMETER_OUT"; - -/** Reference to a method instance */ -public static final String METHOD_REF = "METHOD_REF"; - -/** A formal method return */ -public static final String METHOD_RETURN = "METHOD_RETURN"; - -/** */ -public static final String METHOD_SUMMARY = "METHOD_SUMMARY"; - -/** The static-modifier */ -public static final String MODIFIER = "MODIFIER"; - -/** This node represents a namespace as a whole whereas the NAMESPACE_BLOCK is used for each grouping occurrence of a namespace in code. Single representing NAMESPACE node is required for easier navigation in the query language */ -public static final String NAMESPACE = "NAMESPACE"; - -/** A reference to a namespace */ -public static final String NAMESPACE_BLOCK = "NAMESPACE_BLOCK"; - -/** */ -public static final String PROGRAM_POINT = "PROGRAM_POINT"; - -/** */ -public static final String READ = "READ"; - -/** A return instruction */ -public static final String RETURN = "RETURN"; - -/** */ -public static final String ROUTE = "ROUTE"; - -/** */ -public static final String SENSITIVE_DATA_TYPE = "SENSITIVE_DATA_TYPE"; - -/** */ -public static final String SENSITIVE_MEMBER = "SENSITIVE_MEMBER"; - -/** */ -public static final String SENSITIVE_REFERENCE = "SENSITIVE_REFERENCE"; - -/** */ -public static final String SENSITIVE_VARIABLE = "SENSITIVE_VARIABLE"; - -/** */ -public static final String SINK = "SINK"; - -/** */ -public static final String SOURCE = "SOURCE"; - -/** */ -public static final String SP_ANNOTATION_PARAMETER = "SP_ANNOTATION_PARAMETER"; - -/** */ -public static final String SP_BLACKLIST = "SP_BLACKLIST"; - -/** A string tag */ -public static final String TAG = "TAG"; - -/** Multiple tags */ -public static final String TAGS = "TAGS"; - -/** */ -public static final String TAG_NODE_PAIR = "TAG_NODE_PAIR"; - -/** */ -public static final String TRANSFORM = "TRANSFORM"; - -/** */ -public static final String TRANSFORMATION = "TRANSFORMATION"; - -/** A type which always has to reference a type declaration and may have type argument children if the referred to type declaration is a template */ -public static final String TYPE = "TYPE"; - -/** Argument for a TYPE_PARAMETER that belongs to a TYPE or METHOD_INST. It binds another TYPE to a TYPE_PARAMETER */ -public static final String TYPE_ARGUMENT = "TYPE_ARGUMENT"; - -/** A type declaration */ -public static final String TYPE_DECL = "TYPE_DECL"; - -/** Type parameter of TYPE_DECL or METHOD */ -public static final String TYPE_PARAMETER = "TYPE_PARAMETER"; - -/** A language-specific node */ -public static final String UNKNOWN = "UNKNOWN"; - -/** */ -public static final String VARIABLE_INFO = "VARIABLE_INFO"; - -/** */ -public static final String WRITE = "WRITE"; - -/** This node records what package prefix is most common to all analysed classes in the CPG */ -public static final String PACKAGE_PREFIX = "PACKAGE_PREFIX"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java deleted file mode 100644 index fba682a26..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/Operators.java +++ /dev/null @@ -1,167 +0,0 @@ -package io.shiftleft.codepropertygraph.generated; - -import gremlin.scala.Key; - -public class Operators { - -/** */ -public static final String addition = ".addition"; - -/** */ -public static final String subtraction = ".subtraction"; - -/** */ -public static final String multiplication = ".multiplication"; - -/** */ -public static final String division = ".division"; - -/** */ -public static final String exponentiation = ".exponentiation"; - -/** */ -public static final String modulo = ".modulo"; - -/** */ -public static final String shiftLeft = ".shiftLeft"; - -/** Shift right padding with zeros */ -public static final String logicalShiftRight = ".logicalShiftRight"; - -/** Shift right preserving the sign */ -public static final String arithmeticShiftRight = ".arithmeticShiftRight"; - -/** */ -public static final String not = ".not"; - -/** */ -public static final String and = ".and"; - -/** */ -public static final String or = ".or"; - -/** */ -public static final String xor = ".xor"; - -/** */ -public static final String assignmentPlus = ".assignmentPlus"; - -/** */ -public static final String assignmentMinus = ".assignmentMinus"; - -/** */ -public static final String assignmentMultiplication = ".assignmentMultiplication"; - -/** */ -public static final String assignmentDivision = ".assignmentDivision"; - -/** */ -public static final String assignmentExponentiation = ".assignmentExponentiation"; - -/** */ -public static final String assignmentModulo = ".assignmentModulo"; - -/** */ -public static final String assignmentShiftLeft = ".assignmentShiftLeft"; - -/** */ -public static final String assignmentLogicalShifRight = ".assignmentLogicalShifRight"; - -/** */ -public static final String assignmentArithmeticShiftRight = ".assignmentArithmeticShiftRight"; - -/** */ -public static final String assignmentAnd = ".assignmentAnd"; - -/** */ -public static final String assignmentOr = ".assignmentOr"; - -/** */ -public static final String assignmentXor = ".assignmentXor"; - -/** */ -public static final String assignment = ".assignment"; - -/** E.g. `a = -b` */ -public static final String minus = ".minus"; - -/** E.g. `a = +b` */ -public static final String plus = ".plus"; - -/** */ -public static final String preIncrement = ".preIncrement"; - -/** */ -public static final String preDecrement = ".preDecrement"; - -/** */ -public static final String postIncrement = ".postIncrement"; - -/** */ -public static final String postDecrement = ".postDecrement"; - -/** */ -public static final String logicalNot = ".logicalNot"; - -/** */ -public static final String logicalOr = ".logicalOr"; - -/** */ -public static final String logicalAnd = ".logicalAnd"; - -/** */ -public static final String equals = ".equals"; - -/** */ -public static final String notEquals = ".notEquals"; - -/** */ -public static final String greaterThan = ".greaterThan"; - -/** */ -public static final String lessThan = ".lessThan"; - -/** */ -public static final String greaterEqualsThan = ".greaterEqualsThan"; - -/** */ -public static final String lessEqualsThan = ".lessEqualsThan"; - -/** */ -public static final String instanceOf = ".instanceOf"; - -/** E.g. in C: `a.b` but not! in Java */ -public static final String memberAccess = ".memberAccess"; - -/** E.g. in C: `a->b` and `a.b` in Java */ -public static final String indirectMemberAccess = ".indirectMemberAccess"; - -/** E.g. in C: `a[b]` but not! in Java */ -public static final String computedMemberAccess = ".computedMemberAccess"; - -/** E.g. in C++: `a->*b` and a[b] in Java */ -public static final String indirectComputedMemberAccess = ".indirectComputedMemberAccess"; - -/** E.g. in C: `*a` */ -public static final String indirection = ".indirection"; - -/** Deletes a property from a namespace. E.g. `a=3; delete a; a == undefined; */ -public static final String delete = ".delete"; - -/** E.g. `a ? consequent : alternate`. In future probably also used for if statements */ -public static final String conditional = ".conditional"; - -/** Type casts of any sort */ -public static final String cast = ".cast"; - -/** Comparison between two arguments with the results: 0 == equal, negative == left < right, positive == left > right */ -public static final String compare = ".compare"; - -/** Returns the address of a given object */ -public static final String addressOf = ".addressOf"; - -/** Returns the size of a given object */ -public static final String sizeOf = ".sizeOf"; - - -} diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala deleted file mode 100644 index 6380a30c0..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/edges/Edges.scala +++ /dev/null @@ -1,1580 +0,0 @@ - package io.shiftleft.codepropertygraph.generated.edges - - import java.lang.{Boolean => JBoolean, Long => JLong} - import java.util.{HashMap => JHashMap, Set => JSet, TreeMap} - import org.apache.tinkerpop.gremlin.structure.Property - import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} - import org.apache.tinkerpop.gremlin.tinkergraph.structure.{EdgeRef, SpecializedElementFactory, SpecializedTinkerEdge, TinkerGraph, TinkerProperty, TinkerVertex, VertexRef} - import scala.collection.JavaConverters._ - - object Factories { -// lazy val All: List[SpecializedElementFactory.ForEdge[_]] = List(AliasOf.Factory, Ast.Factory, AttachedData.Factory, BindsTo.Factory, Call.Factory, CallArg.Factory, CallArgOut.Factory, CallRet.Factory, Capture.Factory, CapturedBy.Factory, Cdg.Factory, Cfg.Factory, Contains.Factory, ContainsNode.Factory, Dominate.Factory, EvalType.Factory, InheritsFrom.Factory, IsSensitiveDataDescrOf.Factory, IsSensitiveDataDescrOfRef.Factory, IsSensitiveDataOfType.Factory, ParameterLink.Factory, PostDominate.Factory, Propagate.Factory, ReachingDef.Factory, Receiver.Factory, Ref.Factory, ResolvedTo.Factory, TaggedBy.Factory, TaintRemove.Factory, Vtable.Factory) -// lazy val AllAsJava: java.util.List[SpecializedElementFactory.ForEdge[_]] = All.asJava - } - - -object ContainsNode { - val Label = "CONTAINS_NODE" - object Keys { - val LocalName = "LOCAL_NAME" - object Indices { - val LocalName = 0 - } - - val All: JSet[String] = Set(LocalName).asJava - val KeyToValue: Map[String, ContainsNodeDb => Any] = Map( - LocalName -> { instance: ContainsNodeDb => instance.localName()}, - ) - } - - val Factory = new SpecializedElementFactory.ForEdge[ContainsNodeDb] { - override val forLabel = ContainsNode.Label - - override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = - new ContainsNodeDb(graph, id, outVertex, inVertex) - - override def createEdgeRef(edge: ContainsNodeDb) = ContainsNode(edge) - - override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = - ContainsNode(id, graph) - - /* XXX0 new part start*/ - override def propertyNamesByIndex() = { - val ret = new JHashMap[Integer, String] - ret.put(ContainsNode.Keys.Indices.LocalName, ContainsNode.Keys.LocalName) - ret - } - override def propertyTypeByIndex() = { - val ret = new JHashMap[Integer, Class[_]] - ret.put(ContainsNode.Keys.Indices.LocalName, classOf[String]) - ret - } - /* XXX0 new part end*/ - } - - def apply(wrapped: ContainsNodeDb) = new EdgeRef(wrapped) with ContainsNode - def apply(id: Long, graph: TinkerGraph) = - new EdgeRef[ContainsNodeDb](id, ContainsNode.Label, graph) with ContainsNode -} - trait ContainsNode extends EdgeRef[ContainsNodeDb] - class ContainsNodeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) - extends SpecializedTinkerEdge(_graph, _id, _outVertex, ContainsNode.Label, _inVertex, ContainsNode.Keys.All) { - - /* XXX0 new part start */ - private var _localName: Option[String] = None -def localName(): Option[String] = _localName - /* XXX0 new part end */ - - /* XXX0 new part start */ - override def propertiesByStorageIdx = { - val properties = new TreeMap[Integer, Object] - // TODO optimise: load all properties in one go rather than lazily - localName.map { value => properties.put(ContainsNode.Keys.Indices.LocalName, value) } - properties - } - /* XXX0 new part end */ - - override protected def specificProperty[A](key: String): Property[A] = - ContainsNode.Keys.KeyToValue.get(key) match { - case None => Property.empty[A] - case Some(fieldAccess) => - fieldAccess(this) match { - case null | None => Property.empty[A] - case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) - case value => new TinkerProperty(this, key, value.asInstanceOf[A]) - } - } - - override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { - if (key == "LOCAL_NAME") this._localName = Option(value).asInstanceOf[Option[String]] - else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") - property(key) - } - - override protected def removeSpecificProperty(key: String): Unit = - if (key == "LOCAL_NAME") this._localName = null - else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") - } - - -// object AliasOf { -// val Label = "ALIAS_OF" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, AliasOfDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[AliasOfDb] { -// override val forLabel = AliasOf.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new AliasOfDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: AliasOfDb) = AliasOf(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// AliasOf(id, graph) -// } - -// def apply(wrapped: AliasOfDb) = new EdgeRef(wrapped) with AliasOf -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[AliasOfDb](id, AliasOf.Label, graph) with AliasOf -// } -// trait AliasOf extends EdgeRef[AliasOfDb] -// class AliasOfDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, AliasOf.Label, _inVertex, AliasOf.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// AliasOf.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Ast { -// val Label = "AST" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, AstDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[AstDb] { -// override val forLabel = Ast.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new AstDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: AstDb) = Ast(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Ast(id, graph) -// } - -// def apply(wrapped: AstDb) = new EdgeRef(wrapped) with Ast -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[AstDb](id, Ast.Label, graph) with Ast -// } -// trait Ast extends EdgeRef[AstDb] -// class AstDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Ast.Label, _inVertex, Ast.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Ast.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object AttachedData { -// val Label = "ATTACHED_DATA" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, AttachedDataDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[AttachedDataDb] { -// override val forLabel = AttachedData.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new AttachedDataDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: AttachedDataDb) = AttachedData(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// AttachedData(id, graph) -// } - -// def apply(wrapped: AttachedDataDb) = new EdgeRef(wrapped) with AttachedData -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[AttachedDataDb](id, AttachedData.Label, graph) with AttachedData -// } -// trait AttachedData extends EdgeRef[AttachedDataDb] -// class AttachedDataDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, AttachedData.Label, _inVertex, AttachedData.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// AttachedData.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object BindsTo { -// val Label = "BINDS_TO" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, BindsToDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[BindsToDb] { -// override val forLabel = BindsTo.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new BindsToDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: BindsToDb) = BindsTo(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// BindsTo(id, graph) -// } - -// def apply(wrapped: BindsToDb) = new EdgeRef(wrapped) with BindsTo -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[BindsToDb](id, BindsTo.Label, graph) with BindsTo -// } -// trait BindsTo extends EdgeRef[BindsToDb] -// class BindsToDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, BindsTo.Label, _inVertex, BindsTo.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// BindsTo.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Call { -// val Label = "CALL" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CallDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CallDb] { -// override val forLabel = Call.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CallDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CallDb) = Call(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Call(id, graph) -// } - -// def apply(wrapped: CallDb) = new EdgeRef(wrapped) with Call -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CallDb](id, Call.Label, graph) with Call -// } -// trait Call extends EdgeRef[CallDb] -// class CallDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Call.Label, _inVertex, Call.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Call.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object CallArg { -// val Label = "CALL_ARG" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CallArgDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CallArgDb] { -// override val forLabel = CallArg.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CallArgDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CallArgDb) = CallArg(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// CallArg(id, graph) -// } - -// def apply(wrapped: CallArgDb) = new EdgeRef(wrapped) with CallArg -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CallArgDb](id, CallArg.Label, graph) with CallArg -// } -// trait CallArg extends EdgeRef[CallArgDb] -// class CallArgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallArg.Label, _inVertex, CallArg.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// CallArg.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object CallArgOut { -// val Label = "CALL_ARG_OUT" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CallArgOutDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CallArgOutDb] { -// override val forLabel = CallArgOut.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CallArgOutDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CallArgOutDb) = CallArgOut(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// CallArgOut(id, graph) -// } - -// def apply(wrapped: CallArgOutDb) = new EdgeRef(wrapped) with CallArgOut -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CallArgOutDb](id, CallArgOut.Label, graph) with CallArgOut -// } -// trait CallArgOut extends EdgeRef[CallArgOutDb] -// class CallArgOutDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallArgOut.Label, _inVertex, CallArgOut.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// CallArgOut.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object CallRet { -// val Label = "CALL_RET" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CallRetDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CallRetDb] { -// override val forLabel = CallRet.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CallRetDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CallRetDb) = CallRet(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// CallRet(id, graph) -// } - -// def apply(wrapped: CallRetDb) = new EdgeRef(wrapped) with CallRet -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CallRetDb](id, CallRet.Label, graph) with CallRet -// } -// trait CallRet extends EdgeRef[CallRetDb] -// class CallRetDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CallRet.Label, _inVertex, CallRet.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// CallRet.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Capture { -// val Label = "CAPTURE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CaptureDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CaptureDb] { -// override val forLabel = Capture.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CaptureDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CaptureDb) = Capture(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Capture(id, graph) -// } - -// def apply(wrapped: CaptureDb) = new EdgeRef(wrapped) with Capture -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CaptureDb](id, Capture.Label, graph) with Capture -// } -// trait Capture extends EdgeRef[CaptureDb] -// class CaptureDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Capture.Label, _inVertex, Capture.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Capture.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object CapturedBy { -// val Label = "CAPTURED_BY" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CapturedByDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CapturedByDb] { -// override val forLabel = CapturedBy.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CapturedByDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CapturedByDb) = CapturedBy(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// CapturedBy(id, graph) -// } - -// def apply(wrapped: CapturedByDb) = new EdgeRef(wrapped) with CapturedBy -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CapturedByDb](id, CapturedBy.Label, graph) with CapturedBy -// } -// trait CapturedBy extends EdgeRef[CapturedByDb] -// class CapturedByDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, CapturedBy.Label, _inVertex, CapturedBy.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// CapturedBy.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Cdg { -// val Label = "CDG" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CdgDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CdgDb] { -// override val forLabel = Cdg.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CdgDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CdgDb) = Cdg(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Cdg(id, graph) -// } - -// def apply(wrapped: CdgDb) = new EdgeRef(wrapped) with Cdg -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CdgDb](id, Cdg.Label, graph) with Cdg -// } -// trait Cdg extends EdgeRef[CdgDb] -// class CdgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Cdg.Label, _inVertex, Cdg.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Cdg.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Cfg { -// val Label = "CFG" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, CfgDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[CfgDb] { -// override val forLabel = Cfg.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new CfgDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: CfgDb) = Cfg(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Cfg(id, graph) -// } - -// def apply(wrapped: CfgDb) = new EdgeRef(wrapped) with Cfg -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[CfgDb](id, Cfg.Label, graph) with Cfg -// } -// trait Cfg extends EdgeRef[CfgDb] -// class CfgDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Cfg.Label, _inVertex, Cfg.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Cfg.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Contains { -// val Label = "CONTAINS" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, ContainsDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[ContainsDb] { -// override val forLabel = Contains.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new ContainsDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: ContainsDb) = Contains(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Contains(id, graph) -// } - -// def apply(wrapped: ContainsDb) = new EdgeRef(wrapped) with Contains -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[ContainsDb](id, Contains.Label, graph) with Contains -// } -// trait Contains extends EdgeRef[ContainsDb] -// class ContainsDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Contains.Label, _inVertex, Contains.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Contains.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Dominate { -// val Label = "DOMINATE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, DominateDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[DominateDb] { -// override val forLabel = Dominate.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new DominateDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: DominateDb) = Dominate(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Dominate(id, graph) -// } - -// def apply(wrapped: DominateDb) = new EdgeRef(wrapped) with Dominate -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[DominateDb](id, Dominate.Label, graph) with Dominate -// } -// trait Dominate extends EdgeRef[DominateDb] -// class DominateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Dominate.Label, _inVertex, Dominate.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Dominate.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object EvalType { -// val Label = "EVAL_TYPE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, EvalTypeDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[EvalTypeDb] { -// override val forLabel = EvalType.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new EvalTypeDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: EvalTypeDb) = EvalType(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// EvalType(id, graph) -// } - -// def apply(wrapped: EvalTypeDb) = new EdgeRef(wrapped) with EvalType -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[EvalTypeDb](id, EvalType.Label, graph) with EvalType -// } -// trait EvalType extends EdgeRef[EvalTypeDb] -// class EvalTypeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, EvalType.Label, _inVertex, EvalType.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// EvalType.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object InheritsFrom { -// val Label = "INHERITS_FROM" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, InheritsFromDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[InheritsFromDb] { -// override val forLabel = InheritsFrom.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new InheritsFromDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: InheritsFromDb) = InheritsFrom(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// InheritsFrom(id, graph) -// } - -// def apply(wrapped: InheritsFromDb) = new EdgeRef(wrapped) with InheritsFrom -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[InheritsFromDb](id, InheritsFrom.Label, graph) with InheritsFrom -// } -// trait InheritsFrom extends EdgeRef[InheritsFromDb] -// class InheritsFromDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, InheritsFrom.Label, _inVertex, InheritsFrom.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// InheritsFrom.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object IsSensitiveDataDescrOf { -// val Label = "IS_SENSITIVE_DATA_DESCR_OF" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, IsSensitiveDataDescrOfDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataDescrOfDb] { -// override val forLabel = IsSensitiveDataDescrOf.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new IsSensitiveDataDescrOfDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: IsSensitiveDataDescrOfDb) = IsSensitiveDataDescrOf(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// IsSensitiveDataDescrOf(id, graph) -// } - -// def apply(wrapped: IsSensitiveDataDescrOfDb) = new EdgeRef(wrapped) with IsSensitiveDataDescrOf -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[IsSensitiveDataDescrOfDb](id, IsSensitiveDataDescrOf.Label, graph) with IsSensitiveDataDescrOf -// } -// trait IsSensitiveDataDescrOf extends EdgeRef[IsSensitiveDataDescrOfDb] -// class IsSensitiveDataDescrOfDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataDescrOf.Label, _inVertex, IsSensitiveDataDescrOf.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// IsSensitiveDataDescrOf.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object IsSensitiveDataDescrOfRef { -// val Label = "IS_SENSITIVE_DATA_DESCR_OF_REF" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, IsSensitiveDataDescrOfRefDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataDescrOfRefDb] { -// override val forLabel = IsSensitiveDataDescrOfRef.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new IsSensitiveDataDescrOfRefDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: IsSensitiveDataDescrOfRefDb) = IsSensitiveDataDescrOfRef(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// IsSensitiveDataDescrOfRef(id, graph) -// } - -// def apply(wrapped: IsSensitiveDataDescrOfRefDb) = new EdgeRef(wrapped) with IsSensitiveDataDescrOfRef -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[IsSensitiveDataDescrOfRefDb](id, IsSensitiveDataDescrOfRef.Label, graph) with IsSensitiveDataDescrOfRef -// } -// trait IsSensitiveDataDescrOfRef extends EdgeRef[IsSensitiveDataDescrOfRefDb] -// class IsSensitiveDataDescrOfRefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataDescrOfRef.Label, _inVertex, IsSensitiveDataDescrOfRef.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// IsSensitiveDataDescrOfRef.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object IsSensitiveDataOfType { -// val Label = "IS_SENSITIVE_DATA_OF_TYPE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, IsSensitiveDataOfTypeDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[IsSensitiveDataOfTypeDb] { -// override val forLabel = IsSensitiveDataOfType.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new IsSensitiveDataOfTypeDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: IsSensitiveDataOfTypeDb) = IsSensitiveDataOfType(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// IsSensitiveDataOfType(id, graph) -// } - -// def apply(wrapped: IsSensitiveDataOfTypeDb) = new EdgeRef(wrapped) with IsSensitiveDataOfType -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[IsSensitiveDataOfTypeDb](id, IsSensitiveDataOfType.Label, graph) with IsSensitiveDataOfType -// } -// trait IsSensitiveDataOfType extends EdgeRef[IsSensitiveDataOfTypeDb] -// class IsSensitiveDataOfTypeDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, IsSensitiveDataOfType.Label, _inVertex, IsSensitiveDataOfType.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// IsSensitiveDataOfType.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object ParameterLink { -// val Label = "PARAMETER_LINK" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, ParameterLinkDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[ParameterLinkDb] { -// override val forLabel = ParameterLink.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new ParameterLinkDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: ParameterLinkDb) = ParameterLink(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// ParameterLink(id, graph) -// } - -// def apply(wrapped: ParameterLinkDb) = new EdgeRef(wrapped) with ParameterLink -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[ParameterLinkDb](id, ParameterLink.Label, graph) with ParameterLink -// } -// trait ParameterLink extends EdgeRef[ParameterLinkDb] -// class ParameterLinkDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ParameterLink.Label, _inVertex, ParameterLink.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// ParameterLink.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object PostDominate { -// val Label = "POST_DOMINATE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, PostDominateDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[PostDominateDb] { -// override val forLabel = PostDominate.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new PostDominateDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: PostDominateDb) = PostDominate(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// PostDominate(id, graph) -// } - -// def apply(wrapped: PostDominateDb) = new EdgeRef(wrapped) with PostDominate -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[PostDominateDb](id, PostDominate.Label, graph) with PostDominate -// } -// trait PostDominate extends EdgeRef[PostDominateDb] -// class PostDominateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, PostDominate.Label, _inVertex, PostDominate.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// PostDominate.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Propagate { -// val Label = "PROPAGATE" -// object Keys { -// val All: JSet[String] = Set("ALIAS").asJava -// val KeyToValue: Map[String, PropagateDb => Any] = Map( -// "ALIAS" -> { instance: PropagateDb => instance.alias()} -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[PropagateDb] { -// override val forLabel = Propagate.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new PropagateDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: PropagateDb) = Propagate(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Propagate(id, graph) -// } - -// def apply(wrapped: PropagateDb) = new EdgeRef(wrapped) with Propagate -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[PropagateDb](id, Propagate.Label, graph) with Propagate -// } -// trait Propagate extends EdgeRef[PropagateDb] -// class PropagateDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Propagate.Label, _inVertex, Propagate.Keys.All) { - -// private var _alias: JBoolean = null -// def alias(): JBoolean = _alias -// override protected def specificProperty[A](key: String): Property[A] = -// Propagate.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// if (key == "ALIAS") this._alias = value.asInstanceOf[JBoolean] -// else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// if (key == "ALIAS") this._alias = null -// else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object ReachingDef { -// val Label = "REACHING_DEF" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, ReachingDefDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[ReachingDefDb] { -// override val forLabel = ReachingDef.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new ReachingDefDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: ReachingDefDb) = ReachingDef(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// ReachingDef(id, graph) -// } - -// def apply(wrapped: ReachingDefDb) = new EdgeRef(wrapped) with ReachingDef -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[ReachingDefDb](id, ReachingDef.Label, graph) with ReachingDef -// } -// trait ReachingDef extends EdgeRef[ReachingDefDb] -// class ReachingDefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ReachingDef.Label, _inVertex, ReachingDef.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// ReachingDef.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Receiver { -// val Label = "RECEIVER" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, ReceiverDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[ReceiverDb] { -// override val forLabel = Receiver.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new ReceiverDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: ReceiverDb) = Receiver(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Receiver(id, graph) -// } - -// def apply(wrapped: ReceiverDb) = new EdgeRef(wrapped) with Receiver -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[ReceiverDb](id, Receiver.Label, graph) with Receiver -// } -// trait Receiver extends EdgeRef[ReceiverDb] -// class ReceiverDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Receiver.Label, _inVertex, Receiver.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Receiver.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Ref { -// val Label = "REF" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, RefDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[RefDb] { -// override val forLabel = Ref.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new RefDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: RefDb) = Ref(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Ref(id, graph) -// } - -// def apply(wrapped: RefDb) = new EdgeRef(wrapped) with Ref -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[RefDb](id, Ref.Label, graph) with Ref -// } -// trait Ref extends EdgeRef[RefDb] -// class RefDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Ref.Label, _inVertex, Ref.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Ref.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object ResolvedTo { -// val Label = "RESOLVED_TO" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, ResolvedToDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[ResolvedToDb] { -// override val forLabel = ResolvedTo.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new ResolvedToDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: ResolvedToDb) = ResolvedTo(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// ResolvedTo(id, graph) -// } - -// def apply(wrapped: ResolvedToDb) = new EdgeRef(wrapped) with ResolvedTo -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[ResolvedToDb](id, ResolvedTo.Label, graph) with ResolvedTo -// } -// trait ResolvedTo extends EdgeRef[ResolvedToDb] -// class ResolvedToDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, ResolvedTo.Label, _inVertex, ResolvedTo.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// ResolvedTo.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object TaggedBy { -// val Label = "TAGGED_BY" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, TaggedByDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[TaggedByDb] { -// override val forLabel = TaggedBy.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new TaggedByDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: TaggedByDb) = TaggedBy(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// TaggedBy(id, graph) -// } - -// def apply(wrapped: TaggedByDb) = new EdgeRef(wrapped) with TaggedBy -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[TaggedByDb](id, TaggedBy.Label, graph) with TaggedBy -// } -// trait TaggedBy extends EdgeRef[TaggedByDb] -// class TaggedByDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, TaggedBy.Label, _inVertex, TaggedBy.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// TaggedBy.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object TaintRemove { -// val Label = "TAINT_REMOVE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, TaintRemoveDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[TaintRemoveDb] { -// override val forLabel = TaintRemove.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new TaintRemoveDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: TaintRemoveDb) = TaintRemove(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// TaintRemove(id, graph) -// } - -// def apply(wrapped: TaintRemoveDb) = new EdgeRef(wrapped) with TaintRemove -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[TaintRemoveDb](id, TaintRemove.Label, graph) with TaintRemove -// } -// trait TaintRemove extends EdgeRef[TaintRemoveDb] -// class TaintRemoveDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, TaintRemove.Label, _inVertex, TaintRemove.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// TaintRemove.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - - -// object Vtable { -// val Label = "VTABLE" -// object Keys { -// val All: JSet[String] = Set().asJava -// val KeyToValue: Map[String, VtableDb => Any] = Map( - -// ) -// } - -// val Factory = new SpecializedElementFactory.ForEdge[VtableDb] { -// override val forLabel = Vtable.Label - -// override def createEdge(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// new VtableDb(graph, id, outVertex, inVertex) - -// override def createEdgeRef(edge: VtableDb) = Vtable(edge) - -// override def createEdgeRef(id: JLong, graph: TinkerGraph, outVertex: VertexRef[_ <: TinkerVertex], inVertex: VertexRef[_ <: TinkerVertex]) = -// Vtable(id, graph) -// } - -// def apply(wrapped: VtableDb) = new EdgeRef(wrapped) with Vtable -// def apply(id: Long, graph: TinkerGraph) = -// new EdgeRef[VtableDb](id, Vtable.Label, graph) with Vtable -// } -// trait Vtable extends EdgeRef[VtableDb] -// class VtableDb(private val _graph: TinkerGraph, private val _id: Long, private val _outVertex: Vertex, _inVertex: Vertex) -// extends SpecializedTinkerEdge(_graph, _id, _outVertex, Vtable.Label, _inVertex, Vtable.Keys.All) { - - -// override protected def specificProperty[A](key: String): Property[A] = -// Vtable.Keys.KeyToValue.get(key) match { -// case None => Property.empty[A] -// case Some(fieldAccess) => -// fieldAccess(this) match { -// case null | None => Property.empty[A] -// case Some(value) => new TinkerProperty(this, key, value.asInstanceOf[A]) -// case value => new TinkerProperty(this, key, value.asInstanceOf[A]) -// } -// } - -// override protected def updateSpecificProperty[A](key: String, value: A): Property[A] = { -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// property(key) -// } - -// override protected def removeSpecificProperty(key: String): Unit = -// throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") -// } - diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala deleted file mode 100644 index dc0a5b362..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NewNodes.scala +++ /dev/null @@ -1,1010 +0,0 @@ - - package io.shiftleft.codepropertygraph.generated.nodes - - import java.lang.{Boolean => JBoolean, Long => JLong} - import java.util.{Map => JMap, Set => JSet} - - /** base type for all nodes that can be added to a graph, e.g. the diffgraph */ - trait NewNode extends Node { - def label: String - def properties: Map[String, Any] - def containedNodesByLocalName: Map[String, List[Node]] - def allContainedNodes: List[Node] = containedNodesByLocalName.values.flatten.toList - } - - -// case class NewAnnotation(code: String ="" , name: String ="" , fullName: String ="" ) extends NewNode with AnnotationBase { -// override val label = "ANNOTATION" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("FULL_NAME" -> fullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewAnnotationLiteral(code: String ="" , name: String ="" , order: Integer = -1) extends NewNode with AnnotationLiteralBase { -// override val label = "ANNOTATION_LITERAL" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("ORDER" -> order )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewAnnotationParameter(code: String ="" ) extends NewNode with AnnotationParameterBase { -// override val label = "ANNOTATION_PARAMETER" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewAnnotationParameterAssign(code: String ="" ) extends NewNode with AnnotationParameterAssignBase { -// override val label = "ANNOTATION_PARAMETER_ASSIGN" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewArrayInitializer(code: String ="" ) extends NewNode with ArrayInitializerBase { -// override val label = "ARRAY_INITIALIZER" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewBlock(code: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with BlockBase { -// override val label = "BLOCK" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewCall(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, dispatchType: String ="" , signature: String ="" , typeFullName: String ="" , methodInstFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, resolved: Option[JBoolean] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with CallBase { -// override val label = "CALL" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("DISPATCH_TYPE" -> dispatchType ), -// ("SIGNATURE" -> signature ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("METHOD_INST_FULL_NAME" -> methodInstFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("RESOLVED" -> resolved ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewCallChain(val methods: List[MethodBase] = List(), val calls: List[CallBase] = List()) extends NewNode with CallChainBase { -// override val label = "CALL_CHAIN" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("methods" -> methods) + ("calls" -> calls) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewCallSite(val method: MethodBase , val call: CallBase , val callerMethod: MethodBase ) extends NewNode with CallSiteBase { -// override val label = "CALL_SITE" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("method" -> (method :: Nil)) + ("call" -> (call :: Nil)) + ("callerMethod" -> (callerMethod :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewClosureBinding(closureBindingId: Option[String] = None, evaluationStrategy: String ="" , closureOriginalName: Option[String] = None) extends NewNode with ClosureBindingBase { -// override val label = "CLOSURE_BINDING" -// override val properties: Map[String, Any] = -// Map(("CLOSURE_BINDING_ID" -> closureBindingId ), -// ("EVALUATION_STRATEGY" -> evaluationStrategy ), -// ("CLOSURE_ORIGINAL_NAME" -> closureOriginalName )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewComment(lineNumber: Option[Integer] = None, code: String ="" ) extends NewNode with CommentBase { -// override val label = "COMMENT" -// override val properties: Map[String, Any] = -// Map(("LINE_NUMBER" -> lineNumber ), -// ("CODE" -> code )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewConfigFile(name: String ="" , content: String ="" ) extends NewNode with ConfigFileBase { -// override val label = "CONFIG_FILE" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("CONTENT" -> content )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewDependency(version: String ="" , name: String ="" , dependencyGroupId: Option[String] = None) extends NewNode with DependencyBase { -// override val label = "DEPENDENCY" -// override val properties: Map[String, Any] = -// Map(("VERSION" -> version ), -// ("NAME" -> name ), -// ("DEPENDENCY_GROUP_ID" -> dependencyGroupId )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewDetachedTrackingPoint(val cfgNode: CfgNodeBase ) extends NewNode with DetachedTrackingPointBase { -// override val label = "DETACHED_TRACKING_POINT" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("cfgNode" -> (cfgNode :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewFile(name: String ="" ) extends NewNode with FileBase { -// override val label = "FILE" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewFinding(name: String ="" , category: String ="" , title: String ="" , description: String ="" , score: Integer = -1, link: String ="" , vulnDescr: String ="" , parameter: String ="" , methodName: String ="" , lineNo: String ="" , filename: String ="" , val ioflows: List[IoflowBase] = List(), val methods: List[MethodBase] = List()) extends NewNode with FindingBase { -// override val label = "FINDING" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("CATEGORY" -> category ), -// ("TITLE" -> title ), -// ("DESCRIPTION" -> description ), -// ("SCORE" -> score ), -// ("LINK" -> link ), -// ("VULN_DESCR" -> vulnDescr ), -// ("PARAMETER" -> parameter ), -// ("METHOD_NAME" -> methodName ), -// ("LINE_NO" -> lineNo ), -// ("FILENAME" -> filename )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("ioflows" -> ioflows) + ("methods" -> methods) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewFlow(val points: List[ProgramPointBase] = List(), val source: SourceBase , val sink: SinkBase , val transformations: List[TransformationBase] = List(), val branchPoints: List[TrackingPointBase] = List(), val cfgNodes: List[CfgNodeBase] = List()) extends NewNode with FlowBase { -// override val label = "FLOW" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("points" -> points) + ("source" -> (source :: Nil)) + ("sink" -> (sink :: Nil)) + ("transformations" -> transformations) + ("branchPoints" -> branchPoints) + ("cfgNodes" -> cfgNodes) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewFramework(name: String ="" ) extends NewNode with FrameworkBase { -// override val label = "FRAMEWORK" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewFrameworkData(name: String ="" , content: String ="" ) extends NewNode with FrameworkDataBase { -// override val label = "FRAMEWORK_DATA" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("CONTENT" -> content )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewIdentifier(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with IdentifierBase { -// override val label = "IDENTIFIER" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewIoflow(fingerprint: String ="" , literalsToSink: List[String] = List(), val dataTags: List[TagBase] = List(), val sourceDescriptorTags: List[TagBase] = List(), val sinkDescriptorTags: List[TagBase] = List(), val source: SourceBase , val sink: SinkBase , val transforms: List[TransformBase] = List(), val sourceDescriptorFlows: List[FlowBase] = List(), val sinkDescriptorFlows: List[FlowBase] = List(), val primaryFlow: FlowBase , val triggerMethods: List[MethodBase] = List()) extends NewNode with IoflowBase { -// override val label = "IOFLOW" -// override val properties: Map[String, Any] = -// Map(("FINGERPRINT" -> fingerprint ), -// ("LITERALS_TO_SINK" -> literalsToSink )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("dataTags" -> dataTags) + ("sourceDescriptorTags" -> sourceDescriptorTags) + ("sinkDescriptorTags" -> sinkDescriptorTags) + ("source" -> (source :: Nil)) + ("sink" -> (sink :: Nil)) + ("transforms" -> transforms) + ("sourceDescriptorFlows" -> sourceDescriptorFlows) + ("sinkDescriptorFlows" -> sinkDescriptorFlows) + ("primaryFlow" -> (primaryFlow :: Nil)) + ("triggerMethods" -> triggerMethods) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewLiteral(code: String ="" , name: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with LiteralBase { -// override val label = "LITERAL" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewLocal(code: String ="" , name: String ="" , closureBindingId: Option[String] = None, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with LocalBase { -// override val label = "LOCAL" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("CLOSURE_BINDING_ID" -> closureBindingId ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewLocation(symbol: String ="" , methodFullName: String ="" , methodShortName: String ="" , packageName: String ="" , lineNumber: Option[Integer] = None, className: String ="" , nodeLabel: String ="" , filename: String ="" , val node: Option[Node] = None) extends NewNode with LocationBase { -// override val label = "LOCATION" -// override val properties: Map[String, Any] = -// Map(("SYMBOL" -> symbol ), -// ("METHOD_FULL_NAME" -> methodFullName ), -// ("METHOD_SHORT_NAME" -> methodShortName ), -// ("PACKAGE_NAME" -> packageName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("CLASS_NAME" -> className ), -// ("NODE_LABEL" -> nodeLabel ), -// ("FILENAME" -> filename )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> node.toList) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMatchInfo(pattern: String ="" , category: String ="" ) extends NewNode with MatchInfoBase { -// override val label = "MATCH_INFO" -// override val properties: Map[String, Any] = -// Map(("PATTERN" -> pattern ), -// ("CATEGORY" -> category )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMember(code: String ="" , name: String ="" , typeFullName: String ="" ) extends NewNode with MemberBase { -// override val label = "MEMBER" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("NAME" -> name ), -// ("TYPE_FULL_NAME" -> typeFullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMetaData(language: String ="" , version: String ="" , spid: Option[String] = None) extends NewNode with MetaDataBase { -// override val label = "META_DATA" -// override val properties: Map[String, Any] = -// Map(("LANGUAGE" -> language ), -// ("VERSION" -> version ), -// ("SPID" -> spid )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethod(name: String ="" , fullName: String ="" , signature: String ="" , astParentType: String ="" , astParentFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, hasMapping: Option[JBoolean] = None, depthFirstOrder: Option[Integer] = None, binarySignature: Option[String] = None) extends NewNode with MethodBase { -// override val label = "METHOD" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("FULL_NAME" -> fullName ), -// ("SIGNATURE" -> signature ), -// ("AST_PARENT_TYPE" -> astParentType ), -// ("AST_PARENT_FULL_NAME" -> astParentFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("HAS_MAPPING" -> hasMapping ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder ), -// ("BINARY_SIGNATURE" -> binarySignature )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodInst(name: String ="" , fullName: String ="" , signature: String ="" , methodFullName: String ="" ) extends NewNode with MethodInstBase { -// override val label = "METHOD_INST" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("FULL_NAME" -> fullName ), -// ("SIGNATURE" -> signature ), -// ("METHOD_FULL_NAME" -> methodFullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodParameterIn(code: String ="" , order: Integer = -1, name: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with MethodParameterInBase { -// override val label = "METHOD_PARAMETER_IN" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("ORDER" -> order ), -// ("NAME" -> name ), -// ("EVALUATION_STRATEGY" -> evaluationStrategy ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodParameterOut(code: String ="" , order: Integer = -1, name: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None) extends NewNode with MethodParameterOutBase { -// override val label = "METHOD_PARAMETER_OUT" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("ORDER" -> order ), -// ("NAME" -> name ), -// ("EVALUATION_STRATEGY" -> evaluationStrategy ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodRef(code: String ="" , order: Integer = -1, argumentIndex: Integer = -1, methodInstFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with MethodRefBase { -// override val label = "METHOD_REF" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("METHOD_INST_FULL_NAME" -> methodInstFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodReturn(code: String ="" , evaluationStrategy: String ="" , typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, depthFirstOrder: Option[Integer] = None) extends NewNode with MethodReturnBase { -// override val label = "METHOD_RETURN" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("EVALUATION_STRATEGY" -> evaluationStrategy ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewMethodSummary(isStatic: JBoolean , isExternal: JBoolean , binarySignature: Option[String] = None, val method: MethodBase , val parameters: List[MethodParameterInBase] = List(), val outParameters: List[MethodParameterOutBase] = List(), val returnParameter: MethodReturnBase , val paramTypes: List[TypeBase] = List(), val returnParameterType: TypeBase , val tags: List[TagBase] = List(), val paramTags: List[TagsBase] = List(), val outParamTags: List[TagsBase] = List(), val returnParamTags: List[TagBase] = List(), val annotationParameters: List[SpAnnotationParameterBase] = List(), val modifiers: List[ModifierBase] = List(), val routes: List[RouteBase] = List()) extends NewNode with MethodSummaryBase { -// override val label = "METHOD_SUMMARY" -// override val properties: Map[String, Any] = -// Map(("IS_STATIC" -> isStatic ), -// ("IS_EXTERNAL" -> isExternal ), -// ("BINARY_SIGNATURE" -> binarySignature )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("method" -> (method :: Nil)) + ("parameters" -> parameters) + ("outParameters" -> outParameters) + ("returnParameter" -> (returnParameter :: Nil)) + ("paramTypes" -> paramTypes) + ("returnParameterType" -> (returnParameterType :: Nil)) + ("tags" -> tags) + ("paramTags" -> paramTags) + ("outParamTags" -> outParamTags) + ("returnParamTags" -> returnParamTags) + ("annotationParameters" -> annotationParameters) + ("modifiers" -> modifiers) + ("routes" -> routes) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewModifier(modifierType: String ="" ) extends NewNode with ModifierBase { -// override val label = "MODIFIER" -// override val properties: Map[String, Any] = -// Map(("MODIFIER_TYPE" -> modifierType )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewNamespace(name: String ="" ) extends NewNode with NamespaceBase { -// override val label = "NAMESPACE" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewNamespaceBlock(name: String ="" , fullName: String ="" ) extends NewNode with NamespaceBlockBase { -// override val label = "NAMESPACE_BLOCK" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("FULL_NAME" -> fullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewProgramPoint(val elem: TrackingPointBase , val method: Option[MethodBase] = None, val methodTags: List[TagBase] = List(), val paramTags: List[TagBase] = List()) extends NewNode with ProgramPointBase { -// override val label = "PROGRAM_POINT" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("elem" -> (elem :: Nil)) + ("method" -> method.toList) + ("methodTags" -> methodTags) + ("paramTags" -> paramTags) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewRead(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val source: SourceBase ) extends NewNode with ReadBase { -// override val label = "READ" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("source" -> (source :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewReturn(lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, order: Integer = -1, argumentIndex: Integer = -1, code: String ="" , sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with ReturnBase { -// override val label = "RETURN" -// override val properties: Map[String, Any] = -// Map(("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("CODE" -> code ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewRoute(path: String ="" ) extends NewNode with RouteBase { -// override val label = "ROUTE" -// override val properties: Map[String, Any] = -// Map(("PATH" -> path )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSensitiveDataType(fullName: String ="" , val names: List[MatchInfoBase] = List(), val members: List[SensitiveMemberBase] = List()) extends NewNode with SensitiveDataTypeBase { -// override val label = "SENSITIVE_DATA_TYPE" -// override val properties: Map[String, Any] = -// Map(("FULL_NAME" -> fullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) + ("members" -> members) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSensitiveMember(name: String ="" , val names: List[MatchInfoBase] = List()) extends NewNode with SensitiveMemberBase { -// override val label = "SENSITIVE_MEMBER" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSensitiveReference(val ioflows: List[IoflowBase] = List()) extends NewNode with SensitiveReferenceBase { -// override val label = "SENSITIVE_REFERENCE" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("ioflows" -> ioflows) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSensitiveVariable(name: String ="" , val names: List[MatchInfoBase] = List(), val evalType: TypeBase ) extends NewNode with SensitiveVariableBase { -// override val label = "SENSITIVE_VARIABLE" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("names" -> names) + ("evalType" -> (evalType :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSink(sinkType: String ="" , val node: TrackingPointBase , val method: MethodBase , val methodTags: List[TagBase] = List(), val callingMethod: Option[MethodBase] = None, val callsite: Option[CallBase] = None, val parameterIn: Option[MethodParameterInBase] = None, val parameterInTags: List[TagBase] = List()) extends NewNode with SinkBase { -// override val label = "SINK" -// override val properties: Map[String, Any] = -// Map(("SINK_TYPE" -> sinkType )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) + ("method" -> (method :: Nil)) + ("methodTags" -> methodTags) + ("callingMethod" -> callingMethod.toList) + ("callsite" -> callsite.toList) + ("parameterIn" -> parameterIn.toList) + ("parameterInTags" -> parameterInTags) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSource(sourceType: String ="" , val node: TrackingPointBase , val method: MethodBase , val methodTags: List[TagBase] = List(), val callingMethod: Option[MethodBase] = None, val callsite: Option[CallBase] = None, val tags: List[TagBase] = List(), val nodeType: TypeBase ) extends NewNode with SourceBase { -// override val label = "SOURCE" -// override val properties: Map[String, Any] = -// Map(("SOURCE_TYPE" -> sourceType )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) + ("method" -> (method :: Nil)) + ("methodTags" -> methodTags) + ("callingMethod" -> callingMethod.toList) + ("callsite" -> callsite.toList) + ("tags" -> tags) + ("nodeType" -> (nodeType :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSpAnnotationParameter(annotationName: String ="" , annotationFullName: String ="" , name: String ="" , value: String ="" ) extends NewNode with SpAnnotationParameterBase { -// override val label = "SP_ANNOTATION_PARAMETER" -// override val properties: Map[String, Any] = -// Map(("ANNOTATION_NAME" -> annotationName ), -// ("ANNOTATION_FULL_NAME" -> annotationFullName ), -// ("NAME" -> name ), -// ("VALUE" -> value )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewSpBlacklist(val tags: List[TagBase] = List()) extends NewNode with SpBlacklistBase { -// override val label = "SP_BLACKLIST" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tags" -> tags) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTag(name: String ="" , value: String ="" ) extends NewNode with TagBase { -// override val label = "TAG" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("VALUE" -> value )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTags(val tags: List[TagBase] = List()) extends NewNode with TagsBase { -// override val label = "TAGS" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tags" -> tags) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTagNodePair(val tag: TagBase , val node: Node ) extends NewNode with TagNodePairBase { -// override val label = "TAG_NODE_PAIR" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("tag" -> (tag :: Nil)) + ("node" -> (node :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTransform(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val call: CallBase , val sink: SinkBase ) extends NewNode with TransformBase { -// override val label = "TRANSFORM" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("call" -> (call :: Nil)) + ("sink" -> (sink :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTransformation(val node: TrackingPointBase ) extends NewNode with TransformationBase { -// override val label = "TRANSFORMATION" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("node" -> (node :: Nil)) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewType(name: String ="" , fullName: String ="" , typeDeclFullName: String ="" ) extends NewNode with TypeBase { -// override val label = "TYPE" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("FULL_NAME" -> fullName ), -// ("TYPE_DECL_FULL_NAME" -> typeDeclFullName )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTypeArgument() extends NewNode with TypeArgumentBase { -// override val label = "TYPE_ARGUMENT" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTypeDecl(name: String ="" , fullName: String ="" , isExternal: JBoolean , inheritsFromTypeFullName: List[String] = List(), astParentType: String ="" , astParentFullName: String ="" , aliasTypeFullName: Option[String] = None) extends NewNode with TypeDeclBase { -// override val label = "TYPE_DECL" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("FULL_NAME" -> fullName ), -// ("IS_EXTERNAL" -> isExternal ), -// ("INHERITS_FROM_TYPE_FULL_NAME" -> inheritsFromTypeFullName ), -// ("AST_PARENT_TYPE" -> astParentType ), -// ("AST_PARENT_FULL_NAME" -> astParentFullName ), -// ("ALIAS_TYPE_FULL_NAME" -> aliasTypeFullName )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewTypeParameter(name: String ="" , order: Integer = -1) extends NewNode with TypeParameterBase { -// override val label = "TYPE_PARAMETER" -// override val properties: Map[String, Any] = -// Map(("NAME" -> name ), -// ("ORDER" -> order )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewUnknown(code: String ="" , parserTypeName: String ="" , order: Integer = -1, argumentIndex: Integer = -1, typeFullName: String ="" , lineNumber: Option[Integer] = None, lineNumberEnd: Option[Integer] = None, columnNumber: Option[Integer] = None, columnNumberEnd: Option[Integer] = None, sccId: Integer = -1, depthFirstOrder: Option[Integer] = None) extends NewNode with UnknownBase { -// override val label = "UNKNOWN" -// override val properties: Map[String, Any] = -// Map(("CODE" -> code ), -// ("PARSER_TYPE_NAME" -> parserTypeName ), -// ("ORDER" -> order ), -// ("ARGUMENT_INDEX" -> argumentIndex ), -// ("TYPE_FULL_NAME" -> typeFullName ), -// ("LINE_NUMBER" -> lineNumber ), -// ("LINE_NUMBER_END" -> lineNumberEnd ), -// ("COLUMN_NUMBER" -> columnNumber ), -// ("COLUMN_NUMBER_END" -> columnNumberEnd ), -// ("SCC_ID" -> sccId ), -// ("DEPTH_FIRST_ORDER" -> depthFirstOrder )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewVariableInfo(varType: String ="" , evaluationType: String ="" , parameterIndex: Option[Integer] = None) extends NewNode with VariableInfoBase { -// override val label = "VARIABLE_INFO" -// override val properties: Map[String, Any] = -// Map(("VAR_TYPE" -> varType ), -// ("EVALUATION_TYPE" -> evaluationType ), -// ("PARAMETER_INDEX" -> parameterIndex )).filterNot { case (k,v) => -// v == null || v == None -// } -// .map { -// case (k, v: Option[_]) => (k,v.get) -// case other => other -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewWrite(val triggerCallChains: List[CallChainBase] = List(), val descriptorFlows: List[FlowBase] = List(), val sink: SinkBase , val flows: List[FlowBase] = List()) extends NewNode with WriteBase { -// override val label = "WRITE" -// override val properties: Map[String, Any] = Map.empty -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty + ("triggerCallChains" -> triggerCallChains) + ("descriptorFlows" -> descriptorFlows) + ("sink" -> (sink :: Nil)) + ("flows" -> flows) - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - - -// case class NewPackagePrefix(value: String ="" ) extends NewNode with PackagePrefixBase { -// override val label = "PACKAGE_PREFIX" -// override val properties: Map[String, Any] = -// Map(("VALUE" -> value )).filterNot { case (k,v) => -// v == null || v == None -// } - -// override def containedNodesByLocalName: Map[String, List[Node]] = Map.empty - -// override def accept[T](visitor: NodeVisitor[T]): T = ??? -// } - diff --git a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala b/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala deleted file mode 100644 index 08f7ab0ea..000000000 --- a/cpg1/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Nodes.scala +++ /dev/null @@ -1,381 +0,0 @@ - package io.shiftleft.codepropertygraph.generated.nodes - - import gremlin.scala._ - import io.shiftleft.codepropertygraph.generated.EdgeKeys - import java.lang.{Boolean => JBoolean, Long => JLong} - import java.util.{Collections => JCollections, HashMap => JHashMap, Iterator => JIterator, Map => JMap, Set => JSet, TreeMap} - import org.apache.tinkerpop.gremlin.structure.{Vertex, VertexProperty} - import org.apache.tinkerpop.gremlin.tinkergraph.structure.{SpecializedElementFactory, SpecializedTinkerVertex, TinkerGraph, TinkerVertexProperty, VertexRef} - import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils - import scala.collection.JavaConverters._ - - - - object Block { - implicit val marshaller: Marshallable[BlockDb] = new Marshallable[BlockDb] { - override def fromCC(cc: BlockDb): FromCC = ??? - override def toCC(element: Element): BlockDb = element.asInstanceOf[BlockDb] - } - val Label = "BLOCK" - object Keys { - val Code = "CODE" -val LineNumber = "LINE_NUMBER" - /* XXX0 new part start */ - object Indices { - val Code = 0 - val LineNumber = 1 - } - /* XXX0 new part end */ - val All: JSet[String] = Set(Code, LineNumber).asJava - val KeyToValue: Map[String, BlockDb => Any] = Map( - "CODE" -> { instance: BlockDb => instance.code}, - "LINE_NUMBER" -> { instance: BlockDb => instance.lineNumber.orNull}, - ) - } - object Edges { - val In: Set[String] = Set("CALL_ARG_OUT","RECEIVER","CDG","REACHING_DEF","CONTAINS_NODE","CONTAINS","CFG","AST","DOMINATE","POST_DOMINATE") - val Out: Set[String] = Set("AST","CFG","CALL_ARG","EVAL_TYPE","REACHING_DEF","CONTAINS_NODE") - } - - val Factory = new SpecializedElementFactory.ForVertex[BlockDb] { - override val forLabel = Block.Label - - override def createVertex(id: JLong, graph: TinkerGraph) = new BlockDb(id, graph) - override def createVertexRef(vertex: BlockDb) = Block(vertex) - override def createVertexRef(id: JLong, graph: TinkerGraph) = Block(id, graph) - - /* XXX0 new part start*/ - override def propertyNamesByIndex() = { - val ret = new JHashMap[Integer, String] - ret.put(Block.Keys.Indices.Code, Block.Keys.Code) - ret.put(Block.Keys.Indices.LineNumber, Block.Keys.LineNumber) - ret - } - override def propertyTypeByIndex() = { - val ret = new JHashMap[Integer, Class[_]] - ret.put(Block.Keys.Indices.Code, classOf[String]) - ret.put(Block.Keys.Indices.LineNumber, classOf[Integer]) - ret - } - /* XXX0 new part end*/ - } - - def apply(wrapped: BlockDb) = new VertexRef(wrapped) with Block - def apply(id: Long, graph: TinkerGraph) = - new VertexRef[BlockDb](id, Block.Label, graph) with Block - } - -trait Block extends VertexRef[BlockDb] with BlockBase with StoredNode with Expression { -override def code = get().code -override def lineNumber = get().lineNumber - - - // don't worry about - def columnNumber: Option[Integer] = ??? - def columnNumberEnd: Option[Integer] = ??? - def lineNumberEnd: Option[Integer] = ??? - def order: Integer = ??? - - override def accept[T](visitor: NodeVisitor[T]): T = { - visitor.visit(this) - } - override def valueMap: JMap[String, AnyRef] = get.valueMap - override def productElement(n: Int): Any = get.productElement(n) - override def productPrefix = "Block" - override def productArity = 2 + 1 // add one for id, leaving out `_graph` - override def canEqual(that: Any): Boolean = get.canEqual(that) -} - trait BlockBase extends Node with ExpressionBase with HasCode with HasLineNumber { - def asStored : StoredNode = this.asInstanceOf[StoredNode] - } - - class BlockDb(private val _id: JLong, private val _graph: TinkerGraph) - extends SpecializedTinkerVertex(_id, Block.Label, _graph) with StoredNode with Expression with BlockBase { - - override def allowedInEdgeLabels() = Block.Edges.In.asJava - override def allowedOutEdgeLabels() = Block.Edges.Out.asJava - override def specificKeys() = Block.Keys.All - - /* all properties */ - override def valueMap: JMap[String, AnyRef] = { - /* XXX0 new part start */ - // TODO optimise: load all properties in one go - val properties = new JHashMap[String, AnyRef] - properties.put("CODE", code) -lineNumber.map { value => properties.put("LINE_NUMBER", value) } - /* XXX0 new part end */ - properties -} - - private var _code: String = null - /* XXX0 new part start */ - def code(): String = { - if (_code == null) - _code = graph.readProperty(this, Block.Keys.Indices.Code, classOf[String]).asInstanceOf[String] - validateMandatoryProperty(Block.Keys.Code, _code) - _code - } - /* XXX0 new part end */ - - /* XXX0 new part start */ -private var _lineNumber: Option[Integer] = None - def lineNumber(): Option[Integer] = { - if (_lineNumber == null) - _lineNumber = Option(graph.readProperty(this, Block.Keys.Indices.LineNumber, classOf[Integer]).asInstanceOf[Integer]) - _lineNumber - } - /* XXX0 new part end */ - - /* XXX0 new part start */ - override def propertiesByStorageIdx = { - val properties = new TreeMap[Integer, Object] - // TODO optimise: load all properties in one go - properties.put(Block.Keys.Indices.Code, code); - lineNumber.map { value => properties.put(Block.Keys.Indices.LineNumber, value) } - properties - } - /* XXX0 new part end */ - - - override def canEqual(that: Any): Boolean = that != null && that.isInstanceOf[BlockDb] - override def productElement(n: Int): Any = - n match { - case 0 => _id - case 1 => code() -case 2 => lineNumber() - } - - override def productPrefix = "Block" - override def productArity = 2 + 1 // add one for id, leaving out `_graph` - - /* performance optimisation to save instantiating an iterator for each property lookup */ - override protected def specificProperty[A](key: String): VertexProperty[A] = { - Block.Keys.KeyToValue.get(key) match { - case None => VertexProperty.empty[A] - case Some(fieldAccess) => - fieldAccess(this) match { - case null | None => VertexProperty.empty[A] - case values: List[_] => throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(key) - case Some(value) => new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A]) - case value => new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A]) - } - } - } - - override protected def specificProperties[A](key: String): JIterator[VertexProperty[A]] = { - Block.Keys.KeyToValue.get(key) match { - case None => JCollections.emptyIterator[VertexProperty[A]] - case Some(fieldAccess) => - fieldAccess(this) match { - case null => JCollections.emptyIterator[VertexProperty[A]] - case values: List[_] => - values.map { value => - new TinkerVertexProperty(-1, this, key, value).asInstanceOf[VertexProperty[A]] - }.toIterator.asJava - case value => IteratorUtils.of(new TinkerVertexProperty(-1, this, key, value.asInstanceOf[A])) - } - } - } - - override protected def updateSpecificProperty[A](cardinality: VertexProperty.Cardinality, key: String, value: A): VertexProperty[A] = { - if (key == "CODE") this._code = value.asInstanceOf[String] - else if (key == "LINE_NUMBER") this._lineNumber = Option(value).asInstanceOf[Option[Integer]] - else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") - new TinkerVertexProperty(-1, this, key, value) - } - - override protected def removeSpecificProperty(key: String): Unit = - if (key == "CODE") this._code = null - else if (key == "LINE_NUMBER") this._lineNumber = null - else throw new RuntimeException("property with key=" + key + " not (yet) supported by " + this.getClass.getName + ". You may want to add it to cpg.json") - - // don't worry about - def columnNumber: Option[Integer] = ??? - def columnNumberEnd: Option[Integer] = ??? - def lineNumberEnd: Option[Integer] = ??? - def order: Integer = ??? - } - - trait Node extends Product { - def accept[T](visitor: NodeVisitor[T]): T = ??? - } - - /* making use of the fact that SpecializedVertex is also our domain node */ - trait StoredNode extends Vertex with Node { - /* underlying vertex in the graph database. - * since this is a StoredNode, this is always set */ - def underlying: Vertex = this - - // This is required for accessing the id from java code which only has a reference to StoredNode at hand. - // Java does not seem to be capable of calling methods from java classes if a scala trait is in the inheritance - // chain. - def getId: JLong = underlying.id.asInstanceOf[JLong] - - /* all properties plus label and id */ - def toMap: Map[String, Any] = { - val map = valueMap - map.put("_label", label) - map.put("_id", getId) - map.asScala.toMap - } - - /* all properties */ - def valueMap: JMap[String, AnyRef] - } - - trait NodeVisitor[T] { -// def visit(node: Annotation): T = ??? -// def visit(node: AnnotationLiteral): T = ??? -// def visit(node: AnnotationParameter): T = ??? -// def visit(node: AnnotationParameterAssign): T = ??? -// def visit(node: ArrayInitializer): T = ??? -def visit(node: Block): T = ??? -// def visit(node: Call): T = ??? -// def visit(node: CallChain): T = ??? -// def visit(node: CallSite): T = ??? -// def visit(node: ClosureBinding): T = ??? -// def visit(node: Comment): T = ??? -// def visit(node: ConfigFile): T = ??? -// def visit(node: Dependency): T = ??? -// def visit(node: DetachedTrackingPoint): T = ??? -// def visit(node: File): T = ??? -// def visit(node: Finding): T = ??? -// def visit(node: Flow): T = ??? -// def visit(node: Framework): T = ??? -// def visit(node: FrameworkData): T = ??? -// def visit(node: Identifier): T = ??? -// def visit(node: Ioflow): T = ??? -// def visit(node: Literal): T = ??? -// def visit(node: Local): T = ??? -// def visit(node: Location): T = ??? -// def visit(node: MatchInfo): T = ??? -// def visit(node: Member): T = ??? -// def visit(node: MetaData): T = ??? -// def visit(node: Method): T = ??? -// def visit(node: MethodInst): T = ??? -// def visit(node: MethodParameterIn): T = ??? -// def visit(node: MethodParameterOut): T = ??? -// def visit(node: MethodRef): T = ??? -// def visit(node: MethodReturn): T = ??? -// def visit(node: MethodSummary): T = ??? -// def visit(node: Modifier): T = ??? -// def visit(node: Namespace): T = ??? -// def visit(node: NamespaceBlock): T = ??? -// def visit(node: ProgramPoint): T = ??? -// def visit(node: Read): T = ??? -// def visit(node: Return): T = ??? -// def visit(node: Route): T = ??? -// def visit(node: SensitiveDataType): T = ??? -// def visit(node: SensitiveMember): T = ??? -// def visit(node: SensitiveReference): T = ??? -// def visit(node: SensitiveVariable): T = ??? -// def visit(node: Sink): T = ??? -// def visit(node: Source): T = ??? -// def visit(node: SpAnnotationParameter): T = ??? -// def visit(node: SpBlacklist): T = ??? -// def visit(node: Tag): T = ??? -// def visit(node: Tags): T = ??? -// def visit(node: TagNodePair): T = ??? -// def visit(node: Transform): T = ??? -// def visit(node: Transformation): T = ??? -// def visit(node: Type): T = ??? -// def visit(node: TypeArgument): T = ??? -// def visit(node: TypeDecl): T = ??? -// def visit(node: TypeParameter): T = ??? -// def visit(node: Unknown): T = ??? -// def visit(node: VariableInfo): T = ??? -// def visit(node: Write): T = ??? -// def visit(node: PackagePrefix): T = ??? -// def visit(node: Declaration): T = ??? -// def visit(node: Expression): T = ??? -// def visit(node: LocalLike): T = ??? -// def visit(node: CfgNode): T = ??? -// def visit(node: TrackingPoint): T = ??? -// def visit(node: WithinMethod): T = ??? - } -trait DeclarationBase extends Node with HasName - trait Declaration extends StoredNode with DeclarationBase - -trait ExpressionBase extends Node with HasCode with HasOrder with TrackingPointBase with CfgNodeBase - trait Expression extends StoredNode with ExpressionBase with TrackingPoint with CfgNode - -trait LocalLikeBase extends Node with HasName - trait LocalLike extends StoredNode with LocalLikeBase - -trait CfgNodeBase extends Node with HasLineNumber with HasLineNumberEnd with HasColumnNumber with HasColumnNumberEnd with WithinMethodBase - trait CfgNode extends StoredNode with CfgNodeBase with WithinMethod - -trait TrackingPointBase extends Node with WithinMethodBase - trait TrackingPoint extends StoredNode with TrackingPointBase with WithinMethod - -trait WithinMethodBase extends Node - trait WithinMethod extends StoredNode with WithinMethodBase - trait HasAliasTypeFullName { def aliasTypeFullName: Option[String] } -trait HasAnnotationFullName { def annotationFullName: String } -trait HasAnnotationName { def annotationName: String } -trait HasArgumentIndex { def argumentIndex: Integer } -trait HasAstParentFullName { def astParentFullName: String } -trait HasAstParentType { def astParentType: String } -trait HasBinarySignature { def binarySignature: Option[String] } -trait HasCategory { def category: String } -trait HasClassName { def className: String } -trait HasClosureBindingId { def closureBindingId: Option[String] } -trait HasClosureOriginalName { def closureOriginalName: Option[String] } -trait HasCode { def code: String } -trait HasColumnNumber { def columnNumber: Option[Integer] } -trait HasColumnNumberEnd { def columnNumberEnd: Option[Integer] } -trait HasContent { def content: String } -trait HasDependencyGroupId { def dependencyGroupId: Option[String] } -trait HasDepthFirstOrder { def depthFirstOrder: Option[Integer] } -trait HasDescription { def description: String } -trait HasDispatchType { def dispatchType: String } -trait HasEvaluationStrategy { def evaluationStrategy: String } -trait HasEvaluationType { def evaluationType: String } -trait HasFilename { def filename: String } -trait HasFingerprint { def fingerprint: String } -trait HasFullName { def fullName: String } -trait HasHasMapping { def hasMapping: Option[JBoolean] } -trait HasInheritsFromTypeFullName { def inheritsFromTypeFullName: List[String] } -trait HasIsExternal { def isExternal: JBoolean } -trait HasIsStatic { def isStatic: JBoolean } -trait HasLanguage { def language: String } -trait HasLineNo { def lineNo: String } -trait HasLineNumber { def lineNumber: Option[Integer] } -trait HasLineNumberEnd { def lineNumberEnd: Option[Integer] } -trait HasLink { def link: String } -trait HasLiteralsToSink { def literalsToSink: List[String] } -trait HasMethodFullName { def methodFullName: String } -trait HasMethodInstFullName { def methodInstFullName: String } -trait HasMethodName { def methodName: String } -trait HasMethodShortName { def methodShortName: String } -trait HasModifierType { def modifierType: String } -trait HasName { def name: String } -trait HasNodeId { def nodeId: String } -trait HasNodeLabel { def nodeLabel: String } -trait HasOrder { def order: Integer } -trait HasPackageName { def packageName: String } -trait HasParameter { def parameter: String } -trait HasParameterIndex { def parameterIndex: Option[Integer] } -trait HasParserTypeName { def parserTypeName: String } -trait HasPath { def path: String } -trait HasPattern { def pattern: String } -trait HasResolved { def resolved: Option[JBoolean] } -trait HasSccId { def sccId: Integer } -trait HasScore { def score: Integer } -trait HasSignature { def signature: String } -trait HasSinkType { def sinkType: String } -trait HasSourceType { def sourceType: String } -trait HasSpid { def spid: Option[String] } -trait HasSymbol { def symbol: String } -trait HasTitle { def title: String } -trait HasTypeDeclFullName { def typeDeclFullName: String } -trait HasTypeFullName { def typeFullName: String } -trait HasValue { def value: String } -trait HasVarType { def varType: String } -trait HasVersion { def version: String } -trait HasVulnDescr { def vulnDescr: String } - -// object Factories { -// lazy val All: List[SpecializedElementFactory.ForVertex[_]] = List(Annotation.Factory, AnnotationLiteral.Factory, AnnotationParameter.Factory, AnnotationParameterAssign.Factory, ArrayInitializer.Factory, Block.Factory, Call.Factory, CallChain.Factory, CallSite.Factory, ClosureBinding.Factory, Comment.Factory, ConfigFile.Factory, Dependency.Factory, DetachedTrackingPoint.Factory, File.Factory, Finding.Factory, Flow.Factory, Framework.Factory, FrameworkData.Factory, Identifier.Factory, Ioflow.Factory, Literal.Factory, Local.Factory, Location.Factory, MatchInfo.Factory, Member.Factory, MetaData.Factory, Method.Factory, MethodInst.Factory, MethodParameterIn.Factory, MethodParameterOut.Factory, MethodRef.Factory, MethodReturn.Factory, MethodSummary.Factory, Modifier.Factory, Namespace.Factory, NamespaceBlock.Factory, ProgramPoint.Factory, Read.Factory, Return.Factory, Route.Factory, SensitiveDataType.Factory, SensitiveMember.Factory, SensitiveReference.Factory, SensitiveVariable.Factory, Sink.Factory, Source.Factory, SpAnnotationParameter.Factory, SpBlacklist.Factory, Tag.Factory, Tags.Factory, TagNodePair.Factory, Transform.Factory, Transformation.Factory, Type.Factory, TypeArgument.Factory, TypeDecl.Factory, TypeParameter.Factory, Unknown.Factory, VariableInfo.Factory, Write.Factory, PackagePrefix.Factory) -// lazy val AllAsJava: java.util.List[SpecializedElementFactory.ForVertex[_]] = All.asJava -// } From 70552571dd22b2988f5f495537d8e06a207dd3e3 Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Sun, 7 Jul 2019 07:03:52 +1200 Subject: [PATCH 3/4] adapt cpg2overflowdb --- .../cpgloading/ProtoEdgeSerializer.java | 21 ++++++++++++--- .../cpgloading/ProtoNodeSerializer.java | 21 ++++++++++++--- .../cpgloading/ProtoToOverflowDb.scala | 27 ++++++++++++++++--- 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoEdgeSerializer.java b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoEdgeSerializer.java index a97901108..5faa051d1 100644 --- a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoEdgeSerializer.java +++ b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoEdgeSerializer.java @@ -9,10 +9,20 @@ import org.apache.tinkerpop.gremlin.tinkergraph.storage.Serializer; import java.util.Map; -import java.util.concurrent.atomic.AtomicLong; +import java.util.SortedMap; +import java.util.TreeMap; public class ProtoEdgeSerializer extends Serializer { + /* TODO move definition of property indices to json schema + * (or - better - ensure it's always in the same order when generating the cpg.proto and + * use the index there) */ + final Map> propertyIndexByEdgeAndPropertyName; + + public ProtoEdgeSerializer(Map> propertyIndexByEdgeAndPropertyName) { + this.propertyIndexByEdgeAndPropertyName = propertyIndexByEdgeAndPropertyName; + } + @Override protected long getId(ProtoEdgeWithId edgeWithId) { return edgeWithId.id; @@ -24,10 +34,13 @@ protected String getLabel(ProtoEdgeWithId edgeWithId) { } @Override - protected Map getProperties(ProtoEdgeWithId edgeWithId) { - final Map propertyMap = new THashMap<>(edgeWithId.edge.getPropertyCount()); + protected SortedMap getProperties(ProtoEdgeWithId edgeWithId) { + final SortedMap propertyMap = new TreeMap<>(); + final String edgeType = edgeWithId.edge.getType().name(); + final Map propertyIndexByName = propertyIndexByEdgeAndPropertyName.get(edgeType); + for (Cpg.CpgStruct.Edge.Property property : edgeWithId.edge.getPropertyList()) { - final String key = property.getName().name(); + final Integer key = propertyIndexByName.get(property.getName().name()); final Cpg.PropertyValue propertyValue = property.getValue(); switch(propertyValue.getValueCase()) { case INT_VALUE: diff --git a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoNodeSerializer.java b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoNodeSerializer.java index b9718ce03..7a79ac14a 100644 --- a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoNodeSerializer.java +++ b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoNodeSerializer.java @@ -10,14 +10,24 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; public class ProtoNodeSerializer extends Serializer { + /* TODO move definition of property indices to json schema + * (or - better - ensure it's always in the same order when generating the cpg.proto and + * use the index there) */ + final Map> propertyIndexByEdgeAndPropertyName; + //NodeId -> EdgeLabel -> EdgeId private final Map> inEdgesByNodeId; private final Map> outEdgesByNodeId; - public ProtoNodeSerializer(Map> inEdgesByNodeId, Map> outEdgesByNodeId) { + public ProtoNodeSerializer(Map> propertyIndexByEdgeAndPropertyName, + Map> inEdgesByNodeId, + Map> outEdgesByNodeId) { + this.propertyIndexByEdgeAndPropertyName = propertyIndexByEdgeAndPropertyName; this.inEdgesByNodeId = inEdgesByNodeId; this.outEdgesByNodeId = outEdgesByNodeId; } @@ -33,10 +43,13 @@ protected String getLabel(Cpg.CpgStruct.Node node) { } @Override - protected Map getProperties(Cpg.CpgStruct.Node node) { - final Map propertyMap = new THashMap<>(node.getPropertyCount()); + protected SortedMap getProperties(Cpg.CpgStruct.Node node) { + final SortedMap propertyMap = new TreeMap<>(); + final String nodeType = node.getType().name(); + final Map propertyIndexByName = propertyIndexByEdgeAndPropertyName.get(nodeType); + for (Cpg.CpgStruct.Node.Property property : node.getPropertyList()) { - final String key = property.getName().name(); + final Integer key = propertyIndexByName.get(property.getName().name()); final Cpg.PropertyValue propertyValue = property.getValue(); switch (propertyValue.getValueCase()) { case INT_VALUE: diff --git a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoToOverflowDb.scala b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoToOverflowDb.scala index a58e0b2a3..061e8d537 100644 --- a/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoToOverflowDb.scala +++ b/cpg2overflowdb/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/ProtoToOverflowDb.scala @@ -1,12 +1,13 @@ package io.shiftleft.codepropertygraph.cpgloading -import java.io.{File, FileInputStream} +import java.io.File import java.nio.file.{Files, Path} import java.util.{HashMap => JHashMap, Map => JMap} import gnu.trove.set.TLongSet import gnu.trove.set.hash.TLongHashSet import io.shiftleft.proto.cpg.Cpg.CpgStruct +import io.shiftleft.codepropertygraph.generated.{edges, nodes} import org.apache.logging.log4j.LogManager import org.apache.tinkerpop.gremlin.tinkergraph.storage.OndiskOverflow @@ -27,7 +28,20 @@ object ProtoToOverflowDb extends App { type EdgeLabel = String private lazy val logger = LogManager.getLogger(getClass) - private lazy val edgeSerializer = new ProtoEdgeSerializer + + private val edgePropertyIndexByNameAndElementName: JMap[String, JMap[String, Integer]] = + edges.Factories.All.map { factory => + (factory.forLabel, propertyIndexByName(factory.propertyNamesByIndex)) + }.toMap.asJava + + private lazy val nodePropertyIndexByNameAndElementName: JMap[String, JMap[String, Integer]] = + nodes.Factories.All.map { factory => + (factory.forLabel, propertyIndexByName(factory.propertyNamesByIndex)) + }.toMap.asJava + + private lazy val edgeSerializer = + new ProtoEdgeSerializer(edgePropertyIndexByNameAndElementName) + private lazy val nodeFilter = new NodeFilter parseConfig.map(run) @@ -71,7 +85,7 @@ object ProtoToOverflowDb extends App { overflowDb.getEdgeMVMap.put(edgeWithId.id, edgeSerializer.serialize(edgeWithId)) } - val nodeSerializer = new ProtoNodeSerializer(inEdgesByNodeId, outEdgesByNodeId) + val nodeSerializer = new ProtoNodeSerializer(nodePropertyIndexByNameAndElementName, inEdgesByNodeId, outEdgesByNodeId) cpgProto.getNodeList.asScala.par.filter(nodeFilter.filterNode).foreach { node => overflowDb.getVertexMVMap.put(node.getKey, nodeSerializer.serialize(node)) } @@ -89,6 +103,13 @@ object ProtoToOverflowDb extends App { }.parse(args, Config(cpg = null)) } + + private def propertyIndexByName( + propertyNamesByIndex: JMap[Integer, String]): JMap[String, Integer] = + propertyNamesByIndex.asScala.map { + case (idx, name) => (name, idx) + }.asJava + } case class Config(cpg: File, writeTo: Option[File] = None) \ No newline at end of file From c92fd02d263c2e1963e0cf63c1634bc9ba5fed46 Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Sun, 7 Jul 2019 21:25:18 +1200 Subject: [PATCH 4/4] scaladoc --- .../codepropertygraph/cpgloading/OnDiskOverflowConfig.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/codepropertygraph/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/OnDiskOverflowConfig.scala b/codepropertygraph/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/OnDiskOverflowConfig.scala index 70cb25ae4..f36ea5528 100644 --- a/codepropertygraph/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/OnDiskOverflowConfig.scala +++ b/codepropertygraph/src/main/scala/io/shiftleft/codepropertygraph/cpgloading/OnDiskOverflowConfig.scala @@ -3,6 +3,7 @@ package io.shiftleft.codepropertygraph.cpgloading import scala.compat.java8.OptionConverters._ /** configure graphdb to use ondisk overflow. + * if the file specified by `graphLocation` already exists, we'll initialize the graph from there * if `graphLocation` is specified, graph will be saved there on close, and can be reloaded by just instantiating one with the same setting * otherwise, system tmp directory is used (e.g. `/tmp`) and graph won't be saved on close */ case class OnDiskOverflowConfig(graphLocation: Option[String] = None,