ejwa / gitinspector

:bar_chart: The statistical analysis tool for git repositories
GNU General Public License v3.0
2.35k stars 324 forks source link

Get cyclomatic complexity metrics for all files #196

Closed emilppp closed 3 years ago

emilppp commented 5 years ago

Hi! :)

Is there any way to get cyclomatic complexity metrics for all files, not only the elevated ones? I want to get an average cyclomatic complexity across all files in a project.

adam-waldenberg commented 5 years ago

Hi @emilppp. You can edit metrics.py and play with the constants;

METRIC_CYCLOMATIC_COMPLEXITY_THRESHOLD
METRIC_CYCLOMATIC_COMPLEXITY_DENSITY_THRESHOLD

These specify the required value needed for the metric to be considered elevated. Set them to zero and you should get it for all files.