modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

Function Event has 299 lines of code (exceeds 25 allowed). Consider refactoring.
Open

})();Ext.lib.Event = function() {
    var loadComplete = false,
        unloadListeners = {},
        retryCount = 0,
        onAvailStack = [],
Severity: Major
Found in manager/assets/ext3/adapter/ext/ext-base-debug.js - About 1 day to fix

    Method Expression has 296 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function Expression($x, $stop=false)
        {
            $operators = array();
            $operands = array();
            $n = false;
    Severity: Major
    Found in manager/min/lib/JSMinPlus.php - About 1 day to fix

      Function password_hash has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

              function password_hash($password, $algo, array $options = array()) {
                  if (!function_exists('crypt')) {
                      trigger_error("Crypt must be loaded for password_hash to function", E_USER_WARNING);
                      return null;
                  }
      Severity: Minor
      Found in core/model/lib/password.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

      Function ExtractEXIFgetImageSize has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

          public function ExtractEXIFgetImageSize() {
              $this->DebugMessage('starting ExtractEXIFgetImageSize()', __FILE__, __LINE__);
      
              if (preg_match('#^http:#i', (string)$this->src) && !$this->sourceFilename && $this->rawImageData) {
                  $this->SourceDataToTempFile();
      Severity: Minor
      Found in core/model/phpthumb/phpthumb.class.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 FirePHP.php has 656 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * *** BEGIN LICENSE BLOCK *****
       *  
       * This file is part of FirePHP (http://www.firephp.org/).
      Severity: Major
      Found in manager/min/lib/FirePHP.php - About 1 day to fix

        Method authenticate has 293 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function authenticate($bucket, $opt = null, $location = null, $redirects = 0, $nothing = null)
            {
                /*
                 * Overriding or extending this class? You can pass the following "magic" keys into $opt.
                 *
        Severity: Major
        Found in core/model/aws/services/s3.class.php - About 1 day to fix

          Function importFiles has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
          Open

              public function importFiles($allowedfiles, $parent, $filepath, $files, $context= 'web', $class= 'modStaticResource', $basefilepath= '', $elements = array()) {
                  if (!is_array($files))
                      return;
                  if ($parent > 0) {
                      if ($parentResource= $this->modx->getObject('modResource', $parent)) {
          Severity: Minor
          Found in core/model/modx/import/modstaticimport.class.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

          Function UserGroup has 289 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          MODx.panel.UserGroup = function(config) {
              config = config || {};
              Ext.applyIf(config,{
                  id: 'modx-panel-user-group'
                  ,cls: 'container form-with-labels'
          Severity: Major
          Found in manager/assets/modext/widgets/security/modx.panel.user.group.js - About 1 day to fix

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

            <?php
            
            /*************************************************
             *
             * Snoopy - the PHP net client
            Severity: Major
            Found in core/model/modx/xmlrss/extlib/snoopy.class.php - About 1 day to fix

              Function Statement has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function Statement($x)
                  {
                      $tt = $this->t->get();
                      $n2 = null;
              
              
              Severity: Minor
              Found in manager/min/lib/JSMinPlus.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

              Function createObjectContainer has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function createObjectContainer($className) {
                      $created= false;
                      if ($this->xpdo->getConnection(array(xPDO::OPT_CONN_MUTABLE => true))) {
                          $instance= $this->xpdo->newObject($className);
                          if ($instance) {
              Severity: Minor
              Found in core/xpdo/om/sqlite/xpdomanager.class.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

              Function copyTree has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function copyTree($source, $target, $options= array()) {
                      $copied= false;
                      $source= strtr($source, '\\', '/');
                      $target= strtr($target, '\\', '/');
                      if ($source[strlen($source) - 1] == '/') $source = substr($source, 0, strlen($source) - 1);
              Severity: Minor
              Found in core/xpdo/cache/xpdocachemanager.class.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 modcachemanager.class.php has 626 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*
               * This file is part of MODX Revolution.
               *
               * Copyright (c) MODX, LLC. All Rights Reserved.
              Severity: Major
              Found in core/model/modx/modcachemanager.class.php - About 1 day to fix

                File phpthumb.bmp.php has 626 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /////////////////////////////////////////////////////////////////
                /// getID3() by James Heinrich <info@getid3.org>               //
                //  available at http://getid3.sourceforge.net                 //
                //            or http://www.getid3.org                         //
                Severity: Major
                Found in core/model/phpthumb/phpthumb.bmp.php - About 1 day to fix

                  Function Ajax has 275 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Ext.lib.Ajax = function() {
                      var activeX = ['Msxml2.XMLHTTP.3.0',
                                     'Msxml2.XMLHTTP'],
                          CONTENTTYPE = 'Content-Type';
                  
                  
                  Severity: Major
                  Found in manager/assets/ext3/adapter/ext/ext-base-debug.js - About 1 day to fix

                    Function Snippet has 274 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    MODx.panel.Snippet = function(config) {
                        config = config || {};
                        config.record = config.record || {};
                        config = MODx.setStaticElementsConfig(config, 'snippet');
                    
                    
                    Severity: Major
                    Found in manager/assets/modext/widgets/element/modx.panel.snippet.js - About 1 day to fix

                      Function DB has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
                      Open

                      MODx.DB = function() {
                          return {
                              testConnection: function() {
                                  Ext.Ajax.request({
                                     url: 'processors/connector.php'
                      Severity: Minor
                      Found in setup/assets/js/sections/database.js - 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

                      Function _httprequest has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function _httprequest($url, $fp, $URI, $http_method, $content_type = "", $body = "")
                          {
                              $cookie_headers = '';
                              if ($this->passcookies && $this->_redirectaddr)
                                  $this->setcookies();
                      Severity: Minor
                      Found in core/model/modx/xmlrss/extlib/snoopy.class.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

                      Function process has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function process($properties= null, $content= null) {
                              parent :: process($properties, $content);
                              if (!$this->_processed) {
                                  $this->_output= $this->_content;
                                  if (is_string($this->_output) && !empty ($this->_output)) {
                      Severity: Minor
                      Found in core/model/modx/modparser.class.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

                      Function outputContent has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function outputContent(array $options = array()) {
                              if (!($this->contentType = $this->modx->resource->getOne('ContentType'))) {
                                  if ($this->modx->getDebug() === true) {
                                      $this->modx->log(modX::LOG_LEVEL_DEBUG, "No valid content type for RESOURCE: " . print_r($this->modx->resource->toArray(), true));
                                  }
                      Severity: Minor
                      Found in core/model/modx/modresponse.class.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

                      Severity
                      Category
                      Status
                      Source
                      Language