modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

File default.inc.php has 552 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Default English lexicon topic
 *
 * @language en
Severity: Major
Found in core/lexicon/el/default.inc.php - About 1 day to fix

    File default.inc.php has 552 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Default English lexicon topic
     *
     * @language en
    Severity: Major
    Found in core/lexicon/yo/default.inc.php - About 1 day to fix

      SuperBoxSelect has 63 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Ext.ux.form.SuperBoxSelect = Ext.extend(Ext.ux.form.SuperBoxSelect,Ext.form.ComboBox,{
          /**
           * @cfg {Boolean} addNewDataOnBlur Allows adding new items when the user tabs from the input element.
           */
          addNewDataOnBlur : false,
      Severity: Major
      Found in manager/assets/modext/util/superboxselect.js - About 1 day to fix

        Function patch has 229 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        patch: function (){
                            api.flashEngine = true;
        
                            // FileAPI
                            _inherit(api, {
        Severity: Major
        Found in manager/assets/fileapi/FileAPI.js - About 1 day to fix

          File xpdogenerator.class.php has 547 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/xpdogenerator.class.php - About 1 day to fix

            Function join has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                public function join($class, $alias= '', $type= xPDOQuery::SQL_JOIN_CROSS, $conditions= array (), $conjunction= xPDOQuery::SQL_AND, $binding= null, $condGroup= 0) {
                    if ($this->xpdo->loadClass($class)) {
                        $alias= $alias ? $alias : $class;
                        $target= & $this->query['from']['joins'];
                        $targetIdx= count($target);
            Severity: Minor
            Found in core/xpdo/om/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 fetch_rss has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

            function fetch_rss ($url) {
                // initialize constants
                init();
            
                if ( !isset($url) ) {
            Severity: Minor
            Found in core/model/modx/xmlrss/rssfetch.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 _callExternalMethod has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args)
                {
                    /* @var Smarty $data ->smarty */
                    $smarty = isset($data->smarty) ? $data->smarty : $data;
                    if (!isset($smarty->ext->$name)) {
            Severity: Minor
            Found in core/model/smarty/sysplugins/smarty_internal_extension_handler.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 SourceImageToGD has 226 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function SourceImageToGD() {
                    if (is_resource($this->gdimg_source) || (is_object($this->gdimg_source) && $this->gdimg_source instanceOf \GdImage)) {
                        $this->source_width  = imagesx($this->gdimg_source);
                        $this->source_height = imagesy($this->gdimg_source);
                        $this->DebugMessage('skipping SourceImageToGD() because $this->gdimg_source is already a resource ('.$this->source_width.'x'.$this->source_height.')', __FILE__, __LINE__);
            Severity: Major
            Found in core/model/phpthumb/phpthumb.class.php - About 1 day to fix

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

                  public function authenticate($action, $opt = null, $domain = null, $signature_version = 2, $redirects = 0)
                  {
                      // Handle nulls
                      if (is_null($signature_version))
                      {
              Severity: Major
              Found in core/model/aws/sdk.class.php - About 1 day to fix

                Function _compilePayload has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _compilePayload(& $transport) {
                        $cacheManager = $transport->xpdo->getCacheManager();
                        if ($cacheManager) {
                            if (isset ($this->payload['resolve']) && is_array($this->payload['resolve'])) {
                                foreach ($this->payload['resolve'] as $rKey => $r) {
                Severity: Minor
                Found in core/xpdo/transport/xpdovehicle.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 fromArray has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function fromArray($fldarray, $keyPrefix= '', $setPrimaryKeys= false, $rawValues= false, $adhocValues= false) {
                        if (is_array($fldarray)) {
                            $pkSet= false;
                            $generatedKey= false;
                            foreach ($fldarray as $key => $val) {
                Severity: Minor
                Found in core/xpdo/om/xpdoobject.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 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getObjectsInContainer($path) {
                        $properties = $this->getPropertyList();
                        $dir = $this->fileHandler->postfixSlash($path);
                        $bases = $this->getBases($dir);
                        if (empty($bases['pathAbsolute'])) return array();
                Severity: Minor
                Found in core/model/modx/sources/modfilemediasource.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_checkboxes has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                function smarty_function_html_checkboxes($params, Smarty_Internal_Template $template)
                {
                    $template->_checkPlugins(
                        array(
                            array(
                Severity: Minor
                Found in core/model/smarty/plugins/function.html_checkboxes.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 privParseOptions has 222 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
                  {
                    $v_result=1;
                
                    // ----- Read the options
                Severity: Major
                Found in core/xpdo/compression/pclzip.lib.php - About 1 day to fix

                  Function DashboardWidget has 220 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  MODx.panel.DashboardWidget = function(config) {
                      config = config || {};
                  
                      var itms = [];
                      itms.push({
                  Severity: Major
                  Found in manager/assets/modext/widgets/system/modx.panel.dashboard.widget.js - About 1 day to fix

                    File modx.panel.user.group.js has 533 lines of code (exceeds 250 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

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

                      Ext.EventObject = function(){
                          var E = Ext.lib.Event,
                              // safari keypress events for special keys return bad keycodes
                              safariKeys = {
                                  3 : 13, // enter
                      Severity: Minor
                      Found in setup/assets/js/ext-core-debug.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 getGraph has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getGraph($graph = true, $criteria = null, $cacheFlag = true) {
                              /* graph is true, get all relations to max depth */
                              if ($graph === true) {
                                  $graph = $this->xpdo->getGraph($this->_class);
                              }
                      Severity: Minor
                      Found in core/xpdo/om/xpdoobject.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 privCalculateStoredFilename has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                      Open

                        function privCalculateStoredFilename(&$p_filedescr, &$p_options)
                        {
                          $v_result=1;
                      
                          // ----- Working variables
                      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

                      Severity
                      Category
                      Status
                      Source
                      Language