Passed
Push — master ( f6f1d0...ed56e2 )
by Andrea
69:42 queued 61:17
created

PermessiController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Test Coverage

Coverage 53.85%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 83
ccs 21
cts 39
cp 0.5385
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B setParametriGriglia() 0 26 2
A indexAction() 0 49 1
1
<?php
2
3
namespace Fi\CoreBundle\Controller;
4
5
use Symfony\Component\HttpFoundation\Request;
6
use Fi\CoreBundle\Entity\Permessi;
7
8
/**
9
 * Permessi controller.
10
 */
11
class PermessiController extends FiCoreController
12
{
13
14
    /**
15
     * Lists all Ffprincipale entities.
16
     */
17 1
    public function indexAction(Request $request)
18
    {
19 1
        $this->setup($request);
20 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
21 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
22 1
        $controller = $this->getController();
23 1
        $container = $this->container;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
24
25 1
        $nomebundle = $namespace . $bundle . 'Bundle';
26
27 1
        $em = $this->getDoctrine()->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
28 1
        $entities = $em->getRepository($nomebundle . ':' . $controller)->findAll();
29
30
        $dettaglij = array(
31 1
            'operatori_id' => array(
32
                array('nomecampo' => 'operatori.username',
33
                    'lunghezza' => '200',
34
                    'descrizione' => 'Username',
35
                    'tipo' => 'text',),
36
                array('nomecampo' => 'operatori.operatore',
37
                    'lunghezza' => '200',
38
                    'descrizione' => 'Operatore',
39
                    'tipo' => 'text',),
40
            ),
41
            'ruoli_id' => array(
42
                array('nomecampo' => 'ruoli.ruolo',
43
                    'lunghezza' => '200',
44
                    'descrizione' => 'Ruolo',
45
                    'tipo' => 'text',),
46
            ),
47
        );
48
49
        $paricevuti = array(
50 1
            'doctrine' => $em,
51 1
            'nomebundle' => $nomebundle,
52 1
            'nometabella' => $controller,
53 1
            'dettaglij' => $dettaglij,
54 1
            'container' => $container,);
55
56 1
        $testatagriglia = Griglia::testataPerGriglia($paricevuti);
57
58 1
        $testata = json_encode($testatagriglia);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
59
        $twigparms = array(
60 1
            'entities' => $entities,
61 1
            'nomecontroller' => $controller,
62 1
            'testata' => $testata,
63
        );
64
65 1
        return $this->render($nomebundle . ':' . $controller . ':index.html.twig', $twigparms);
66
    }
67
68
    public function setParametriGriglia($prepar = array())
69
    {
70
        $this->setup($prepar['request']);
71
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
72
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
73
        $controller = $this->getController();
74
75
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 15 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
76
        $escludi = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 18 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
77
        $tabellej = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 17 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
78
        $tabellej['operatori_id'] = array('tabella' => 'operatori', 'campi' => array('username', 'operatore'));
79
        $tabellej['ruoli_id'] = array('tabella' => 'ruoli', 'campi' => array('ruolo'));
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
80
81
        $paricevuti = array(
82
            'container' => $this->container,
83
            'nomebundle' => $nomebundle,
84
            'tabellej' => $tabellej,
85
            'nometabella' => $controller,
86
            'escludere' => $escludi,
87
        );
88
89
        if (! empty($prepar)) {
90
            $paricevuti = array_merge($paricevuti, $prepar);
91
        }
92
93
        self::$parametrigriglia = $paricevuti;
94
    }
95
}
96