symphonycms/symphony-2

View on GitHub
symphony/lib/toolkit/data-sources/class.datasource.section.php

Summary

Maintainability
F
6 days
Test Coverage

Function generate has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

    public function generate(array &$param_pool = null)
    {
        $result = new XMLElement($this->dsParamROOTELEMENT);
        $this->_param_pool = $param_pool;
        $requiresPagination = (!isset($this->dsParamPAGINATERESULTS) ||
Severity: Minor
Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 1 day 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

File class.datasource.section.php has 455 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * @package data-sources
 */
Severity: Minor
Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 6 hrs to fix

    Function processFilters has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        public function processFilters(&$entryQuery)
        {
            if (!is_array($this->dsParamFILTERS) || empty($this->dsParamFILTERS)) {
                return;
            }
    Severity: Minor
    Found in symphony/lib/toolkit/data-sources/class.datasource.section.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

    Function processEntry has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        public function processEntry(Entry $entry)
        {
            $data = $entry->getData();
    
            $xEntry = new XMLElement('entry');
    Severity: Minor
    Found in symphony/lib/toolkit/data-sources/class.datasource.section.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 generate has 150 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function generate(array &$param_pool = null)
        {
            $result = new XMLElement($this->dsParamROOTELEMENT);
            $this->_param_pool = $param_pool;
            $requiresPagination = (!isset($this->dsParamPAGINATERESULTS) ||
    Severity: Major
    Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 6 hrs to fix

      Function setAssociatedEntryCounts has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setAssociatedEntryCounts(XMLElement &$xEntry, Entry $entry)
          {
              $associated_entry_counts = $entry->fetchAllAssociatedEntryCounts($this->_associated_sections);
      
              if (!empty($associated_entry_counts)) {
      Severity: Minor
      Found in symphony/lib/toolkit/data-sources/class.datasource.section.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

      Function processOutputParameters has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function processOutputParameters(Entry $entry, $field_id, array $data)
          {
              if (!isset($this->dsParamPARAMOUTPUT)) {
                  return;
              }
      Severity: Minor
      Found in symphony/lib/toolkit/data-sources/class.datasource.section.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 processFilters has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function processFilters(&$entryQuery)
          {
              if (!is_array($this->dsParamFILTERS) || empty($this->dsParamFILTERS)) {
                  return;
              }
      Severity: Major
      Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 2 hrs to fix

        Method processEntry has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function processEntry(Entry $entry)
            {
                $data = $entry->getData();
        
                $xEntry = new XMLElement('entry');
        Severity: Major
        Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 2 hrs to fix

          Function processRecordGroup has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function processRecordGroup($element, array $group)
              {
                  $xGroup = new XMLElement($element, null, $group['attr']);
          
                  if (is_array($group['records']) && !empty($group['records'])) {
          Severity: Minor
          Found in symphony/lib/toolkit/data-sources/class.datasource.section.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 processSystemParameters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              public function processSystemParameters(Entry $entry)
              {
                  if (!isset($this->dsParamPARAMOUTPUT)) {
                      return;
                  }
          Severity: Minor
          Found in symphony/lib/toolkit/data-sources/class.datasource.section.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 processOutputParameters has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function processOutputParameters(Entry $entry, $field_id, array $data)
              {
                  if (!isset($this->dsParamPARAMOUTPUT)) {
                      return;
                  }
          Severity: Minor
          Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 1 hr to fix

            Method processRecordGroup has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function processRecordGroup($element, array $group)
                {
                    $xGroup = new XMLElement($element, null, $group['attr']);
            
                    if (is_array($group['records']) && !empty($group['records'])) {
            Severity: Minor
            Found in symphony/lib/toolkit/data-sources/class.datasource.section.php - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status