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;
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 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 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'];
Method getMinified
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMinified() {
$this->pinpie->times[] = [microtime(true), 'getMinified'];
if (!isset($this->c['getMinified'])) {
$this->c['getMinified'] = [];
}
Function getMinified
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getMinified() {
$this->pinpie->times[] = [microtime(true), 'getMinified'];
if (!isset($this->c['getMinified'])) {
$this->c['getMinified'] = [];
}
- 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
Function getContent
has a Cognitive Complexity of 8 (exceeds 5 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'];
- 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
Function getStaticPathReal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getStaticPathReal() {
$path = rtrim($this->settings['folder'], '/\\') . DIRECTORY_SEPARATOR . ltrim($this->staticPath, '/\\');
$this->pinpie->times[] = [microtime(true), 'processing static path ' . $path];
if ($this->settings['realpath check']) {
$this->pinpie->times[] = [microtime(true), 'realpath check required'];
- 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 false;
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return $this->checkMTime($this->filename, $this->minifiedPath);
Function getStaticUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getStaticUrl() {
if ($this->staticPath === '' OR $this->staticPath === false OR $this->staticPath === null) {
return false;
}
if (!isset($this->c['getStaticUrl'])) {
- 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"