symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

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

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

    XMLElement has 41 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class XMLElement implements IteratorAggregate
    {
        /**
         * This is an array of HTML elements that are self closing.
         * @var array
    Severity: Minor
    Found in symphony/lib/toolkit/class.xmlelement.php - About 5 hrs to fix

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

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

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

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

          Function buildEntry has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

              public function buildEntry(array $entry)
              {
                  if (!isset($entry['id'], $entry['section_id'], $entry['creation_date'], $entry['modification_date'])) {
                      return $entry;
                  }
          Severity: Minor
          Found in symphony/lib/toolkit/class.entryqueryresult.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

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

              public function __actionEdit()
              {
                  if ($this->_context['action'] !== 'new' && !$page_id = $this->_context['id']) {
                      redirect(SYMPHONY_URL . '/blueprints/pages/');
                  }
          Severity: Major
          Found in symphony/content/content.blueprintspages.php - About 5 hrs to fix

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

                private static function fetch()
                {
                    if (!@is_readable(EXTENSIONS)) {
                        return;
                    }
            Severity: Minor
            Found in symphony/lib/toolkit/class.lang.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

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

                  public function __viewIndex()
                  {
                      $this->setPageType('table');
                      $this->setTitle(__('%1$s &ndash; %2$s', array(__('Authors'), __('Symphony'))));
              
              
              Severity: Minor
              Found in symphony/content/content.systemauthors.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

              EmailGateway has 38 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class EmailGateway
              {
                  protected $_recipients = array();
                  protected $_sender_name;
                  protected $_sender_email_address;
              Severity: Minor
              Found in symphony/lib/toolkit/class.emailgateway.php - About 5 hrs to fix

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

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

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

                      public function __viewIndex()
                      {
                          $this->setPageType('table');
                          $this->setTitle(__('%1$s &ndash; %2$s', array(__('Pages'), __('Symphony'))));
                  
                  
                  Severity: Major
                  Found in symphony/content/content.blueprintspages.php - About 4 hrs to fix

                    Function __viewIndex has a Cognitive Complexity of 32 (exceeds 5 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: Minor
                    Found in symphony/lib/toolkit/class.resourcespage.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 __viewNew has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __viewNew()
                        {
                            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 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

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

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

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

                          public function __viewIndex()
                          {
                              $this->setPageType('table');
                              $this->setTitle(__('%1$s &ndash; %2$s', array(__('Authors'), __('Symphony'))));
                      
                      
                      Severity: Major
                      Found in symphony/content/content.systemauthors.php - About 4 hrs to fix

                        Method __viewNew has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __viewNew()
                            {
                                $this->setPageType('form');
                                $this->setTitle(__('%1$s &ndash; %2$s', array(__('Sections'), __('Symphony'))));
                                $this->appendSubheading(__('Untitled'));
                        Severity: Major
                        Found in symphony/content/content.blueprintssections.php - About 4 hrs to fix

                          Method exec has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function exec($force_connection_method = null)
                              {
                                  if ($force_connection_method !== self::FORCE_SOCKET && self::isCurlAvailable()) {
                                      $ch = curl_init();
                          
                          
                          Severity: Major
                          Found in symphony/lib/toolkit/class.gateway.php - About 4 hrs to fix

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

                                public static function fetch($id = null, $section_id = null, $order = 'ASC', $sortfield = 'sortorder', $type = null, $location = null, $where = null, $restrict = Field::__FIELD_ALL__)
                                {
                                    if (Symphony::Log()) {
                                        Symphony::Log()->pushDeprecateWarningToLog('FieldManager::fetch()', 'FieldManager::select()');
                                    }
                            Severity: Minor
                            Found in symphony/lib/toolkit/class.fieldmanager.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 processParametersInString has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function processParametersInString($value, array $env, $includeParenthesis = true, $escape = false)
                                {
                                    if (trim($value) == '') {
                                        return null;
                                    }
                            Severity: Minor
                            Found in symphony/lib/toolkit/class.datasource.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

                            Severity
                            Category
                            Status
                            Source
                            Language