modxcms/revolution

View on GitHub

Showing 4,334 of 7,873 total issues

File utilities.js has 507 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Ext.namespace('MODx.util.Progress');
/**
 * A JSON Reader specific to MODExt
 *
 * @class MODx.util.JSONReader
Severity: Major
Found in manager/assets/modext/util/utilities.js - About 1 day to fix

    File transport.core.actions.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @var modX|xPDO $xpdo
     * @package modx
     * @subpackage build
    Severity: Major
    Found in _build/data/transport.core.actions.php - About 1 day to fix

      Function createObjectContainer has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createObjectContainer($className) {
              $created= false;
              if ($this->xpdo->getConnection(array(xPDO::OPT_CONN_MUTABLE => true))) {
                  $instance= $this->xpdo->newObject($className);
                  if ($instance) {
      Severity: Minor
      Found in core/xpdo/om/sqlsrv/xpdomanager.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 addOne has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addOne(& $obj, $alias= '') {
              $added= false;
              if (is_object($obj)) {
                  if (empty ($alias)) {
                      if ($obj->_alias == $obj->_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 _saveRelatedObjects has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _saveRelatedObjects() {
              $saved= 0;
              if (!empty ($this->_relatedObjects)) {
                  foreach ($this->_relatedObjects as $alias => $ro) {
                      $objects= array ();
      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 PclZipUtilPathReduction has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

        function PclZipUtilPathReduction($p_dir)
        {
          $v_result = "";
      
          // ----- Look for not empty path
      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

      Function process has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process()
          {
              if (!$this->modx->user->isAuthenticated('mgr')) {
                  return $this->failure($this->modx->lexicon('permission_denied'));
              }
      Severity: Minor
      Found in core/model/modx/processors/system/config.js.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 load has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function load() {
              $topics = func_get_args(); /* allow for dynamic number of lexicons to load */
      
              if ($this->modx->context && $this->modx->context->get('key') == 'mgr') {
                  $defaultLanguage = $this->modx->getOption('manager_language',null,$this->modx->getOption('cultureKey',null,'en'));
      Severity: Minor
      Found in core/model/modx/modlexicon.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 clearCompiledTemplate has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null)
          {
              // clear template objects cache
              $smarty->_clearTemplateCache();
              $_compile_dir = $smarty->getCompileDir();

      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 xpdotransport.class.php has 503 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/transport/xpdotransport.class.php - About 1 day to fix

        Method fb has 199 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public function fb($Object) {
          
            if(!$this->enabled) {
              return false;
            }
        Severity: Major
        Found in manager/min/lib/FirePHP.php - About 7 hrs to fix

          Method privExtractByRule has 198 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
            {
              $v_result=1;
          
              // ----- Magic quotes trick
          Severity: Major
          Found in core/xpdo/compression/pclzip.lib.php - About 7 hrs to fix

            Method parse has 198 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public function parse($value)
              {
                $value = str_replace("\t", '  ', $value); // Convert tabs to spaces.
            
                $this->currentLineNb = -1;
            Severity: Major
            Found in core/model/aws/lib/yaml/lib/sfYamlParser.php - About 7 hrs to fix

              Function pack has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function pack($source, array $options = array()) {
                      $results = array();
                      if ($this->_archive) {
                          $target = $this->getOption(xPDOZip::ZIP_TARGET, $options, '');
                          if (is_dir($source)) {
              Severity: Minor
              Found in core/xpdo/compression/xpdozip.class.php - About 7 hrs 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 getIncludePath has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getIncludePath($dirs, $file, Smarty $smarty)
                  {
                      //if (!(isset($this->_has_stream_include) ? $this->_has_stream_include : $this->_has_stream_include = false)) {
                      if (!(isset($this->_has_stream_include) ? $this->_has_stream_include :
                          $this->_has_stream_include = function_exists('stream_resolve_include_path'))

              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 ImageCreateFromStringReplacement has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors=false) {
                      // there are serious bugs in the non-bundled versions of GD which may cause
                      // PHP to segfault when calling imagecreatefromstring() - avoid if at all possible
                      // when not using a bundled version of GD2
                      if (!phpthumb_functions::gd_version()) {
              Severity: Minor
              Found in core/model/phpthumb/phpthumb.class.php - About 7 hrs 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 getContentType has 197 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getContentType($ext) {
                      $contentType = 'application/octet-stream';
                      $mimeTypes = array(
                          '323' => 'text/h323',
                          'acx' => 'application/internet-property-stream',
              Severity: Major
              Found in core/model/modx/sources/mods3mediasource.class.php - About 7 hrs to fix

                File modrequest.class.php has 494 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: Minor
                Found in core/model/modx/modrequest.class.php - About 7 hrs to fix

                  xPDOObject has 55 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class xPDOObject {
                      /**
                       * A convenience reference to the xPDO object.
                       * @var xPDO
                       * @access public
                  Severity: Major
                  Found in core/xpdo/om/xpdoobject.class.php - About 7 hrs to fix

                    Method compress has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void compress(Writer out, int linebreakpos)
                                throws IOException {
                    
                            Pattern p;
                            Matcher m;
                    Severity: Minor
                    Found in manager/min/lib/Minify/YUI/CssCompressor.java - About 7 hrs 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