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 b27d2dd259..bf69a20c09 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 @@ -280,6 +280,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 + } } }