kai-jacobsen/kontentblocks

View on GitHub

Showing 4,293 of 4,293 total issues

Missing class import via use statement (line '67', column '40').
Open

        $environment->addExtension(new \Twig_Extension_Debug());
Severity: Minor
Found in core/Templating/Twig.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 process has a boolean flag argument $single, which is a certain sign of a Single Responsibility Principle violation.
Open

                $single = true,
Severity: Minor
Found in core/Utils/ImageResize.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 '43', column '23').
Open

            throw new \BadMethodCallException('Invalid Module passed to Factory');
Severity: Minor
Found in core/Modules/ModuleFactory.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 '42', column '35').
Open

                $reflection = new \ReflectionClass($modelName);
Severity: Minor
Found in core/Panels/PanelRegistry.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 '102', column '24').
Open

            return new \Twig_SimpleFunction(
Severity: Minor
Found in core/Templating/Twig.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 aq_resize has a boolean flag argument $upscale, which is a certain sign of a Single Responsibility Principle violation.
Open

        function aq_resize($attachment, $width = null, $height = null, $crop = null, $single = true, $upscale = false)
Severity: Minor
Found in core/Utils/ImageResize.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 sync has a boolean flag argument $addslashes, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function sync($addslashes = false)
Severity: Minor
Found in core/Modules/ModuleModel.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 getSize has a boolean flag argument $upscale, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function getSize($size = 'thumbnail', $crop = true, $upscale = true)
Severity: Minor
Found in core/Utils/AttachmentHandler.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 '108', column '45').
Open

                            $filenode = new \SplFileInfo($node->getRealPath());
Severity: Minor
Found in core/Modules/ModuleViewFilesystem.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 updateModuleData has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function updateModuleData($data = array(), $force = false)
Severity: Minor
Found in core/Modules/Module.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 setupViewModel has a boolean flag argument $forcenew, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setupViewModel($forcenew = false)
Severity: Minor
Found in core/Panels/AbstractPanel.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 remoteConcatGet has a boolean flag argument $blocking, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function remoteConcatGet($postId = null, $blocking = false, $host = null, $args = array())
Severity: Minor
Found in core/Utils/Utilities.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 '91', column '24').
Open

            return new \WP_Error(
Severity: Minor
Found in core/Panels/PanelRegistry.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 editor has a boolean flag argument $media, which is a certain sign of a Single Responsibility Principle violation.
Open

    static public function editor($id, $data, $name = null, $media = false, $args = array())
Severity: Minor
Found in core/Utils/Utilities.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 slot has a boolean flag argument $returnModule, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function slot($pos = null, $returnModule = false, $args = array())

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 setupViewModel has a boolean flag argument $forcenew, which is a certain sign of a Single Responsibility Principle violation.
Open

    private function setupViewModel($forcenew = false)
Severity: Minor
Found in core/Modules/Module.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 '111', column '45').
Open

                            $filenode = new \SplFileInfo($node->getRealPath());
Severity: Minor
Found in core/Modules/ModuleViewFilesystem.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 '81', column '31').
Open

            $reflection = new \ReflectionClass($args['class']);
Severity: Minor
Found in core/Panels/PanelRegistry.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 export has a boolean flag argument $keepSettings, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function export($keepSettings = false)
Severity: Minor
Found in core/Modules/ModuleProperties.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

Function setupViewModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function setupViewModel($forcenew = false)
    {
        if (!is_null($this->viewModel)) {
            if ($forcenew === false) {
                return $this->viewModel;
Severity: Minor
Found in core/Modules/Module.php - About 25 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

Severity
Category
Status
Source
Language