modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

Function processBindings has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    public function processBindings($value= '', $resourceId= 0, $preProcess = true) {
        $bdata = $this->getBindingDataFromValue($value);
        if (empty($bdata['cmd'])) return $value;

        $modx =& $this->xpdo;
Severity: Minor
Found in core/model/modx/modtemplatevar.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 _send has 218 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _send: function (options, data){
            var _this = this, xhr, uid = _this.uid, onLoadFnName = _this.uid + "Load", url = options.url;

            api.log('XHR._send:', data);

Severity: Major
Found in manager/assets/fileapi/FileAPI.js - About 1 day to fix

    phpthumb has 60 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class phpthumb {
    
        // public:
        // START PARAMETERS (for object mode and phpThumb.php)
        // See phpthumb.readme.txt for descriptions of what each of these values are
    Severity: Major
    Found in core/model/phpthumb/phpthumb.class.php - About 1 day to fix

      Function EventManager has 215 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Ext.EventManager = function(){
          var docReadyEvent, 
              docReadyProcId, 
              docReadyState = false,        
              E = Ext.lib.Event,
      Severity: Major
      Found in setup/assets/js/ext-core-debug.js - About 1 day to fix

        Method smarty_modifier_escape has 215 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)
        {
            static $_double_encode = null;
            static $is_loaded_1 = false;
            static $is_loaded_2 = false;
        Severity: Major
        Found in core/model/smarty/plugins/modifier.escape.php - About 1 day to fix

          Function Lightbox has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

          Ext.ux.Lightbox = (function(){
              var els = {},
                  images = [],
                  activeImage,
                  initialized = false,
          Severity: Minor
          Found in manager/assets/modext/util/lightbox.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 _installFiles has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _installFiles(& $transport, $options) {
                  $installed = false;
                  $copied = false;
                  $vOptions = $this->get($transport, $options);
                  if (isset ($vOptions['object']) && isset ($vOptions['object']['source']) && isset ($vOptions['object']['target'])) {
          Severity: Minor
          Found in core/xpdo/transport/xpdofilevehicle.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 getObjectsInContainer has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getObjectsInContainer($path) {
                  $properties = $this->getPropertyList();
                  $list = $this->getS3ObjectList($path);
                  $editAction = $this->getEditActionId();
          
          
          Severity: Minor
          Found in core/model/modx/sources/mods3mediasource.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 isCached has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

              public function isCached(Smarty_Internal_Template $_template)
              {
                  if ($this->valid !== null) {
                      return $this->valid;
                  }
          Severity: Minor
          Found in core/model/smarty/sysplugins/smarty_template_cached.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 getnodes.class.php has 521 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/processors/element/getnodes.class.php - About 1 day to fix

            Function getQRSettings has 211 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            MODx.getQRSettings = function(id,va) {
                id = id || 'qur';
                return [{
                    layout: 'column'
                    ,border: false
            Severity: Major
            Found in manager/assets/modext/widgets/resource/modx.tree.resource.js - About 1 day to fix

              Function get has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function get($key, $options= array()) {
                      $value= null;
                      $cacheKey= $this->getCacheKey($key, $options);
                      if (file_exists($cacheKey)) {
                          if ($file = @fopen($cacheKey, 'rb')) {
              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

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

                  public function outputContent(array $options = array()) {
                      /* variable pointer for easier access */
                      $modx =& $this->modx;
              
                      /* backwards compat */
              Severity: Minor
              Found in core/model/modx/modconnectorresponse.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 getAttributes has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAttributes($compiler, $attributes)
                  {
                      $_indexed_attr = array();
                      if (!isset($this->mapCache[ 'option' ])) {
                          $this->mapCache[ 'option' ] = array_fill_keys($this->option_flags, true);
              Severity: Minor
              Found in core/model/smarty/sysplugins/smarty_internal_compilebase.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 prepareResourceNode has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function prepareResourceNode(modResource $resource) {
                      $qtipField = $this->getProperty('qtipField');
                      $nodeField = $this->getProperty('nodeField');
                      $nodeFieldFallback = $this->getProperty('nodeFieldFallback');
                      $noHref = $this->getProperty('noHref',false);
              Severity: Minor
              Found in core/model/modx/processors/resource/getnodes.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 getUser has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getUser($contextKey= '',$forceLoadSettings = false) {
                      if ($contextKey == '') {
                          if ($this->context !== null) {
                              $contextKey= $this->context->get('key');
                          }
              Severity: Minor
              Found in core/model/modx/modx.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 smarty_function_html_options has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
              Open

              function smarty_function_html_options($params, Smarty_Internal_Template $template)
              {
                  $template->_checkPlugins(
                      array(
                          array(
              Severity: Minor
              Found in core/model/smarty/plugins/function.html_options.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 parsePhp has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parsePhp(Smarty_Internal_Templatelexer $lex)
                  {
                      $lex->token = Smarty_Internal_Templateparser::TP_PHP;
                      $close = 0;
                      $lex->taglineno = $lex->line;
              Severity: Minor
              Found in core/model/smarty/sysplugins/smarty_internal_compile_private_php.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 Rotate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function Rotate() {
                      if ($this->ra || $this->ar) {
                          if (!function_exists('imagerotate')) {
                              $this->DebugMessage('!function_exists(imagerotate)', __FILE__, __LINE__);
                              return false;
              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 package.grid.js has 510 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Loads a grid of Packages.
               *
               * @class MODx.grid.Package
               * @extends MODx.grid.Grid
              Severity: Major
              Found in manager/assets/modext/workspace/package.grid.js - About 1 day to fix
                Severity
                Category
                Status
                Source
                Language