modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

File update.class.php has 604 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/resource/update.class.php - About 1 day to fix

    Method Statement has 261 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function Statement($x)
        {
            $tt = $this->t->get();
            $n2 = null;
    
    
    Severity: Major
    Found in manager/min/lib/JSMinPlus.php - About 1 day to fix

      Function loadTVs has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

          public function loadTVs($reloadData = array()) {
              $this->setPlaceholder('wctx',$this->resource->get('context_key'));
              $_GET['wctx'] = $this->resource->get('context_key');
      
              $this->fireOnTVFormRender();
      Severity: Minor
      Found in manager/controllers/default/resource/resource.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 modx.panel.js has 600 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Ext.namespace('MODx.panel');
      
      MODx.Panel = function(config) {
          config = config || {};
          Ext.applyIf(config,{
      Severity: Major
      Found in manager/assets/modext/widgets/core/modx.panel.js - About 1 day to fix

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

          Method compileTag2 has 258 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function compileTag2($tag, $args, $parameter)
              {
                  $plugin_type = '';
                  // $args contains the attributes parsed and compiled by the lexer/parser
                  // assume that tag does compile into code, but creates no HTML output
          Severity: Major
          Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 1 day to fix

            Function outputClasses has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
            Open

                public function outputClasses($path) {
                    $newClassGeneration= false;
                    $newPlatformGeneration= false;
                    $platform= $this->model['platform'];
                    if (!is_dir($path)) {
            Severity: Minor
            Found in core/xpdo/om/xpdogenerator.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 construct has a Cognitive Complexity of 65 (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/sqlite/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 construct has a Cognitive Complexity of 65 (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/mysql/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

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

              Function fromCache has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function fromCache($signature, $class= '', $options= array()) {
                      $result= null;
                      if ($this->getOption(xPDO::OPT_CACHE_DB, $options)) {
                          if ($signature && $this->getCacheManager()) {
                              $sig= '';
              Severity: Minor
              Found in core/xpdo/xpdo.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 createBody has 252 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function createBody()
                  {
                      $body = '';
                      //Create unique IDs and preset boundaries
                      $this->uniqueid = $this->generateId();
              Severity: Major
              Found in core/model/modx/mail/phpmailer/src/PHPMailer.php - About 1 day to fix

                Method WatermarkText has 250 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function WatermarkText(&$gdimg, $text, $size, $alignment, $hex_color='000000', $ttffont='', $opacity=100, $margin=5, $angle=0, $bg_color=false, $bg_opacity=0, $fillextend='', $lineheight=1.0) {
                        // text watermark requested
                        if (!$text) {
                            return false;
                        }
                Severity: Major
                Found in core/model/phpthumb/phpthumb.filters.php - About 1 day to fix

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

                  /**
                   * @class MODx.panel.User
                   * @extends MODx.FormPanel
                   * @param {Object} config An object of configuration properties
                   * @xtype modx-panel-user
                  Severity: Major
                  Found in manager/assets/modext/widgets/security/modx.panel.user.js - About 1 day to fix

                    File modx.grid.source.properties.js has 580 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    MODx.grid.SourceProperties = function(config) {
                        config = config || {};
                        this.exp = new Ext.grid.RowExpander({
                            tpl : new Ext.Template(
                                '<p class="modx-property-description"><i>{desc_trans}</i></p>'
                    Severity: Major
                    Found in manager/assets/modext/widgets/source/modx.grid.source.properties.js - About 1 day to fix

                      Function privFileDescrExpand has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                      Open

                        function privFileDescrExpand(&$p_filedescr_list, &$p_options)
                        {
                          $v_result=1;
                      
                          // ----- Create a result list
                      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

                      AmazonS3 has 67 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class AmazonS3 extends CFRuntime
                      {
                          /*%******************************************************************************************%*/
                          // CLASS CONSTANTS
                      
                      
                      Severity: Major
                      Found in core/model/aws/services/s3.class.php - About 1 day to fix

                        Function initComponent has 245 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          initComponent : function() {
                            Ext.ux.UploadDialog.Dialog.superclass.initComponent.call(this);
                            
                            // Setting automata protocol
                            var tt = {
                        Severity: Major
                        Found in manager/assets/modext/util/uploaddialog.js - About 1 day to fix

                          Function getCachePath has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getCachePath() {
                                  $cachePath= false;
                                  if (empty($this->xpdo->cachePath)) {
                                      if (!isset ($this->xpdo->config['cache_path'])) {
                                          while (true) {
                          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 smarty_modifier_escape has a Cognitive Complexity of 62 (exceeds 5 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: Minor
                          Found in core/model/smarty/plugins/modifier.escape.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