This document outlines the definition of file metrics for Python.
The "complexity" metric counts:
if
andelif
statements- ternary operators
for
,for...else
,while
andwhile...else
loopscase
labels in match-statements and their guards, but notcase _:
except
clauses intry
-statements- logical binary operations
and
andor
- 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