Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
maximiliankaul committed Dec 13, 2024
1 parent 82e48c2 commit c4a2dc7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ package de.fraunhofer.aisec.cpg.graph
* Represents an extra node added to the CPG. These nodes can live next to the CPG, typically having
* shared edges to extend the original CPG graph.
*/
interface OverlayNode
abstract class OverlayNode : Node()
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ package de.fraunhofer.aisec.cpg.graph.concepts
import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.graph.OverlayNode

/** A node extending the CPG and storing the corresponding/responsible [cpgNode]. */
abstract class Concept : Node(), OverlayNode {
/**
* Represents a new concept added to the CPG. This is intended for modelling "concepts" like
* logging, files, databases. The relevant operations on this concept are modeled as [Operation]s
* and stored in [ops].
*/
abstract class Concept() : OverlayNode() {
/** All concept nodes are connected to an original cpg [Node] by this. */
abstract val cpgNode: Node
/** All [Operation]s belonging to this concept. */
abstract val ops: Set<Operation>
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@
*/
package de.fraunhofer.aisec.cpg.graph.concepts

import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.graph.OverlayNode

/**
* Represents a new concept added to the CPG. This is intended for modelling "concepts" like
* logging, files, databases. The relevant operations on this concept are modeled as
* [OperationNode]s and stored in [ops].
* Represents an operation executed on/with a [Concept] (stored in [concept]). This is typically a
* `write` on a file or log object or an `execute` on a database.
*/
abstract class ConceptNode() : Concept() {
abstract val ops: Set<OperationNode>
abstract class Operation : OverlayNode() {
/** All concept nodes are connected to an original cpg [Node] by this. */
abstract val cpgNode: Node
/** The [Concept] this operation belongs to. */
abstract val concept: Concept
}

This file was deleted.

0 comments on commit c4a2dc7

Please sign in to comment.