robotomize/fujes

View on GitHub
tests/FactoryTest.php

Summary

Maintainability
B
4 hrs
Test Coverage

Method testCities has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testCities()
    {
        $this->assertEquals('Vladivostok', SearchFactory::find(
            self::$prefix . self::$testUrlName[0],
            self::$testMatchString[0],
Severity: Major
Found in tests/FactoryTest.php - About 4 hrs to fix

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

        public function testCities()
        {
            $this->assertEquals('Vladivostok', SearchFactory::find(
                self::$prefix . self::$testUrlName[0],
                self::$testMatchString[0],
    Severity: Minor
    Found in tests/FactoryTest.php by phpmd

    Avoid unused private fields such as '$testMatchStringAnother'.
    Open

        private static $testMatchStringAnother = ['aeroflot', 'kaskoflot', 's7', 'sseven'];
    Severity: Minor
    Found in tests/FactoryTest.php by phpmd

    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

        private static $testMatchStringAnother = ['aeroflot', 'kaskoflot', 's7', 'sseven'];
    Severity: Minor
    Found in tests/FactoryTest.php by phpmd

    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

        }
    Severity: Minor
    Found in tests/FactoryTest.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status