Passed
Push — master ( d65fb2...07d9b9 )
by Roberto
05:56 queued 03:13
created

TraitBlocoVIII   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A blocoVIII() 0 31 1
1
<?php
2
namespace NFePHP\DA\NFe\Traits;
3
4
use Com\Tecnick\Barcode\Barcode;
5
6
/**
7
 * Bloco QRCode
8
 */
9
trait TraitBlocoVIII
10
{
11
    protected function blocoVIII($y)
12
    {
13
        $this->bloco8H = 50;
0 ignored issues
show
Bug introduced by
The property bloco8H does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
14
        $y += 1;
15
        
16
        /*
17
        $aFont = ['font'=> $this->fontePadrao, 'size' => 7, 'style' => ''];
18
        $this->pdf->textBox($this->margem, $y, $this->wPrint, $this->bloco8H, '', $aFont, 'T', 'C', true, '', false);
19
        */
20
        
21
        $maxW = $this->wPrint;
0 ignored issues
show
Bug introduced by
The property wPrint does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
22
        $w = ($maxW*1)+4;
23
        $barcode = new Barcode();
24
        $bobj = $barcode->getBarcodeObj(
25
            'QRCODE,M',
26
            $this->qrCode,
0 ignored issues
show
Bug introduced by
The property qrCode does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
27
            -4,
28
            -4,
29
            'black',
30
            array(-2, -2, -2, -2)
31
        )->setBackgroundColor('white');
32
        $qrcode = $bobj->getPngData();
33
        $wQr = 50;
34
        $hQr = 50;
35
        $yQr = ($y);
36
        $xQr = ($w/2) - ($wQr/2);
37
        $pic = 'data://text/plain;base64,' . base64_encode($qrcode);
38
        $info = getimagesize($pic);
0 ignored issues
show
Unused Code introduced by
$info is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
39
        $this->pdf->image($pic, $xQr, $yQr, $wQr, $hQr, 'PNG');
0 ignored issues
show
Bug introduced by
The property pdf does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
40
        return $this->bloco8H+$y;
41
    }
42
}
43