diff --git a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/FunctionDeclaration.kt b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/FunctionDeclaration.kt index 2089b147200..20b252e2c10 100644 --- a/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/FunctionDeclaration.kt +++ b/cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/FunctionDeclaration.kt @@ -301,6 +301,17 @@ val Statement.cyclomaticComplexity: Int // add one for each branch (and include the children) stmt.caseExpression?.let { i += it.cyclomaticComplexity } } + is DoStatement -> { + // add one for the do statement (and include the children) + i += (stmt.statement?.cyclomaticComplexity ?: 0) + 1 + } + is GotoStatement -> { + // add one + i++ + } + is StatementHolder -> { + i += stmt.cyclomaticComplexity + } } }