modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

File mods3mediasource.class.php has 956 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/sources/mods3mediasource.class.php - About 2 days to fix

    Function smarty_function_html_select_date has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

    function smarty_function_html_select_date($params, Smarty_Internal_Template $template)
    {
        $template->_checkPlugins(
            array(
                array(
    Severity: Minor
    Found in core/model/smarty/plugins/function.html_select_date.php - About 2 days 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 modx.grid.js has 950 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Ext.namespace('MODx.grid');
    
    MODx.grid.Grid = function(config) {
        config = config || {};
        this.config = config;
    Severity: Major
    Found in manager/assets/modext/widgets/core/modx.grid.js - About 2 days to fix

      Function DomHelper has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
      Open

      Ext.DomHelper = function(){
          var tempTableEl = null,
              emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i,
              tableRe = /^table|tbody|tr|td$/i,
              pub,
      Severity: Minor
      Found in setup/assets/js/ext-core-debug.js - About 2 days 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 getAction has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
      Open

          function getAction($lastaction, $itemid='') {
              switch($lastaction) {
                  case "1" : return "Loading a frame(set)"; break;
                  case "2" : return "Viewing home page/ online users"; break;
                  case "3" : return "Viewing data for document $itemid"; break;
      Severity: Minor
      Found in core/model/modx/processors/system/actionlist.inc.php - About 2 days 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 phpthumb.functions.php has 921 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      //////////////////////////////////////////////////////////////
      //   phpThumb() by James Heinrich <info@silisoftware.com>   //
      //        available at http://phpthumb.sourceforge.net      //
      //         and/or https://github.com/JamesHeinrich/phpThumb //
      Severity: Major
      Found in core/model/phpthumb/phpthumb.functions.php - About 2 days to fix

        File modparser.class.php has 920 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/modparser.class.php - About 2 days to fix

          AmazonEC2 has 116 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class AmazonEC2 extends CFRuntime
          {
          
              /*%******************************************************************************************%*/
              // CLASS CONSTANTS
          Severity: Major
          Found in core/model/aws/services/ec2.class.php - About 2 days to fix

            File transport.policy.tpl.administrator.php has 913 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * The default Permission scheme for the Administrator Policy Template.
             *
             * @package modx
            Severity: Major
            Found in _build/data/permissions/transport.policy.tpl.administrator.php - About 2 days to fix

              Function clear has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
                  {
                      $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
                      $_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null;
                      $_dir_sep = $smarty->use_sub_dirs ? '/' : '^';

              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 modresource.map.inc.php has 902 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * @package modx
               * @subpackage mysql
               */
              Severity: Major
              Found in core/model/modx/mysql/modresource.map.inc.php - About 2 days to fix

                PHPMailer has 113 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class PHPMailer
                {
                    const CHARSET_ASCII = 'us-ascii';
                    const CHARSET_ISO88591 = 'iso-8859-1';
                    const CHARSET_UTF8 = 'utf-8';
                Severity: Major
                Found in core/model/modx/mail/phpmailer/src/PHPMailer.php - About 2 days to fix

                  Function getPK has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getPK($className) {
                          $pk= null;
                          if (strcasecmp($className, 'xPDOObject') !== 0) {
                              if ($actualClassName= $this->loadClass($className)) {
                                  if (isset ($this->map[$actualClassName]['indexes'])) {
                  Severity: Minor
                  Found in core/xpdo/xpdo.class.php - About 2 days 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 windows.js has 887 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * Generates the Duplicate Resource window.
                   *
                   * @class MODx.window.DuplicateResource
                   * @extends MODx.Window
                  Severity: Major
                  Found in manager/assets/modext/widgets/windows.js - About 2 days to fix

                    File modprocessor.class.php has 887 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/modprocessor.class.php - About 2 days to fix

                      Function CleanUpCacheDirectory has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function CleanUpCacheDirectory() {
                              $this->DebugMessage('CleanUpCacheDirectory() set to purge ('.(null === $this->config_cache_maxage ? 'NULL' : number_format($this->config_cache_maxage / 86400, 1)).' days; '.(null === $this->config_cache_maxsize ? 'NULL' : number_format($this->config_cache_maxsize / 1048576, 2)).' MB; '.(null === $this->config_cache_maxfiles ? 'NULL' : number_format($this->config_cache_maxfiles)).' files)', __FILE__, __LINE__);
                      
                              if (!is_writable($this->config_cache_directory)) {
                                  $this->DebugMessage('CleanUpCacheDirectory() skipped because "'.$this->config_cache_directory.'" is not writable', __FILE__, __LINE__);
                      Severity: Minor
                      Found in core/model/phpthumb/phpthumb.class.php - About 2 days 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 modtemplatevar.class.php has 885 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/modtemplatevar.class.php - About 2 days to fix

                        Function validate has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function validate()
                            {
                                $options = '';
                                $this->errors = array();
                                $this->values = array();
                        Severity: Minor
                        Found in manager/min/lib/MrClay/Cli.php - About 2 days 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 generateContext has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function generateContext($key, array $options = array()) {
                                $results = array();
                                if (!$this->getOption('transient_context', $options, false)) {
                                    /** @var modContext $obj */
                                    $obj= $this->modx->getObject('modContext', $key, true);
                        Severity: Minor
                        Found in core/model/modx/modcachemanager.class.php - About 2 days 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 modx.tree.directory.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Generates the Directory Tree
                         *
                         * @class MODx.tree.Directory
                         * @extends MODx.tree.Tree
                        Severity: Major
                        Found in manager/assets/modext/widgets/system/modx.tree.directory.js - About 2 days to fix
                          Severity
                          Category
                          Status
                          Source
                          Language