modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

Function get_debug_vars has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_debug_vars($obj)
    {
        $config_vars = array();
        foreach ($obj->config_vars as $key => $var) {
            $config_vars[ $key ][ 'value' ] = $var;
Severity: Minor
Found in core/model/smarty/sysplugins/smarty_internal_debug.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 getGeneralFields has 323 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ,getGeneralFields: function(config) {
        var itemsRight = [{
            id: 'modx-user-newpassword'
            ,name: 'newpassword'
            ,xtype: 'hidden'
Severity: Major
Found in manager/assets/modext/widgets/security/modx.panel.user.js - About 1 day to fix

    Function privAddFile has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
    Open

      function privAddFile($p_filedescr, &$p_header, &$p_options)
      {
        $v_result=1;
    
        // ----- Working variable
    Severity: Minor
    Found in core/xpdo/compression/pclzip.lib.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 cloudfront.class.php has 699 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     * Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
     *
     * Licensed under the Apache License, Version 2.0 (the "License").
    Severity: Major
    Found in core/model/aws/services/cloudfront.class.php - About 1 day to fix

      Function compile has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
      Open

          public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
          {
              // check and get attributes
              $_attr = $this->getAttributes($compiler, $args);
              $output = $parameter[ 'value' ];

      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 smarty_function_html_select_time has 318 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function smarty_function_html_select_time($params, Smarty_Internal_Template $template)
      {
          $template->_checkPlugins(
              array(
                  array(
      Severity: Major
      Found in core/model/smarty/plugins/function.html_select_time.php - About 1 day to fix

        File modx.tree.js has 696 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        Ext.namespace('MODx.tree');
        /**
         * Generates the Tree in Ext. All modTree classes extend this base class.
         *
         * @class MODx.tree.Tree
        Severity: Major
        Found in manager/assets/modext/widgets/core/tree/modx.tree.js - About 1 day to fix

          Function Lightbox has 316 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Ext.ux.Lightbox = (function(){
              var els = {},
                  images = [],
                  activeImage,
                  initialized = false,
          Severity: Major
          Found in manager/assets/modext/util/lightbox.js - About 1 day to fix

            Function deleteTree has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
            Open

                public function deleteTree($dirname, $options= array('deleteTop' => false, 'skipDirs' => false, 'extensions' => array('.cache.php'))) {
                    $result= false;
                    if (is_dir($dirname)) { /* Operate on dirs only */
                        if (substr($dirname, -1) != '/') {
                            $dirname .= '/';
            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

            Method smarty_function_html_select_date has 313 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function smarty_function_html_select_date($params, Smarty_Internal_Template $template)
            {
                $template->_checkPlugins(
                    array(
                        array(
            Severity: Major
            Found in core/model/smarty/plugins/function.html_select_date.php - About 1 day to fix

              File modx.panel.tv.js has 686 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Loads the TV panel
               *
               * @class MODx.panel.TV
               * @extends MODx.FormPanel
              Severity: Major
              Found in manager/assets/modext/widgets/element/modx.panel.tv.js - About 1 day to fix

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

                Ext.EventManager = function(){
                    var docReadyEvent, docReadyProcId, docReadyState = false;
                    var resizeEvent, resizeTask, textEvent, textSize;
                    var E = Ext.lib.Event;
                    var D = Ext.lib.Dom;
                Severity: Major
                Found in manager/assets/modext/util/eventfix.js - About 1 day to fix

                  Function Template has 310 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function encodeObject has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
                    Open

                      protected function encodeObject($Object, $ObjectDepth = 1, $ArrayDepth = 1)
                      {
                        $return = array();
                        
                        if (is_object($Object)) {
                    Severity: Minor
                    Found in manager/min/lib/FirePHP.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 construct has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function construct() {
                            $constructed= false;
                            $this->bindings= array ();
                            $command= strtoupper($this->query['command']);
                            $sql= $this->query['command'] . ' ';
                    Severity: Minor
                    Found in core/xpdo/om/sqlsrv/xpdoquery.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 Plugin has 305 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method compile has 303 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
                          {
                              $compiler->loopNesting++;
                              // check and get attributes
                              $_attr = $this->getAttributes($compiler, $args);
                      Severity: Major
                      Found in core/model/smarty/sysplugins/smarty_internal_compile_section.php - About 1 day to fix

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

                        <?php
                        /*
                         * Copyright 2010-2015 by MODX, LLC.
                         *
                         * This file is part of xPDO.
                        Severity: Major
                        Found in core/xpdo/om/xpdoquery.class.php - About 1 day to fix

                          Function _uninstallObject has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _uninstallObject(& $transport, $options, $element, & $parentObject, $fkMeta) {
                                  $uninstalled = false;
                                  $removed = false;
                                  $uninstallObject = true;
                                  $upgrade = false;
                          Severity: Minor
                          Found in core/xpdo/transport/xpdoobjectvehicle.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 compile has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler)
                              {
                                  $uid = $t_hash = null;
                                  // check and get attributes
                                  $_attr = $this->getAttributes($compiler, $args);
                          Severity: Minor
                          Found in core/model/smarty/sysplugins/smarty_internal_compile_include.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