Showing 6 of 15 total issues
File Display.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/*****************************************
* Title : Php Quick Profiler Display Class
* Author : Created by Ryan Campbell
Display
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Display
{
/** @var array */
protected $defaults = array(
Method getConsoleMessages
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getConsoleMessages()
{
$messages = array();
foreach ($this->console->getLogs() as $log) {
switch ($log['type']) {
Method gatherTemplateData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function gatherTemplateData()
{
$consoleMeta = $this->getConsoleMeta();
$speedMeta = $this->getSpeedMeta();
$queryMeta = $this->getQueryMeta();
Function getConsoleMessages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function getConsoleMessages()
{
$messages = array();
foreach ($this->console->getLogs() as $log) {
switch ($log['type']) {
- 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 logMemory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function logMemory($object = null, $name = 'PHP', $literal = false)
{
$memory = memory_get_usage();
$dataType = '';
if (!is_null($object) && !$literal) {
- 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"