Z1250   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 58
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 58
loc 58
ccs 0
cts 5
cp 0
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 View Code Duplication
class Z1250 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...
10
{
11
    const REG = '1250';
12
    const LEVEL = 2;
13
    const PARENT = '1001';
14
15
    protected $parameters = [
16
        'VL_CREDITO_ICMS_OP' => [
17
            'type'     => 'numeric',
18
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
19
            'required' => true,
20
            'info'     => 'Informar o valor total do ICMS operação própria que o informante tem direito ao crédito, '
21
            .'na forma prevista na legislação, referente às hipóteses de restituição em que há previsão deste crédito.',
22
            'format'   => '15v2'
23
        ],
24
        'VL_ICMS_ST_REST' => [
25
            'type'     => 'numeric',
26
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
27
            'required' => true,
28
            'info'     => 'Informar o valor total do ICMS/ST que o informante tem direito ao crédito, na forma '
29
            .'prevista na legislação, referente às hipóteses de restituição em que há previsão deste crédito.',
30
            'format'   => '15v2'
31
        ],
32
        'VL_FCP_ST_REST' => [
33
            'type'     => 'numeric',
34
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
35
            'required' => true,
36
            'info'     => 'Informar o valor total do FCP_ST agregado ao valor do ICMS/ST informado no '
37
            .'campo VL_ICMS_ST_REST.',
38
            'format'   => '15v2'
39
        ],
40
        'VL_ICMS_ST_COMPL' => [
41
            'type'     => 'numeric',
42
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
43
            'required' => true,
44
            'info'     => 'Informar o valor total do débito referente ao complemento do imposto, Nos casos '
45
            .'previstos na legislação.',
46
            'format'   => '15v2'
47
        ],
48
        'VL_FCP_ST_COMPL' => [
49
            'type'     => 'numeric',
50
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
51
            'required' => true,
52
            'info'     => 'Informar o valor total do FCP_ST agregado ao valor informado no campo VL_ICMS_ST_COMPL',
53
            'format'   => '15v2'
54
        ]
55
    ];
56
57
    /**
58
     * Constructor
59
     * @param \stdClass $std
60
     */
61
    public function __construct(\stdClass $std)
62
    {
63
        parent::__construct(self::REG);
64
        $this->std = $this->standarize($std);
65
    }
66
}
67