kiler129/TorrentGhost

View on GitHub

Showing 112 of 112 total issues

The method parseFeedXml() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Open

    public function parseFeedXml($feed)
    {
        $feed = simplexml_load_string($feed);
        if ($feed === false) {
            $this->logger->error('RSS XML parsing failed in ' . $this->getName(), libxml_get_errors());
Severity: Minor
Found in src/Aggregator/RssAggregator.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method setParametersOnInstance() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Open

    private function setParametersOnInstance(ConfigurationInterface $instance)
    {
        $classReflection = new \ReflectionObject($instance);

        foreach ($this->instanceParameters as $paramName => $paramValue) {

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

Only one argument is allowed per line in a multi-line function call
Open

            '\noFlash\TorrentGhost\Configuration\TorrentGhostConfiguration', $this->rawConfiguration['torrentGhost']

Only one argument is allowed per line in a multi-line function call
Open

            ($realDestination) ?: 'php://stdout', Shout::FILE_APPEND
Severity: Minor
Found in src/Command/RunCommand.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

                'Failed to parse configuration: ' . $e->getMessage() . ' at line ' . $e->getParsedLine(), 0, $e

Only one argument is allowed per line in a multi-line function call
Open

                'Failed to parse configuration: ' . $e->getMessage() . ' at line ' . $e->getParsedLine(), 0, $e

Line exceeds 120 characters; contains 259 characters
Open

                        (?<NameStartChar> [:A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\x{2FF}\\x{370}-\\x{37D}\\x{37F}-\\x{1FFF}\\x{200C}-\\x{200D}\\x{2070}-\\x{218F}\\x{2C00}-\\x{2FEF}\\x{3001}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFFD}\\x{10000}-\\x{EFFFF}])

Line exceeds 120 characters; contains 127 characters
Open

            ->setHelp('Regular expressions are pain in the ass. This command provides easy way to simulate input on any rule.')

Line exceeds 120 characters; contains 127 characters
Open

                        'stream_select() failed. It may be caused by operating system internal problem or sending signal to ' .
Severity: Minor
Found in src/Application.php by phpcodesniffer

Line exceeds 120 characters; contains 123 characters
Open

        $lastErrorText = (isset($this->pregErrors[$lastError])) ? $this->pregErrors[$lastError] : "preg error #$lastError";

Line exceeds 120 characters; contains 152 characters
Open

    // * @var null|string Location to save .torrent files downloaded from links obtained by this aggregator instance. If null parent value will be used.

Expected 1 space after IF keyword; 0 found
Open

        if($feed === false) {
Severity
Category
Status
Source
Language