TikiWiki/tiki-manager

View on GitHub

Showing 2,245 of 2,245 total issues

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

    abstract public function info($targetFolder, $raw = 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

Missing class import via use statement (line '51', column '23').
Open

            throw new \Exception('Failed to retrieve archive file from ' . $this->downloadUrl);
Severity: Minor
Found in src/Manager/Update/Src.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 '206', column '27').
Open

                throw new \Exception($error);
Severity: Minor
Found in src/Command/CreateInstanceCommand.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 '450', column '33').
Open

                $iterator = new \FilesystemIterator($dir);
Severity: Minor
Found in src/Command/Helper/CommandHelper.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 renderInstancesTable has a boolean flag argument $all_infos, which is a certain sign of a Single Responsibility Principle violation.
Open

    public static function renderInstancesTable($output, $rows, bool $all_infos = false)
Severity: Minor
Found in src/Command/Helper/CommandHelper.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 '63', column '23').
Open

            throw new \Exception('Error extracting files.');
Severity: Minor
Found in src/Manager/Update/Phar.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 '30', column '23').
Open

            throw new \Exception('Failed to download file at: ' . $url, 0, $previousException);
Severity: Minor
Found in src/Traits/FileDownload.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 '288', column '23').
Open

            throw new \RuntimeException(
Severity: Minor
Found in src/Command/Helper/CommandHelper.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 runCommands has a boolean flag argument $output, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function runCommands($commands, $output = false)
Severity: Minor
Found in src/Libs/Host/Local.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 info has a boolean flag argument $raw, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function info($targetFolder, $raw = false)
Severity: Minor
Found in src/Libs/VersionControl/Git.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 '103', column '27').
Open

                throw new \Exception('Failed to update tiki-manager.phar with the new version');
Severity: Minor
Found in src/Manager/Update/Phar.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 '59', column '35').
Open

                        throw new \RuntimeException('Invalid instance selected.');

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 '76', column '35').
Open

                        throw new \RuntimeException('Invalid user groups selected.');

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

    public static function renderInstanceTags($output, $rows, $multiple = false)
Severity: Minor
Found in src/Command/Helper/CommandHelper.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 '163', column '27').
Open

                throw new \Exception($error);
Severity: Minor
Found in src/Command/ImportInstanceCommand.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 runCommands has a boolean flag argument $output, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function runCommands($commands, $output = false)
Severity: Minor
Found in src/Libs/Host/SSHWrapperAdapter.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 stash has a boolean flag argument $includeNonTracked, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function stash(string $targetFolder, bool $includeNonTracked = false)
Severity: Minor
Found in src/Libs/VersionControl/Git.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 '60', column '23').
Open

            throw new \InvalidArgumentException('Message must be a string or an instance of Stringable.');
Severity: Minor
Found in src/Logger/ConsoleLogger.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

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $instanceIds = $input->getOption('instances');
        $simpleTextOutput = $input->getOption('text-output');

Severity: Minor
Found in src/Command/MonitorInstanceCommand.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

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

    public static function getInstancesInfo(array $instances, bool $all_infos = false): ?array
    {
        $instancesInfo = null;

        foreach ($instances as $instance) {
Severity: Minor
Found in src/Command/Helper/CommandHelper.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