eidng8/sttbot

View on GitHub

Showing 223 of 223 total issues

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

        MissionStep $step,
        int $idxStep,
        int $idxMission,
        int $idxEpisode,
        string $type
Severity: Minor
Found in src/Wiki/Analyst.php - About 35 mins to fix

There must not be more than one property declared per statement
Open

    public function trait($name): int
Severity: Minor
Found in src/Wiki/Indexer.php by phpcodesniffer

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

    protected function stats(CrewMember $member)
    {
        foreach ($member->skills as $skill => $val) {
            if (empty($val)) {
                continue;
Severity: Minor
Found in src/Wiki/Templates/CrewList.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 parseMWHead has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseMWHead(string $head): array
    {
        $lines = explode("\n", $head);

        $intro = [];
Severity: Minor
Found in src/Wiki/Templates/Mission.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

Possible parse error: non-abstract method defined as abstract
Open

    public function trait($name): int
Severity: Minor
Found in src/Wiki/Indexer.php by phpcodesniffer

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

    public function parse(): array
    {
        parent::parse();
        $mission = [];

Severity: Minor
Found in src/Wiki/Templates/InfoBox.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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(string $what = null): array
    {
        if ($this->models) {
            return empty($what) ? $this->models : $this->models[$what];
        }
Severity: Minor
Found in src/Wiki/Templates/MissionList.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 dehydrate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function dehydrate(&$title, &$value): void
    {
        $trim = "{}[] \t\r\n\xb\0";
        $title = trim(strtolower($title), $trim);
        switch ($title) {
Severity: Minor
Found in src/Wiki/Templates/InfoBox.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

Expected "function abc(...)"; found "function abc(...)"
Open

    public function trait($name): int
Severity: Minor
Found in src/Wiki/Indexer.php by phpcodesniffer

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

    public function query(bool $new = false): Query
Severity: Minor
Found in src/Wiki/Api/Api.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 toc has a boolean flag argument $enabled, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function toc(bool $enabled = false): void
Severity: Minor
Found in src/Wiki/Api/Parse.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 canPassCadet has a boolean flag argument $critical, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function canPassCadet(MissionStep $step, bool $critical = false)
Severity: Minor
Found in src/Wiki/Models/CrewMember.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 parse has a boolean flag argument $new, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function parse(bool $new = false): Parse
Severity: Minor
Found in src/Wiki/Api/Api.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 followRedirects has a boolean flag argument $follow, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function followRedirects(bool $follow = true): void
Severity: Minor
Found in src/Wiki/Api/Parse.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 get has a boolean flag argument $fetch, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function get(string $text, bool $fetch = false): ?string
Severity: Minor
Found in src/Wiki/Api/ExpandTemplates.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 get has a boolean flag argument $fetch, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function get(bool $fetch = false): ?array
Severity: Minor
Found in src/Wiki/Api/Parse.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 removeFile has a boolean flag argument $dir, which is a certain sign of a Single Responsibility Principle violation.
Open

    private function removeFile($file, $dir = false)
Severity: Minor
Found in tests/Traits/Wiki/CacheTest.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 bestMember has a boolean flag argument $lock, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $lock = false
Severity: Minor
Found in src/Wiki/Analyst.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 options has a boolean flag argument $merge, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function options(array $options = null, bool $merge = false): array
Severity: Minor
Found in src/Traits/Wiki/Request.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 checkRecord has a boolean flag argument $err, which is a certain sign of a Single Responsibility Principle violation.
Open

    private function checkRecord(array $record, bool $err = false)
Severity: Minor
Found in tests/Log/LogTest.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

Severity
Category
Status
Source
Language