symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

    private function __buildPage($page)
    {
        $is_logged_in = static::isLoggedIn();

        if (empty($page) || is_null($page)) {
Severity: Minor
Found in symphony/lib/core/class.administration.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 content.blueprintsevents.php has 501 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @package content
 */

Severity: Major
Found in symphony/content/content.blueprintsevents.php - About 1 day to fix

    Function symphonyDuplicator has 200 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.symphonyDuplicator = function(options) {
            var objects = this,
                settings = {
                    instances: '> li:not(.template)',
                    templates: '> li.template',
    Severity: Major
    Found in symphony/assets/js/src/symphony.duplicator.js - About 1 day to fix

      General has 53 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class General
      {
          /**
           * Convert any special characters into their entity equivalents. Since
           * Symphony 2.3, this function assumes UTF-8 and will not double
      Severity: Major
      Found in symphony/lib/toolkit/class.general.php - About 7 hrs to fix

        Function symphonyDrawer has 187 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.fn.symphonyDrawer = function(options) {
                var objects = this,
                    wrapper = $('#wrapper'),
                    contents = $('#contents'),
                    form = contents.find('> form'),
        Severity: Major
        Found in symphony/assets/js/src/symphony.drawer.js - About 7 hrs to fix

          Function __form has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __form()
              {
                  // Handle unknown context
                  if (!in_array($this->_context['action'], array('new', 'edit'))) {
                      Administration::instance()->errorPageNotFound();
          Severity: Minor
          Found in symphony/content/content.systemauthors.php - About 7 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 upgrade has 185 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function upgrade()
              {
                  // Upgrade DB settings
                  $db = Symphony::Configuration()->get('database');
                  $db['driver'] = 'mysql';
          Severity: Major
          Found in install/migrations/3.0.0.php - About 7 hrs to fix

            Method __viewEdit has 184 lines of code (exceeds 25 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: Major
            Found in symphony/content/content.publish.php - About 7 hrs to fix

              File field.author.php has 473 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * @package toolkit
               */
              Severity: Minor
              Found in symphony/lib/toolkit/fields/field.author.php - About 7 hrs to fix

                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 symphonyCollapsible has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.fn.symphonyCollapsible = function(options) {
                          var objects = this,
                              settings = {
                                  items: '.instance',
                                  handles: '.frame-header',
                  Severity: Major
                  Found in symphony/assets/js/src/symphony.collapsible.js - About 7 hrs to fix

                    Function __formAction has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __formAction()
                        {
                            $fields = $_POST['fields'];
                            $this->_errors = array();
                            $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::EVENT);
                    Severity: Minor
                    Found in symphony/content/content.blueprintsevents.php - About 7 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 duplicators has 177 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            objects.each(function duplicators() {
                                var duplicator = $(this),
                                    list = duplicator.find('> ol'),
                                    apply = $('<fieldset class="apply" />'),
                                    selector = $('<select />'),
                    Severity: Major
                    Found in symphony/assets/js/src/symphony.duplicator.js - About 7 hrs to fix

                      Method __actionNew has 174 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __actionNew()
                          {
                              if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
                                  $canProceed = true;
                                  $edit = ($this->_context['action'] === "edit");
                      Severity: Major
                      Found in symphony/content/content.blueprintssections.php - About 6 hrs to fix

                        Method __actionEdit has 174 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __actionEdit()
                            {
                                if (!$author_id = $this->_context['id']) {
                                    redirect(SYMPHONY_URL . '/system/authors/');
                                }
                        Severity: Major
                        Found in symphony/content/content.systemauthors.php - About 6 hrs to fix

                          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 __actionNew has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function __actionNew()
                                {
                                    if (is_array($_POST['action']) && array_key_exists('save', $_POST['action'])) {
                                        $section_id = SectionManager::fetchIDFromHandle($this->_context['section_handle']);
                            
                            
                            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

                            Function Symphony has 171 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var Symphony = (function($, crossroads) {
                                'use strict';
                            
                                // Internal Symphony storage
                                var Storage = {
                            Severity: Major
                            Found in symphony/assets/js/src/symphony.js - About 6 hrs to fix

                              Method __viewEdit has 170 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function __viewEdit()
                                  {
                                      $section_id = $this->_context['id'];
                                      $section = (new SectionManager)->select()->section($section_id)->execute()->next();
                              
                              
                              Severity: Major
                              Found in symphony/content/content.blueprintssections.php - About 6 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

                                Severity
                                Category
                                Status
                                Source
                                Language