tests/FactoryTest.php
Method testCities
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testCities()
{
$this->assertEquals('Vladivostok', SearchFactory::find(
self::$prefix . self::$testUrlName[0],
self::$testMatchString[0],
The method testCities() has 113 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
public function testCities()
{
$this->assertEquals('Vladivostok', SearchFactory::find(
self::$prefix . self::$testUrlName[0],
self::$testMatchString[0],
- Exclude checks
Avoid unused private fields such as '$testMatchStringAnother'. Open
Open
private static $testMatchStringAnother = ['aeroflot', 'kaskoflot', 's7', 'sseven'];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid excessively long variable names like $testMatchStringAnother. Keep variable name length under 20. Open
Open
private static $testMatchStringAnother = ['aeroflot', 'kaskoflot', 's7', 'sseven'];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Function closing brace must go on the next line following the body; found 2 blank lines before brace Open
Open
}
- Exclude checks