Showing 40 of 40 total issues
File Staticon.php
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace pinpie\pinpie\Tags;
use \pinpie\pinpie\PP as PP;
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 getDefaults
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDefaults() {
$cache = []; // Settings for current cacher
$other = []; // You can put some custom setting here
$databases = []; // To store database settings
$debug = false; // Enables PinPIE::report() output. You can use it to enable your own debug mode. Globally available through PinPIE::$conf->debug.
File Tag.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace pinpie\pinpie\Tags;
use \pinpie\pinpie;
Function checkAndRunGzip
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function checkAndRunGzip() {
$r = false;
if (!$this->checkMTime($this->filename, $this->filename . '.gz')) {
$this->pinpie->times[] = [microtime(true), '#gzipping start ' . $this->filename];
if (is_file($this->filename)) {
- 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 __construct
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(PP $pinpie, $settings, $fulltag, $type, $placeholder, $template, $cachetime, $fullname, Tag $parentTag = null, $priority = 10000, $depth = 0) {
$this->time = [
'start' => microtime(true),
'end' => (float)0,
'total' => (float)0,
Method replacePlaceholdersRecursive
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function replacePlaceholdersRecursive($content, &$depth) {
$depth--;
if (!$depth) {
$this->error('Max depth reached while calling replacePlaceholdersRecursive()');
return '';
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 findFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function findFile($url) {
$this->findPageFileRecur++;
if ($this->findPageFileRecur > $this->pinpie->conf->pinpie['route to parent']) {
return false;
}
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(PP $pinpie, $settings, $fulltag, $type, $placeholder, $template, $cachetime, $fullname, Tag $parentTag = null, $priority = 10000, $depth = 0) {
Method __construct
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(PP $pinpie, $settings, $fulltag, $type, $placeholder, $template, $cachetime, $fullname, Tag $parentTag = null, $priority = 10000, $depth = 0) {
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 draw
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function draw() {
$content = '';
$this->filetime = filemtime($this->filename);
if (!$this->cachetime OR $this->cachebleParents) {
//стоит запрет кеширования или не нужно кешировать, если один из родителей будет закеширован
Function findFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function findFile($url) {
$this->findPageFileRecur++;
if ($this->findPageFileRecur > $this->pinpie->conf->pinpie['route to parent']) {
return false;
}
- 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 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]
Method getContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getContent() {
$this->pinpie->times[] = [microtime(true), 'getContent'];
if (!empty($this->settings['draw function'])) {
$this->content = $this->settings['draw function']($this);
$this->pinpie->times[] = [microtime(true), 'drawn by func'];