Passed
Push — master ( b8e171...9e4d7b )
by Gabriel
04:14 queued 12s
created

Nip_Form_Renderer_Bootstrap4::renderRow()   B

Complexity

Conditions 10
Paths 98

Size

Total Lines 34
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 10.2918

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 34
ccs 18
cts 21
cp 0.8571
rs 7.6666
c 0
b 0
f 0
cc 10
nc 98
nop 1
crap 10.2918

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * Class Bootstrap4
5
 */
6
class Nip_Form_Renderer_Bootstrap4 extends Nip_Form_Renderer_Bootstrap
7
{
8
9
    /**
10
     * @inheritDoc
11
     */
12 1
    protected function getLabelClassesForElement($element)
13
    {
14 1
        $classes = parent::getLabelClassesForElement($element);
15 1
        $key = array_search('control-label', $classes);
16 1
        $classes[$key] = 'col-form-label';
17
18 1
        return $classes;
19
    }
20
}
21