This document outlines the definition of file metrics for Java.
The "complexity" metric counts:
if
andelse if
statements- ternary operators
for
loops with following syntaxes:for (<initialization>; <termination>; <increment>) {...}
for (<element> : <iterable>) {...}
while
anddo...while
loopscase
labels in switch-statementscatch
blocks- 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:
- method declarations and definitions in classes, abstract classes and interfaces
- static methods and constructors
- lambda expressions
- initialization block (static and non-static)
The "classes" metric counts:
- definitions of
class
,abstract class
,interface
,enum
andrecord
- anonymous classes
see README.md