Skip to content

Commit

Permalink
Added complexity and mermaid chart
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Nov 24, 2023
1 parent 63cfc9d commit b45310a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit b45310a

Please sign in to comment.