This document outlines the definition of file metrics for Python.
The "complexity" metric counts:
ifandelifstatements- ternary operators
for,for...else,whileandwhile...elseloopscaselabels in match-statements and their guards, but notcase _:exceptclauses intry-statements- logical binary operations
andandor - everything counted for the "functions" metric
It does not count:
- function calls, e.g.
map()built-in function
The "functions" metric counts:
- general functions
- method definitions in classes incl. static methods, class methods and constructors
- lambda functions
It does not count:
- function definitions in
exec()function calls
The "classes" metric counts:
- class definitions using
class-keyword
see README.md