jacobemerick/pqp

View on GitHub

Showing 6 of 15 total issues

File Display.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*****************************************
 * Title : Php Quick Profiler Display Class
 * Author : Created by Ryan Campbell
Severity: Minor
Found in src/Display.php - About 2 hrs to fix

    Display has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Display
    {
    
        /** @var  array */
        protected $defaults = array(
    Severity: Minor
    Found in src/Display.php - About 2 hrs to fix

      Method getConsoleMessages has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getConsoleMessages()
          {
              $messages = array();
              foreach ($this->console->getLogs() as $log) {
                  switch ($log['type']) {
      Severity: Minor
      Found in src/Display.php - About 1 hr to fix

        Method gatherTemplateData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function gatherTemplateData()
            {
                $consoleMeta = $this->getConsoleMeta();
                $speedMeta = $this->getSpeedMeta();
                $queryMeta = $this->getQueryMeta();
        Severity: Minor
        Found in src/Display.php - About 1 hr to fix

          Function getConsoleMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function getConsoleMessages()
              {
                  $messages = array();
                  foreach ($this->console->getLogs() as $log) {
                      switch ($log['type']) {
          Severity: Minor
          Found in src/Display.php - About 35 mins to fix

          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

              public function logMemory($object = null, $name = 'PHP', $literal = false)
              {
                  $memory = memory_get_usage();
                  $dataType = '';
                  if (!is_null($object) && !$literal) {
          Severity: Minor
          Found in src/Console.php - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language