Showing 73 of 73 total issues

The method generateClassType() has an NPath complexity of 1469684588800. The configured NPath complexity threshold is 200.
Open

    public function generateClassType(array $properties, $typesReference, $typesDescription, ClassConfig $config)
    {
        $phpNamespace = $this->currentClass->getNamespace();
        if ($config->isInterface) {
            $this->info('Passo a interfaccia', [$this->currentClass->getName()]);
Severity: Minor
Found in Generator/ClassGenerator.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method generateRest() has 135 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function generateRest($ramlFile, Local $directoryOutput)
    {
        $parser = new Parser();
        try {

Severity: Minor
Found in Generator/RestGenerator.php by phpmd

The method generateClassType() has 379 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function generateClassType(array $properties, $typesReference, $typesDescription, ClassConfig $config)
    {
        $phpNamespace = $this->currentClass->getNamespace();
        if ($config->isInterface) {
            $this->info('Passo a interfaccia', [$this->currentClass->getName()]);
Severity: Minor
Found in Generator/ClassGenerator.php by phpmd

Avoid unused local variables such as '$subResource'.
Open

                foreach ($subResources as $subResource) {
Severity: Minor
Found in Generator/RestGenerator.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

The method generate() has an NPath complexity of 716885569. The configured NPath complexity threshold is 200.
Open

    public function generate(Local $directoryOutput)
    {
        //$is_constructor_enable = true;
        //$ddd_is_root_aggregate = false;

Severity: Minor
Found in Generator/DDDGenerator.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method generate() has a Cyclomatic Complexity of 40. The configured cyclomatic complexity threshold is 10.
Open

    public function generate(Local $directoryOutput)
    {
        //$is_constructor_enable = true;
        //$ddd_is_root_aggregate = false;

Severity: Minor
Found in Generator/DDDGenerator.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method generateRest() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

    public function generateRest($ramlFile, Local $directoryOutput)
    {
        $parser = new Parser();
        try {

Severity: Minor
Found in Generator/RestGenerator.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method generateClassType() has a Cyclomatic Complexity of 69. The configured cyclomatic complexity threshold is 10.
Open

    public function generateClassType(array $properties, $typesReference, $typesDescription, ClassConfig $config)
    {
        $phpNamespace = $this->currentClass->getNamespace();
        if ($config->isInterface) {
            $this->info('Passo a interfaccia', [$this->currentClass->getName()]);
Severity: Minor
Found in Generator/ClassGenerator.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method _createFileOnDir is not named in camelCase.
Open

    protected function _createFileOnDir(Local $adapter, $outFile)
    {
        $filesystem = new Filesystem($adapter);

        $dir = pathinfo($adapter->getPathPrefix().$outFile, PATHINFO_DIRNAME).'/';
Severity: Minor
Found in Generator/AbstractFileGenerator.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

Possibly zero references to public method \Yoghi\Bundle\MaddaBundle\Generator\DDDGenerator::analyze()
Open

    public function analyze($fullPathFile)
Severity: Minor
Found in Generator/DDDGenerator.php by phan

Possibly zero references to use statement for classlike/namespace Method (\Nette\PhpGenerator\Method)
Open

use Nette\PhpGenerator\Method;
Severity: Minor
Found in Generator/RestGenerator.php by phan

TODO found
Open

                        //TODO: .'|null' va messo in quale condizione?
Severity: Minor
Found in Generator/ClassGenerator.php by fixme

FIXME found
Open

                $generated = true; //FIXME: use $g for determinate! -> take error from generator
Severity: Minor
Found in Generator/DDDGenerator.php by fixme

Possibly zero write references to public property \Yoghi\Bundle\MaddaBundle\Generator\ClassConfig->isSingleton
Open

    public $isSingleton;
Severity: Minor
Found in Generator/ClassConfig.php by phan

Saw unextractable annotation for comment '* @var [type]'
Open

     * @var [type]
Severity: Info
Found in Generator/AbstractFileGenerator.php by phan

Unused definition of variable $body
Open

            $body = '';
Severity: Minor
Found in Generator/ClassGenerator.php by phan

Possibly zero references to public method \Yoghi\Bundle\MaddaBundle\Generator\AbstractFileGenerator::getErrors()
Open

    public function getErrors()
Severity: Minor
Found in Generator/AbstractFileGenerator.php by phan

Possibly zero references to public method \Yoghi\Bundle\MaddaBundle\Generator\DDDGenerator::getErrors()
Open

    public function getErrors()
Severity: Minor
Found in Generator/DDDGenerator.php by phan

Doc-block of $properties in generateClassType contains phpdoc param type string which is incompatible with the param type array declared in the signature
Open

     * @param string      $properties       elementi possibili 'fields', 'extend', 'implements'
Severity: Minor
Found in Generator/ClassGenerator.php by phan

Saw unextractable annotation for comment '* @param [type] $fullPathFile [description]'
Open

     * @param [type] $fullPathFile [description]
Severity: Info
Found in Generator/DDDGenerator.php by phan
Severity
Category
Status
Source
Language