Passed
Push — main ( 65730f...fad324 )
by Douglas
06:54 queued 02:27
created

mandos.model.apis._Source.cached_from_url()   F

Complexity

Conditions 14

Size

Total Lines 29
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 14
eloc 24
nop 5
dl 0
loc 29
rs 3.6
c 0
b 0
f 0

How to fix   Complexity   

Complexity

Complex classes like mandos.model.apis._Source.cached_from_url() often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1