nafigator/Veles

View on GitHub

Showing 216 of 216 total issues

Avoid classes with short names like Db. Configured minimum length is 3.
Open

class Db extends DbTransactionHandler
{
    /**
     * Получение значения столбца таблицы
     *
Severity: Minor
Found in DataBase/Db.php by phpmd

ShortClassName

Since: 2.9

Detects when classes or interfaces have a very short name.

Example

class Fo {

}

interface Fo {

}

Source https://phpmd.org/rules/naming.html#shortclassname

Method run has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function run($type, $message, $file, $line, $defined)
Severity: Minor
Found in ErrorHandler/UserErrorHandler.php - About 35 mins to fix

    Missing class import via use statement (line '47', column '14').
    Open

                throw new \Exception('Not valid token value');
    Severity: Minor
    Found in Tools/PhpTokenBase.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method query has a boolean flag argument $pager, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function query($sql, $pager = false)
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '42', column '13').
    Open

            throw new \RuntimeException('Unknown data type');
    Severity: Minor
    Found in Tools/ModelParams.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method addConnection has a boolean flag argument $default, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function addConnection(DbConnection $conn, $default = false)

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method getAll has a boolean flag argument $filter, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getAll($filter = false, $pager = false)
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '174', column '15').
    Open

                    throw new \Exception('Not found model id!');
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method getAll has a boolean flag argument $pager, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getAll($filter = false, $pager = false)
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method __construct has a boolean flag argument $case_sensitive, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function __construct($case_sensitive = false)
    Severity: Minor
    Found in Validators/Md5Validator.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method find has a boolean flag argument $filter, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function find($filter = false)
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '64', column '21').
    Open

            $real_mime = (new \finfo(FILEINFO_MIME))
    Severity: Minor
    Found in Validators/UploadedFileValidator.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '86', column '14').
    Open

                throw new \InvalidArgumentException($msg);
    Severity: Minor
    Found in DataBase/Loggers/PdoErrorLogger.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method __construct has a boolean flag argument $case_sensitive, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function __construct($case_sensitive = false)
    Severity: Minor
    Found in Validators/Sha1Validator.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method delete has a boolean flag argument $ids, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function delete($ids = false)
    Severity: Minor
    Found in Model/ActiveRecord.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Avoid assigning values to variables in if clauses and the like (line '49', column '18').
    Open

        public function detach(SplObserver $observer)
        {
            if (false !== ($key = array_search($observer, $this->observers, true))) {
                unset($this->observers[$key]);
            }
    Severity: Minor
    Found in Traits/Observable.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid unused parameters such as '$tpl'.
    Open

        public function isCached($tpl)
    Severity: Minor
    Found in View/Adapters/CustomJsonAdapter.php by phpmd

    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

    Avoid assigning values to variables in if clauses and the like (line '49', column '7').
    Open

        public function run(): void
        {
            $route      = $this->getRoute();
            $controller = $route->getController();
            $action     = $route->getActionName();
    Severity: Minor
    Found in Application/Application.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid assigning values to variables in if clauses and the like (line '49', column '7').
    Open

        public function run(): void
        {
            $route      = $this->getRoute();
            $controller = $route->getController();
    
    
    Severity: Minor
    Found in Application/RestApplication.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid unused parameters such as '$path'.
    Open

        public function get($path)
    Severity: Minor
    Found in View/Adapters/JsonAdapter.php by phpmd

    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

    Severity
    Category
    Status
    Source
    Language