Showing 112 of 112 total issues
The method parseFeedXml() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
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());
- Read upRead up
- Exclude checks
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
Open
private function setParametersOnInstance(ConfigurationInterface $instance)
{
$classReflection = new \ReflectionObject($instance);
foreach ($this->instanceParameters as $paramName => $paramValue) {
- Read upRead up
- Exclude checks
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
Open
'\noFlash\TorrentGhost\Configuration\TorrentGhostConfiguration', $this->rawConfiguration['torrentGhost']
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
($realDestination) ?: 'php://stdout', Shout::FILE_APPEND
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
'Failed to parse configuration: ' . $e->getMessage() . ' at line ' . $e->getParsedLine(), 0, $e
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
'Failed to parse configuration: ' . $e->getMessage() . ' at line ' . $e->getParsedLine(), 0, $e
- Exclude checks
Line exceeds 120 characters; contains 259 characters Open
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}])
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
Open
->setHelp('Regular expressions are pain in the ass. This command provides easy way to simulate input on any rule.')
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
Open
'stream_select() failed. It may be caused by operating system internal problem or sending signal to ' .
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
$lastErrorText = (isset($this->pregErrors[$lastError])) ? $this->pregErrors[$lastError] : "preg error #$lastError";
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
Open
// * @var null|string Location to save .torrent files downloaded from links obtained by this aggregator instance. If null parent value will be used.
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if($feed === false) {
- Exclude checks