M810   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 61
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 61
loc 61
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\Contribuicoes;
4
5
use NFePHP\EFD\Common\Element;
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9 View Code Duplication
class M810 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 = 'M810';
12
    const LEVEL = 3;
13
    const PARENT = 'M800';
14
15
    protected $parameters = [
16
        'NAT_REC' => [
17
            'type' => 'string',
18
            'regex' => '^(4|4|5)$',
19
            'required' => false,
20
            'info' => 'Natureza da Receita, conforme relação constante nas Tabelas de Detalhamento da Natureza ' .
21
                'da Receita por Situação Tributária abaixo ' .
22
                ' - Tabela 4.3.10 ' .
23
                ' Produtos Sujeitos à Incidência Monofásica da Contribuição Social – Alíquotas ' .
24
                'Diferenciadas (CST 04 - Revenda) ' .
25
                ' - Tabela 4.3.11 ' .
26
                ' Produtos Sujeitos à Incidência Monofásica da Contribuição Social – Alíquotas por ' .
27
                'Unidade de Medida de Produto (CST 04 - Revenda) ' .
28
                ' - Tabela 4.3.12 ' .
29
                ' Produtos Sujeitos à Substituição Tributária da Contribuição Social (CST 05 - ' .
30
                'Revenda) ' .
31
                ' - Tabela 4.3.13 ' .
32
                ' Produtos Sujeitos à Alíquota Zero da Contribuição Social (CST 06) ' .
33
                ' ',
34
            'format' => ''
35
        ],
36
        'VL_REC' => [
37
            'type' => 'numeric',
38
            'regex' => '^\d+(\.\d*)?|\.\d+$',
39
            'required' => false,
40
            'info' => 'Valor da receita bruta no período, relativo a natureza da receita (NAT_REC) ',
41
            'format' => '15v2'
42
        ],
43
        'COD_CTA' => [
44
            'type' => 'string',
45
            'regex' => '^(.*)$',
46
            'required' => false,
47
            'info' => 'Código da debitada/creditada. ',
48
            'format' => ''
49
        ],
50
        'DESC_COMPL' => [
51
            'type' => 'string',
52
            'regex' => '^(.*)$',
53
            'required' => false,
54
            'info' => 'Descrição Complementar da Natureza da Receita. ',
55
            'format' => ''
56
        ],
57
58
    ];
59
60
    /**
61
     * Constructor
62
     * @param \stdClass $std
63
     */
64
    public function __construct(\stdClass $std)
65
    {
66
        parent::__construct(self::REG);
67
        $this->std = $this->standarize($std);
68
    }
69
}
70