Completed
Push — kraftbj-patch-1 ( 599bd6...9b0476 )
by
unknown
145:59 queued 137:31
created

PolldaddyShortcode   F

Complexity

Total Complexity 89

Size/Duplication

Total Lines 553
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 553
rs 2
c 0
b 0
f 0
wmc 89
lcom 1
cbo 1

How to fix   Complexity   

Complex Class

Complex classes like PolldaddyShortcode 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

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.

While breaking up the class, it is a good idea to analyze how other classes use PolldaddyShortcode, and based on these observations, apply Extract Interface, too.

1
<?php
2
/**
3
 * Deprecated alias for Crowdsignal.
4
 */
5