symphonycms/symphony-2

View on GitHub
symphony/lib/toolkit/class.frontendpage.php

Summary

Maintainability
F
5 days
Test Coverage

File class.frontendpage.php has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * @package toolkit
 */
Severity: Minor
Found in symphony/lib/toolkit/class.frontendpage.php - About 7 hrs to fix

    Function __buildPage has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        private function __buildPage()
        {
            $start = precision_timer();
    
            if (!$page = $this->resolvePage()) {
    Severity: Minor
    Found in symphony/lib/toolkit/class.frontendpage.php - About 6 hrs 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

    Method __buildPage has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function __buildPage()
        {
            $start = precision_timer();
    
            if (!$page = $this->resolvePage()) {
    Severity: Major
    Found in symphony/lib/toolkit/class.frontendpage.php - About 5 hrs to fix

      Function resolvePage has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function resolvePage($page = null)
          {
              if ($page) {
                  $this->_page = $page;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/class.frontendpage.php - About 4 hrs 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 generate has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          public function generate($page = null)
          {
              $full_generate = true;
              $devkit = null;
              $output = null;
      Severity: Minor
      Found in symphony/lib/toolkit/class.frontendpage.php - About 3 hrs 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

      Method generate has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function generate($page = null)
          {
              $full_generate = true;
              $devkit = null;
              $output = null;
      Severity: Major
      Found in symphony/lib/toolkit/class.frontendpage.php - About 2 hrs to fix

        Function processDatasources has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function processDatasources($datasources, XMLElement &$wrapper, array $params = array())
            {
                if (trim($datasources) == '') {
                    return;
                }
        Severity: Minor
        Found in symphony/lib/toolkit/class.frontendpage.php - About 2 hrs 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

        Method resolvePage has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function resolvePage($page = null)
            {
                if ($page) {
                    $this->_page = $page;
                }
        Severity: Major
        Found in symphony/lib/toolkit/class.frontendpage.php - About 2 hrs to fix

          Method processDatasources has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function processDatasources($datasources, XMLElement &$wrapper, array $params = array())
              {
                  if (trim($datasources) == '') {
                      return;
                  }
          Severity: Major
          Found in symphony/lib/toolkit/class.frontendpage.php - About 2 hrs to fix

            Function processEvents has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                private function processEvents($events, XMLElement &$wrapper)
                {
                    /**
                     * Manipulate the events array and event element wrapper
                     * @delegate FrontendProcessEvents
            Severity: Minor
            Found in symphony/lib/toolkit/class.frontendpage.php - About 2 hrs 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 __findDatasourceOrder has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                private function __findDatasourceOrder($dependenciesList)
                {
                    if (!is_array($dependenciesList) || empty($dependenciesList)) {
                        return;
                    }
            Severity: Minor
            Found in symphony/lib/toolkit/class.frontendpage.php - About 1 hr 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

            Method processEvents has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function processEvents($events, XMLElement &$wrapper)
                {
                    /**
                     * Manipulate the events array and event element wrapper
                     * @delegate FrontendProcessEvents
            Severity: Minor
            Found in symphony/lib/toolkit/class.frontendpage.php - About 1 hr to fix

              Method __findDatasourceOrder has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function __findDatasourceOrder($dependenciesList)
                  {
                      if (!is_array($dependenciesList) || empty($dependenciesList)) {
                          return;
                      }
              Severity: Minor
              Found in symphony/lib/toolkit/class.frontendpage.php - About 1 hr to fix

                There are no issues that match your filters.

                Category
                Status