This document outlines the definition of file metrics for Kotlin.
The "complexity" metric counts:
if
andelse if
statements- elvis expression
?:
for
,while
anddo...while
loops- branches (not
else
branch) in thewhen
statements/expressions catch
labels intry-catch
statements- logical binary operations
&&
and||
- everything counted for the "functions" metric
It does not count:
.forEach(...)
method call for iterables and other of built-in function calls
The "functions" metric counts:
- lambda expressions and anonymous functions
init
blocks- secondary constructors
- getters and setters
- functional interface ( this happens due to a bug from Kotlin parser )
It does not count:
- primary constructor
- inline value class with syntax
value class ...
The "classes" metric counts:
- definitions of
class
,abstract class
,interface
andenum
- object expressions/declarations with the keyword
object
andcompanion object
It does not count:
- inline classes
- functional interface
see README.md