Skip to content

Commit

Permalink
Merge branch 'main' into renovate/io.github.detekt.sarif4k-sarif4k-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fwendland authored Mar 25, 2024
2 parents 40dd075 + 1a09888 commit a7c116b
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 31 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repositories {

// Eclipse CDT repo --> needed for CPG
ivy {
setUrl("https://download.eclipse.org/tools/cdt/releases/11.0/cdt-11.0.0/plugins")
setUrl("https://download.eclipse.org/tools/cdt/releases/11.3/cdt-11.3.1/plugins")
metadataSources {
artifact()
}
Expand Down
2 changes: 1 addition & 1 deletion code-coverage-report/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {

// Eclipse CDT repo --> needed when adding the CPG as an included build
ivy {
setUrl("https://download.eclipse.org/tools/cdt/releases/11.0/cdt-11.0.0/plugins")
setUrl("https://download.eclipse.org/tools/cdt/releases/11.3/cdt-11.3.1/plugins")
metadataSources {
artifact()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ open class CPGBackend(config: BackendConfiguration) : Backend {
.processAnnotations(processAnnotations)
.failOnError(failOnError)
.useParallelFrontends(useParallelFrontends)
.typeSystemActiveInFrontend(typeSystemActiveInFrontend)
.sourceLocations(source.map { (it.toFile()) })
.symbols(symbols)
.useUnityBuild(useUnityBuild)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ private val logger = KotlinLogging.logger {}
data class CPGConfiguration(
val source: List<Path>,
val useUnityBuild: Boolean,
val typeSystemActiveInFrontend: Boolean,
val debugParser: Boolean,
val disableCleanup: Boolean,
val codeInNodes: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,6 @@ class CPGOptionGroup : BackendOptions(helpName = "CPG Backend Options") {
help = "Enables unity builds (C++ only) for files in the path."
)
.flag("--no-unity", "--disable-unity", default = false)
val typeSystemActiveInFrontend: Boolean by option(
"--type-system-in-frontend",
help = "If deactivated, the type listener system starts after the frontends " +
"are done building the initial AST structure."
)
.flag(
"--no-type-system-in-frontend",
"--disable-type-system-in-frontend",
default = true,
defaultForHelp = "enable"
)
val debugParser: Boolean by option("--debug-parser", help = "Generate debug output for the cpg parser.")
.flag("--no-debug-parser", default = false)
val disableCleanup: Boolean by option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class BaseCpgBackend : BackendCommand<CPGBackend>("cpg") {
CPGConfiguration(
source = source,
useUnityBuild = useUnityBuild,
typeSystemActiveInFrontend = typeSystemActiveInFrontend,
debugParser = debugParser,
disableCleanup = disableCleanup,
codeInNodes = codeInNodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class CokoCpgBackend : BackendCommand<CokoBackend>("cokoCpg") {
CPGConfiguration(
source = source,
useUnityBuild = useUnityBuild,
typeSystemActiveInFrontend = typeSystemActiveInFrontend,
debugParser = debugParser,
disableCleanup = disableCleanup,
codeInNodes = codeInNodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import de.fraunhofer.aisec.codyze.specificationLanguages.coko.core.dsl.Order
import de.fraunhofer.aisec.codyze.specificationLanguages.coko.core.ordering.*
import de.fraunhofer.aisec.cpg.graph.*
import de.fraunhofer.aisec.cpg.graph.declarations.VariableDeclaration
import de.fraunhofer.aisec.cpg.graph.statements.expressions.DeclaredReferenceExpression
import de.fraunhofer.aisec.cpg.graph.statements.expressions.Reference
import io.github.oshai.kotlinlogging.KotlinLogging
import kotlin.reflect.full.createType
import kotlin.reflect.full.declaredMemberFunctions
Expand Down Expand Up @@ -164,7 +164,7 @@ class OrderEvaluator(val baseNodes: Collection<Node>, val order: Order) : Evalua
nodeToRelevantMethod = nodesToOp,
consideredBases = baseNodes.flatMap { node ->
node.followNextDFGEdgesUntilHit { next ->
next is VariableDeclaration || next is DeclaredReferenceExpression
next is VariableDeclaration || next is Reference
}.fulfilled.mapNotNull { path ->
path.lastOrNull()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CPGConfigurationTest {
val expectedCpgConfiguration = CPGConfiguration(
source = listOf(),
useUnityBuild = true,
typeSystemActiveInFrontend = false,
debugParser = false,
disableCleanup = false,
codeInNodes = true,
Expand All @@ -46,7 +45,6 @@ class CPGConfigurationTest {
val cpgConfiguration = CPGConfiguration(
source = listOf(),
useUnityBuild = true,
typeSystemActiveInFrontend = false,
debugParser = false,
disableCleanup = false,
codeInNodes = true,
Expand Down Expand Up @@ -74,7 +72,6 @@ class CPGConfigurationTest {
val expectedCpgConfiguration = CPGConfiguration(
source = listOf(),
useUnityBuild = false,
typeSystemActiveInFrontend = false,
debugParser = false,
disableCleanup = false,
codeInNodes = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import com.github.ajalt.clikt.core.MultiUsageError
import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.parameters.groups.provideDelegate
import de.fraunhofer.aisec.codyze.core.config.combineSources
import de.fraunhofer.aisec.cpg.passes.CallResolver
import de.fraunhofer.aisec.cpg.passes.EdgeCachePass
import de.fraunhofer.aisec.cpg.passes.FilenameMapper
import de.fraunhofer.aisec.cpg.passes.Pass
import de.fraunhofer.aisec.cpg.passes.*
import io.github.oshai.kotlinlogging.KotlinLogging
import org.junit.jupiter.api.*
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -86,7 +83,7 @@ class CpgOptionGroupTest {
fun passesTest() {
val edgeCachePassName = EdgeCachePass::class.qualifiedName
val filenameMapperName = FilenameMapper::class.qualifiedName
val callResolverName = CallResolver::class.qualifiedName
val callResolverName = SymbolResolver::class.qualifiedName
assertNotNull(edgeCachePassName)
assertNotNull(filenameMapperName)
assertNotNull(callResolverName)
Expand All @@ -106,7 +103,7 @@ class CpgOptionGroupTest {
)

val expectedPassesNames =
listOf(EdgeCachePass::class, FilenameMapper::class, CallResolver::class).map { p ->
listOf(EdgeCachePass::class, FilenameMapper::class, SymbolResolver::class).map { p ->
p.qualifiedName
}
val actualPassesNames = cli.cpgOptions.passes.map { p -> p.qualifiedName }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fun createCpgConfiguration(vararg sourceFile: Path) =
CPGConfiguration(
source = listOf(*sourceFile),
useUnityBuild = false,
typeSystemActiveInFrontend = true,
debugParser = false,
disableCleanup = false,
codeInNodes = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class CokoCpgIntegrationTest {
CPGConfiguration(
source = sourceFiles,
useUnityBuild = false,
typeSystemActiveInFrontend = true,
debugParser = false,
disableCleanup = false,
codeInNodes = true,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kotlin = "1.9.23"
cpg = "7.1.2"
cpg = "8.1.2"
koin = "3.5.3"
koin-test = "3.5.3"
detekt = "1.23.5"
Expand Down

0 comments on commit a7c116b

Please sign in to comment.