Skip to content

Commit

Permalink
Add some properties for specifying DFG edges more precisely (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
KuechA authored Nov 23, 2023
1 parent 4ecca5d commit 8759b0b
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/
package de.fraunhofer.aisec.cpg.graph.edge

import java.util.*

/**
* INDEX: (int) Indicates the position in a list of edges
*
Expand All @@ -50,11 +52,29 @@ enum class Properties {
UNREACHABLE,
ACCESS,
DEPENDENCE,
DYNAMIC_INVOKE
DYNAMIC_INVOKE,
SENSITIVITY,
CALLING_CONTEXT_IN,
CALLING_CONTEXT_OUT
}

/** The types of dependencies that might be represented in the CPG */
enum class DependenceType {
CONTROL,
DATA
}

/** Sensitivity options (of DFG edges). */
enum class SensitivitySpecifier {
FIELD,
CONTEXT;

infix fun and(other: SensitivitySpecifier) = Sensitivities.of(this, other)
}

typealias Sensitivities = EnumSet<SensitivitySpecifier>

infix fun Sensitivities.allOf(other: Sensitivities) = this.containsAll(other)

infix fun Sensitivities.and(other: SensitivitySpecifier) =
Sensitivities.of(other, *this.toTypedArray())

0 comments on commit 8759b0b

Please sign in to comment.