NeroReflex/Gishiki

View on GitHub

Showing 176 of 176 total issues

Function loadField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function loadField(Table &$table, array $fieldDefinition, $fieldName = null)
    {
        $field = new GenericCollection($fieldDefinition);

        if ((!$field->has('name')) || (!is_string($field->get('name'))) || (strlen($field->get('name')) <= 0)) {
Severity: Minor
Found in src/Core/MVC/Model/ActiveRecordStructureTrait.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function loadRelation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function loadRelation(Column &$column, $className, $propName)
    {
        if (!class_exists($className)) {
            throw new ActiveRecordException("The class $className doesn't exists.", 109);
        }
Severity: Minor
Found in src/Core/MVC/Model/ActiveRecordStructureTrait.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function connect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect($name, array $details) : Logger
    {
        //check for the logger name
        if ((!is_string($name)) || (strlen($name) <= 0)) {
            throw new \InvalidArgumentException('The logger name must be given as a valid non-empty string');
Severity: Minor
Found in src/Logging/LoggerManager.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Missing class import via use statement (line '87', column '50').
Open

        $this->loader = (is_null($loader)) ? new \Twig_Loader_Filesystem($templatesDirectory) : $loader;

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 '153', column '32').
Open

        $reflectedAction = new \ReflectionMethod($controllerName, $controllerAction);
Severity: Minor
Found in src/Core/Router/Route.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 '58', column '23').
Open

            throw new \InvalidArgumentException('The plain message to be encrypted must be given as a non-empty string');

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 '201', column '23').
Open

            throw new \InvalidArgumentException('The message to be hashed must be given as a valid non-empty string');
Severity: Minor
Found in src/Security/Hashing/Algorithm.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 '309', column '23').
Open

            throw new \InvalidArgumentException('The resulting key length for the PBKDF2 function must be a positive non-zero integer', 2);
Severity: Minor
Found in src/Security/Hashing/Algorithm.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 '23').
Open

            throw new \InvalidArgumentException('the field data cannot be a php object or an extension native resource');

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 '195', column '23').
Open

            throw new \RuntimeException('Invalid response type ('.gettype($this->response).'): cannot be emitted');
Severity: Minor
Found in src/Core/Application.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

Avoid too many return statements within this method.
Open

        return $str[$len - 1] != '.';
Severity: Major
Found in src/Algorithms/Strings/SimpleLexer.php - About 30 mins to fix

    Missing class import via use statement (line '147', column '36').
    Open

            $reflectedController = new \ReflectionClass($controllerName);
    Severity: Minor
    Found in src/Core/Router/Route.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 '169', column '23').
    Open

                throw new \InvalidArgumentException('The encrypted message to be decrypted must be given as a non-empty string');

    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 '91', column '23').
    Open

                throw new \InvalidArgumentException('The secure key must be given as a non-empty string that is the hex representation of the real key');

    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 '53', column '23').
    Open

                throw new \InvalidArgumentException('the binary unsafe content must be given as a string');
    Severity: Minor
    Found in src/Algorithms/Base64.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 '88', column '23').
    Open

                throw new \InvalidArgumentException('the base64 of a string is represented as another string');
    Severity: Minor
    Found in src/Algorithms/Base64.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 '45', column '23').
    Open

                throw new \InvalidArgumentException('The collection of properties and nested data must be expressed as an array: '.gettype($items).' given');

    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 '116', column '23').
    Open

                throw new \InvalidArgumentException('The ordering mus be given as ASC or DESC (see FieldOrdering)');

    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 '111', column '23').
    Open

                throw new \InvalidArgumentException('The plain message to be encrypted must be given as a non-empty string');

    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 '122', column '23').
    Open

                throw new \InvalidArgumentException('The serialized private key must be a string');

    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

    Severity
    Category
    Status
    Source
    Language