Completed
Push — master ( 7e37c8...761feb )
by Roberto
15s queued 12s
created

H030   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 47
loc 47
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace NFePHP\EFD\Elements\ICMSIPI;
4
5
use NFePHP\EFD\Common\Element;
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9
/**
10
 * REGISTRO H030: Informações complementares do inventário das mercadorias sujeitas ao
11
 *0 regime de substituição tributária
12
 *
13
 */
14 View Code Duplication
class H030 extends Element implements ElementInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    const REG = 'H030';
17
    const LEVEL = 4;
18
    const PARENT = 'H010';
19
20
    protected $parameters = [
21
        'VL_ICMS_OP' => [
22
            'type'     => 'numeric',
23
            'regex'     => '',
24
            'required' => true,
25
            'info'     => 'Valor médio unitário do ICMS OP',
26
            'format'   => '15v6'
27
        ],
28
        'VL_BC_ICMS_ST' => [
29
            'type'     => 'numeric',
30
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
31
            'required' => true,
32
            'info'     => 'Valor médio unitário da base de cálculo do ICMS ST',
33
            'format'   => '15v6'
34
        ],
35
        'VL_ICMS_ST' => [
36
            'type'     => 'numeric',
37
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
38
            'required' => true,
39
            'info'     => 'Valor médio unitário do ICMS ST',
40
            'format'   => '15v6'
41
        ],
42
        'VL_FCP' => [
43
            'type'     => 'numeric',
44
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
45
            'required' => true,
46
            'info'     => 'Valor médio unitário do FCP',
47
            'format'   => '15v6'
48
        ],
49
    ];
50
    
51
    /**
52
     * Constructor
53
     * @param \stdClass $std
54
     */
55
    public function __construct(\stdClass $std)
56
    {
57
        parent::__construct(self::REG);
58
        $this->std = $this->standarize($std);
59
    }
60
}
61