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()]);
- Read upRead up
- Exclude checks
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 {
- Exclude checks
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()]);
- Exclude checks
Avoid unused local variables such as '$subResource'. Open
foreach ($subResources as $subResource) {
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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 {
- Read upRead up
- Exclude checks
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()]);
- Read upRead up
- Exclude checks
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).'/';
- Read upRead up
- Exclude checks
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)
- Exclude checks
Possibly zero references to use statement for classlike/namespace Method
(\Nette\PhpGenerator\Method)
Open
use Nette\PhpGenerator\Method;
- Exclude checks
TODO found Open
//TODO: .'|null' va messo in quale condizione?
- Exclude checks
FIXME found Open
$generated = true; //FIXME: use $g for determinate! -> take error from generator
- Exclude checks
Possibly zero write references to public property \Yoghi\Bundle\MaddaBundle\Generator\ClassConfig->isSingleton
Open
public $isSingleton;
- Exclude checks
Saw unextractable annotation for comment '* @var [type]'
Open
* @var [type]
- Exclude checks
Unused definition of variable $body
Open
$body = '';
- Exclude checks
Possibly zero references to public method \Yoghi\Bundle\MaddaBundle\Generator\AbstractFileGenerator::getErrors()
Open
public function getErrors()
- Exclude checks
Possibly zero references to public method \Yoghi\Bundle\MaddaBundle\Generator\DDDGenerator::getErrors()
Open
public function getErrors()
- Exclude checks
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'
- Exclude checks
Saw unextractable annotation for comment '* @param [type] $fullPathFile [description]'
Open
* @param [type] $fullPathFile [description]
- Exclude checks