Skip to content

Commit 45148c3

Browse files
ashfordiumjohannescoetzee
authored andcommitted
Delete location and new location nodes from the CPG spec
1 parent 5b192b6 commit 45148c3

3 files changed

Lines changed: 5 additions & 28 deletions

File tree

schema/src/main/scala/io/shiftleft/codepropertygraph/schema/CpgSchema.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class CpgSchema(builder: SchemaBuilder) {
2424
val shortcuts = Shortcuts(builder, base, method, ast, typeSchema, fs)
2525

2626
val sourceSpecific = Comment(builder, base, ast, fs)
27-
val tagsAndLocation = TagsAndLocation(builder, base, typeSchema, method, ast, fs, callGraph)
27+
val tags = Tags(builder, base, typeSchema, method, ast, fs, callGraph)
2828
val binding = Binding(builder, base, typeSchema, method, callGraph)
2929
val annotation = Annotation(builder, base, method, typeSchema, ast, shortcuts)
3030
val finding = Finding(builder, base)
31-
val hidden = Hidden(builder, base, method, typeSchema, ast, cfg, fs, callGraph, pdg, tagsAndLocation, shortcuts)
31+
val hidden = Hidden(builder, base, method, typeSchema, ast, cfg, fs, callGraph, pdg, tags, shortcuts)
3232
val protoSerialize = ProtoSerialize(builder, ast)
3333
}
3434

schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Hidden.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Hidden extends SchemaBase {
2424
fs: FileSystem.Schema,
2525
callGraph: CallGraph.Schema,
2626
pdg: Pdg.Schema,
27-
tags: TagsAndLocation.Schema,
27+
tags: Tags.Schema,
2828
shortcuts: Shortcuts.Schema
2929
) = new Schema(builder, base, methodSchema, typeDecl, ast, cfg, fs, callGraph, pdg, tags, shortcuts)
3030

@@ -38,7 +38,7 @@ object Hidden extends SchemaBase {
3838
fsSchema: FileSystem.Schema,
3939
callGraph: CallGraph.Schema,
4040
pdg: Pdg.Schema,
41-
tags: TagsAndLocation.Schema,
41+
tags: Tags.Schema,
4242
shortcuts: Shortcuts.Schema
4343
) {
4444

schema/src/main/scala/io/shiftleft/codepropertygraph/schema/TagsAndLocation.scala renamed to schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Tags.scala

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import io.shiftleft.codepropertygraph.schema.CpgSchema.PropertyDefaults
44
import flatgraph.schema.Property.ValueType
55
import flatgraph.schema._
66

7-
object TagsAndLocation extends SchemaBase {
7+
object Tags extends SchemaBase {
88

99
override def docIndex: Int = 17
1010

@@ -87,34 +87,11 @@ object TagsAndLocation extends SchemaBase {
8787
.addProperties(name, value)
8888
.primaryKey(name)
8989

90-
val location: NodeType = builder
91-
.addNodeType(
92-
name = "LOCATION",
93-
comment =
94-
"Deprecated: Prefer the generated Loc node extension and .loc node step. A location node summarizes a source code location."
95-
)
96-
.protoId(ProtoIds.Location)
97-
.addProperties(
98-
symbol,
99-
methodFullName,
100-
methodShortName,
101-
packageName,
102-
lineNumber,
103-
className,
104-
classShortName,
105-
nodeLabel,
106-
filename,
107-
columnNumber
108-
)
109-
11090
val tagNodePair: NodeType = builder
11191
.addNodeType(name = "TAG_NODE_PAIR", comment = "This node contains an arbitrary node and an associated tag node.")
11292
.protoId(ProtoIds.TagNodePair)
11393
.addProperties()
11494

115-
// node relations
116-
location.addContainedNode(builder.anyNode, "node", Property.Cardinality.ZeroOrOne)
117-
11895
// TODO MP: provide dummy/empty node as default, to avoid null?
11996
tagNodePair
12097
.addContainedNode(tag, "tag", Property.Cardinality.One(Property.Default(null)))

0 commit comments

Comments
 (0)