symphonycms/symphony-2

View on GitHub

Showing 714 of 844 total issues

Method buildDSRetrievalSQL has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog(
                get_called_class() . '::buildDSRetrievalSQL()',
Severity: Major
Found in symphony/lib/toolkit/fields/field.author.php - About 4 hrs to fix

    Function filter has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        public function filter($field, array $values, $operator = 'or')
        {
            General::ensureType([
                'operator' => ['var' => $operator, 'type' => 'string'],
            ]);
    Severity: Minor
    Found in symphony/lib/toolkit/class.entryquery.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 __viewNew has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __viewNew()
        {
            $this->setPageType('form');
            $this->setTitle(__('%1$s – %2$s', array(__('Sections'), __('Symphony'))));
            $this->appendSubheading(__('Untitled'));
    Severity: Minor
    Found in symphony/content/content.blueprintssections.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

    ExtensionManager has 31 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ExtensionManager implements FileResource
    {
        /**
         * An array of all the objects that the Manager is responsible for.
         * Defaults to an empty array.
    Severity: Minor
    Found in symphony/lib/toolkit/class.extensionmanager.php - About 3 hrs to fix

      FieldTagList has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class FieldTagList extends Field implements ExportableField, ImportableField
      {
          public function __construct()
          {
              parent::__construct();
      Severity: Minor
      Found in symphony/lib/toolkit/fields/field.taglist.php - About 3 hrs to fix

        Symphony has 31 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class Symphony implements Singleton
        {
            /**
             * An instance of the Symphony class, either `Administration` or `Frontend`.
             * @var Symphony
        Severity: Minor
        Found in symphony/lib/core/class.symphony.php - About 3 hrs to fix

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

            Function listAll has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function listAll()
                {
                    $result = array();
                    $structure = General::listStructure(DATASOURCES, '/data.[\\w-]+.php/', false, 'ASC', DATASOURCES);
            
            
            Severity: Minor
            Found in symphony/lib/toolkit/class.datasourcemanager.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 fetch has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function fetch(array $select = array(), array $where = array(), $order_by = null)
                {
                    $extensions = self::listAll();
                    $data = array();
            
            
            Severity: Minor
            Found in symphony/lib/toolkit/class.extensionmanager.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 canAccessPage has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public function canAccessPage()
                {
                    $nav = $this->getNavigationArray();
                    $page = '/' . trim(getCurrentPage(), '/') . '/';
            
            
            Severity: Minor
            Found in symphony/lib/toolkit/class.administrationpage.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 listAll has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function listAll()
                {
                    $result = array();
                    $structure = General::listStructure(EVENTS, '/event.[\\w-]+.php/', false, 'ASC', EVENTS);
            
            
            Severity: Minor
            Found in symphony/lib/toolkit/class.eventmanager.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

            FieldCheckbox has 30 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class FieldCheckbox extends Field implements ExportableField, ImportableField
            {
                public function __construct()
                {
                    parent::__construct();
            Severity: Minor
            Found in symphony/lib/toolkit/fields/field.checkbox.php - About 3 hrs to fix

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

                  public function upgrade()
                  {
                      // Upgrade DB settings
                      $db = Symphony::Configuration()->get('database');
                      $db['driver'] = 'mysql';
              Severity: Minor
              Found in install/migrations/3.0.0.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 sort has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function sort($field, $direction = 'ASC')
                  {
                      General::ensureType([
                          'field' => ['var' => $field, 'type' => 'string'],
                          'direction' => ['var' => $direction, 'type' => 'string'],
              Severity: Minor
              Found in symphony/lib/toolkit/class.entryquery.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 about has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function about($name, $rawXML = false)
                  {
                      // See if the extension has the new meta format
                      if (file_exists(self::__getClassPath($name) . '/extension.meta.xml')) {
                          try {
              Severity: Minor
              Found in symphony/lib/toolkit/class.extensionmanager.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 exec has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function exec($force_connection_method = null)
                  {
                      if ($force_connection_method !== self::FORCE_SOCKET && self::isCurlAvailable()) {
                          $ch = curl_init();
              
              
              Severity: Minor
              Found in symphony/lib/toolkit/class.gateway.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 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

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

                Method view has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function view()
                    {
                        $this->setPageType('form');
                        $this->setTitle(__('%1$s &ndash; %2$s', array(__('Preferences'), __('Symphony'))));
                        $this->addElementToHead(new XMLElement('link', null, array(
                Severity: Major
                Found in symphony/content/content.systempreferences.php - About 3 hrs to fix

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

                  <?php
                  
                  /**
                   * @package content
                   */
                  Severity: Minor
                  Found in install/lib/class.installerpage.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language