modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

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

MODx.panel.Resource = function(config) {
    config = config || {record:{}};
    config.record = config.record || {};
    Ext.applyIf(config,{
        url: MODx.config.connector_url
Severity: Major
Found in manager/assets/modext/widgets/resource/modx.panel.resource.js - About 2 days to fix

    Method getid3_bmp has 423 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getid3_bmp(&$BMPdata, &$ThisFileInfo, $ExtractPalette=false, $ExtractData=false) {
    
            // shortcuts
            $ThisFileInfo['bmp']['header']['raw'] = array();
            $thisfile_bmp                         = &$ThisFileInfo['bmp'];
    Severity: Major
    Found in core/model/phpthumb/phpthumb.bmp.php - About 2 days to fix

      File phpthumb.gif.php has 851 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      ///////////////////////////////////////////////////////////////////////////////////////////////////
      // GIF Util - (C) 2003 Yamasoft (S/C)
      // http://www.yamasoft.com
      // All Rights Reserved
      Severity: Major
      Found in core/model/phpthumb/phpthumb.gif.php - About 2 days to fix

        Function privDeleteByRule has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
        Open

          function privDeleteByRule(&$p_result_list, &$p_options)
          {
            $v_result=1;
            $v_list_detail = array();
        
        
        Severity: Minor
        Found in core/xpdo/compression/pclzip.lib.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 EventManager has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
        Open

        Ext.EventManager = function(){
            var docReadyEvent, 
                docReadyProcId, 
                docReadyState = false,        
                E = Ext.lib.Event,
        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

        Method ApplyFilters has 405 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ApplyFilters() {
                if ($this->fltr && is_array($this->fltr)) {
                    if (!include_once __DIR__ .'/phpthumb.filters.php' ) {
                        $this->DebugMessage('Error including "'. __DIR__ .'/phpthumb.filters.php" which is required for applying filters ('.implode(';', $this->fltr).')', __FILE__, __LINE__);
                        return false;
        Severity: Major
        Found in core/model/phpthumb/phpthumb.class.php - About 2 days to fix

          Function remove has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
          Open

              public function remove(array $ancestors= array ()) {
                  $result= false;
                  $pk= $this->getPrimaryKey();
                  if ($pk && $this->xpdo->getConnection(array(xPDO::OPT_CONN_MUTABLE => true))) {
                      $primaryKey = $pk;
          Severity: Minor
          Found in core/xpdo/om/xpdoobject.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 modresource.map.inc.php has 836 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

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

              Function getContainerList has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getContainerList($path) {
                      $properties = $this->getPropertyList();
                      $path = $this->fileHandler->postfixSlash($path);
                      $bases = $this->getBases($path);
                      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 privParseOptions has a Cognitive Complexity of 99 (exceeds 5 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: 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 smarty_internal_configfileparser.php has 816 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              class TPC_yyStackEntry
              {
                  public $stateno;       /* The state-number */
              Severity: Major
              Found in core/model/smarty/sysplugins/smarty_internal_configfileparser.php - About 1 day to fix

                Function writeSchema has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function writeSchema($schemaFile, $package= '', $baseClass= '', $tablePrefix= '', $restrictPrefix= false) {
                        if (empty ($package))
                            $package= $this->manager->xpdo->package;
                        if (empty ($baseClass))
                            $baseClass= 'xPDOObject';
                Severity: Minor
                Found in core/xpdo/om/mysql/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 getResource has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getResource($method, $identifier, array $options = array()) {
                        $resource = null;
                        if ($method == 'alias') {
                            $resourceId = $this->modx->findResource($identifier);
                        } else {
                Severity: Minor
                Found in core/model/modx/modrequest.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 smarty_internal_templatelexer.php has 794 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*
                 * This file is part of Smarty.
                 *
                 * (c) 2015 Uwe Tews
                Severity: Major
                Found in core/model/smarty/sysplugins/smarty_internal_templatelexer.php - About 1 day to fix

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

                    Function parseConditions has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function parseConditions($conditions, $conjunction = xPDOQuery::SQL_AND) {
                            $result= array ();
                            $pk= $this->xpdo->getPK($this->_class);
                            $pktype= $this->xpdo->getPKType($this->_class);
                            $fieldMeta= $this->xpdo->getFieldMeta($this->_class, true);
                    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 validate has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function validate(array $parameters = array()) {
                            $validated= false;
                            $this->reset();
                            $stopOnFail= isset($parameters['stopOnFail']) && $parameters['stopOnFail']
                                    ? true
                    Severity: Minor
                    Found in core/xpdo/validation/xpdovalidator.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_select_time has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function smarty_function_html_select_time($params, Smarty_Internal_Template $template)
                    {
                        $template->_checkPlugins(
                            array(
                                array(
                    Severity: Minor
                    Found in core/model/smarty/plugins/function.html_select_time.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 2.5-cleanup-script.php has 787 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * Common upgrade script for 2.5 to clean up legacy files for download distributions.
                     *
                     * @var modX
                    Severity: Major
                    Found in setup/includes/upgrades/common/2.5-cleanup-script.php - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language