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 23, 2023
1 parent 593cfb5 commit d6e8d13
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit d6e8d13

Please sign in to comment.