File PP.php
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace pinpie\pinpie;
use mageekguy\atoum\asserters\boolean;
Function reportTags
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function reportTags() {
if (!$this->conf->debug) {
return false;
}
ob_start();
- Read upRead up
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
Method reportTags
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reportTags() {
if (!$this->conf->debug) {
return false;
}
ob_start();
Function getHashURL
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getHashURL() {
if ($this->hashURL !== false) {
return $this->hashURL;
}
$code = http_response_code();
- Read upRead up
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
Method parseString
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseString($content, $parent = null) {
if (empty($parent)) {
$this->tagPath[] = '/';
} else {
$this->tagPath[] = $parent->type . $parent->name;
Method getHashURL
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHashURL() {
if ($this->hashURL !== false) {
return $this->hashURL;
}
$code = http_response_code();
Method report
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function report() {
if (!$this->conf->debug) {
return false;
}
ob_start();
Method createTag
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createTag($matches, $parent) {
/* $matches
* Tag with new line after tag
array (size=8)
0 => string '[header[!$snippet]template]
Function report
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function report() {
if (!$this->conf->debug) {
return false;
}
ob_start();
- Read upRead up
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
Avoid too many return
statements within this method. Open
return $pathRealpath;