autowp/autowp

View on GitHub
module/Application/src/Most/Adapter/Wheelsize.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

Method getCars has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getCars(Sql\Select $select, string $language): array
    {
        $wheel = $this->attributes['rear'];

        $specService = $this->most->getSpecs();
Severity: Minor
Found in module/Application/src/Most/Adapter/Wheelsize.php - About 1 hr to fix

    Avoid unused parameters such as '$language'.
    Open

        public function getCars(Sql\Select $select, string $language): array

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

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

    syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
    Open

        protected array $attributes;

    Avoid excessively long variable names like $tyreseriesValuesTable. Keep variable name length under 20.
    Open

            $tyreseriesValuesTable = $specService->getValueDataTable($tyreseries['type_id'])->getTable();

    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

    There are no issues that match your filters.

    Category
    Status