client_python icon indicating copy to clipboard operation
client_python copied to clipboard

Improve cyclomatic complexity

Open ilya-anashkin opened this issue 3 years ago • 0 comments

Hi! Using the example of my PR, I would like to show that the library needs to improve its cyclomatic complexity. I tested with the utility radon

My changes

SummaryMetricFamily.__init__ - B (7)
to
SummaryMetricFamily.__init__ - B (6)

HistogramMetricFamily - B(7)
to
Deleted from >=B level complexity

HistogramMetricFamily.__init__ - B(7)
to
HistogramMetricFamily.__init__ - B(6)

CollectorRegistry._get_names - B(7)
to
CollectorRegistry._get_names - B(6)
```

```
629 blocks (classes, functions, methods) analyzed.
Average complexity: A (2.1701112877583464)

to

629 blocks (classes, functions, methods) analyzed.
Average complexity: A (2.1701112877583464)
```

ilya-anashkin avatar Sep 23 '22 15:09 ilya-anashkin