Completed
Push — master ( b64f8f...06557d )
by Tobias
02:24
created

TestController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A foo() 0 10 1
A shouldBeIgnored() 0 3 1
A shouldBeIgnoredAndGoesWithoutError() 0 3 1
1
<?php
2
3
4
namespace App\Controller\Test;
5
6
7
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8
9
class TestController extends Controller
10
{
11
    public function foo()
12
    {
13
        $foo = [
0 ignored issues
show
Unused Code introduced by
$foo 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...
14
            ['label' => $this->get('translator')->trans('this.should.be.translated.without.errors')], //ERROR: Form label is not a scalar string
15
            [/** @Ignore */'label' => $this->get('translator')->trans('this.should.be.translated.without.errors.and.now.it.works')],
16
            ['label_' => $this->get('translator')->trans('this.works.correctly')],
17
            ['label' => $this->shouldBeIgnored()], //ERROR: Form label is not a scalar string
18
            [/** @Ignore */'label' => $this->shouldBeIgnoredAndGoesWithoutError()],
19
        ];
20
    }
21
22
    private function shouldBeIgnored()
23
    {
24
    }
25
26
    private function shouldBeIgnoredAndGoesWithoutError()
27
    {
28
    }
29
}
30