AppKernel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 7
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerBundles() 0 14 1
A registerContainerConfiguration() 0 4 1
1
<?php
2
3
use Symfony\Component\HttpKernel\Kernel;
4
use Symfony\Component\Config\Loader\LoaderInterface;
5
6
class AppKernel extends Kernel
7
{
8
    public function registerBundles()
9
    {
10
        $bundles = array();
0 ignored issues
show
Unused Code introduced by
$bundles 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...
11
12
        $bundles = [
13
            new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
14
            new \JMS\SerializerBundle\JMSSerializerBundle($this),
0 ignored issues
show
Unused Code introduced by
The call to JMSSerializerBundle::__construct() has too many arguments starting with $this.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
15
            new \FOS\RestBundle\FOSRestBundle(),
16
            new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
17
            new \Maikuro\DistributedConfigurationBundle\MaikuroDistributedConfigurationBundle(),
18
        ];
19
20
        return $bundles;
21
    }
22
23
    public function registerContainerConfiguration(LoaderInterface $loader)
24
    {
25
        $loader->load(__DIR__.'/config/config.yml');
26
    }
27
}
28