symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

    public function appendNavigation()
    {
        $nav = $this->getNavigationArray();

        /**
Severity: Minor
Found in symphony/lib/toolkit/class.administrationpage.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

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

<?php

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

    Function __viewEdit has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __viewEdit()
        {
            $this->setPageType('form');
            $fields = array("title"=>null, "handle"=>null, "parent"=>null, "params"=>null, "type"=>null, "data_sources"=>null);
            $existing = $fields;
    Severity: Minor
    Found in symphony/content/content.blueprintspages.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 collapsible has 164 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            objects.each(function collapsible(index) {
                var object = $(this),
                    storage = settings.storage + '.' + index + '.collapsed';
    
                var getDuration = function (duration) {
    Severity: Major
    Found in symphony/assets/js/src/symphony.collapsible.js - About 6 hrs to fix

      Method __viewIndex has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __viewIndex()
          {
              $canonical_link = '/system/extensions/';
              $this->setPageType('table');
              $this->setTitle(__('%1$s &ndash; %2$s', array(__('Extensions'), __('Symphony'))));
      Severity: Major
      Found in symphony/content/content.systemextensions.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 __viewEdit has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __viewEdit()
            {
                if (!$section_id = SectionManager::fetchIDFromHandle($this->_context['section_handle'])) {
                    Administration::instance()->throwCustomError(
                        __('The Section, %s, could not be found.', array('<code>' . $this->_context['section_handle'] . '</code>')),
        Severity: Minor
        Found in symphony/content/content.publish.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 __viewIndex has 159 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __viewIndex($resource_type)
            {
                $manager = ResourceManager::getManagerFromType($resource_type);
                $friendly_resource = ($resource_type === ResourceManager::RESOURCE_TYPE_EVENT) ? __('Event') : __('DataSource');
                $context = Administration::instance()->getPageCallback();
        Severity: Major
        Found in symphony/lib/toolkit/class.resourcespage.php - About 6 hrs to fix

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

              public static function fetch($type, array $select = array(), array $where = array(), $order_by = null)
              {
                  $manager = self::getManagerFromType($type);
          
                  if (!isset($manager)) {
          Severity: Minor
          Found in symphony/lib/toolkit/class.resourcemanager.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

          Function symphonyNotify has 156 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.symphonyNotify = function(options) {
                  var objects = this,
                      settings = {
                          items: 'p.notice',
                          storage: 'symphony.notify.' + Symphony.Context.get('root').replace('http://', '')
          Severity: Major
          Found in symphony/assets/js/src/symphony.notify.js - About 6 hrs to fix

            Function Symphony has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

            var Symphony = (function($, crossroads) {
                'use strict';
            
                // Internal Symphony storage
                var Storage = {
            Severity: Minor
            Found in symphony/assets/js/src/symphony.js - 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 __viewEdit has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __viewEdit()
                {
                    $section_id = $this->_context['id'];
                    $section = (new SectionManager)->select()->section($section_id)->execute()->next();
            
            
            Severity: Minor
            Found in symphony/content/content.blueprintssections.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 delete has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function delete($entries, $section_id = null)
                  {
                      $needs_data = true;
              
                      if (!is_array($entries)) {
              Severity: Minor
              Found in symphony/lib/toolkit/class.entrymanager.php - About 5 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 view has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function view()
                  {
                      if (isset($this->_context['token']) && $this->_context['action'] === 'reset-password') {
                          if (Administration::instance()->loginFromToken($this->_context['token'])) {
                              if (Administration::instance()->isLoggedIn()) {
              Severity: Minor
              Found in symphony/content/content.login.php - About 5 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

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

              <?php
              
              /**
               * @package toolkit
               */
              Severity: Minor
              Found in symphony/lib/toolkit/class.emailgateway.php - About 5 hrs to fix

                Method buildSingleWhereClauseFromArray has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    final public function buildSingleWhereClauseFromArray($k, $c)
                    {
                        $op = '=';
                        if (is_object($c)) {
                            if (!($c instanceof DatabaseSubQuery)) {
                Severity: Major
                Found in symphony/lib/toolkit/trait.databasewheredefinition.php - About 5 hrs to fix

                  Method __formAction has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function __formAction()
                      {
                          $fields = $_POST['fields'];
                          $this->_errors = array();
                          $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::EVENT);
                  Severity: Major
                  Found in symphony/content/content.blueprintsevents.php - About 5 hrs to fix

                    Function Calendar has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Symphony.Interface.Calendar = function() {
                            var template = '<div class="calendar"><nav><a class="clndr-previous-button">previous</a><div class="switch"><ul class="months"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><ul class="years"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul></div><a class="clndr-next-button">next</a></nav><table><thead><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr></thead><tbody><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr><tr><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td><td><span></span></td></tr></tbody></table></div>',
                                context, calendar, storage, format, datetime, clndr;
                    
                            var init = function(element) {
                    Severity: Major
                    Found in symphony/assets/js/src/symphony.calendar.js - About 5 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language