janus.metrics.complexity_metrics#
Exceptions#
Common base class for all non-exit exceptions. |
Classes#
A class for calculating node-based complexity metrics of code. |
Functions#
|
Calculate the cyclomatic complexity score. |
|
Calculate the Halstead effort. |
|
Calculate the Halstead volume. |
|
Calculate the Halstead difficulty. |
|
Calculate the maintainability score. |
Module Contents#
- exception janus.metrics.complexity_metrics.NodeException#
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class janus.metrics.complexity_metrics.TreeSitterMetric(code, language)#
A class for calculating node-based complexity metrics of code.
- Parameters:
- janus.metrics.complexity_metrics.cyclomatic_complexity(target, **kwargs)#
Calculate the cyclomatic complexity score.
- janus.metrics.complexity_metrics.effort(target, **kwargs)#
Calculate the Halstead effort.
- janus.metrics.complexity_metrics.volume(target, **kwargs)#
Calculate the Halstead volume.
- janus.metrics.complexity_metrics.difficulty(target, **kwargs)#
Calculate the Halstead difficulty.