This document outlines the definition of file metrics for Go.
The "complexity" metric counts:
if
andelse if
statementsfor
loops with following syntaxes:for <initStatement>; <condition>; <postStatement> {...}
for <condition> {...}
for <expressionList> = range <expression> {...}
for <identifierList> := range <expression> {...}
case
labels in switch-statements and select-statements- logical binary operations
&&
and||
- everything counted for the "functions" metric
The "functions" metric counts:
- function and method declarations in
struct
andinterface
with and without the keywordfunc
- general functions and function literals
The "classes" metric counts:
struct
andinterface
declarations (named and anonymous)
see README.md