modxcms/revolution

View on GitHub

Showing 7,873 of 7,873 total issues

Consider simplifying this complex logical expression.
Open

        if (isset ($meta['index']) && $meta['index'] == 'pk' && !is_array($pk) && $pktype == 'integer' && isset ($meta['generated']) && $meta['generated'] == 'native') {
            $extra= ' PRIMARY KEY AUTOINCREMENT';
            $options['nativeGen'] = true;
            $null= '';
        }
Severity: Major
Found in core/xpdo/om/sqlite/xpdomanager.class.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if ($k == 'properties' && !empty($value) && is_array($value)
                   && is_object($this->xpdo) && $this->xpdo instanceof modX && $this->xpdo->lexicon) {
                foreach ($value as &$property) {
                    if (!empty($property['lexicon'])) {
                        if (strpos($property['lexicon'],':') !== false) {
    Severity: Major
    Found in core/model/modx/modelement.class.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                  if (
                      !empty($this->DKIM_domain)
                      && !empty($this->DKIM_selector)
                      && (!empty($this->DKIM_private_string)
                          || (!empty($this->DKIM_private)
      Severity: Major
      Found in core/model/modx/mail/phpmailer/src/PHPMailer.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                if (empty($siteId) && (!defined('MODX_REQP') || MODX_REQP === TRUE)) {
                    $this->responseCode = 401;
                    $this->body = $modx->error->failure($modx->lexicon('access_denied'),array('code' => 401));
                }
                /* Make sure we've got a token */
        Severity: Major
        Found in core/model/modx/modconnectorresponse.class.php - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if ($this->get('uri') == '' || (!$this->get('uri_override') && ($this->isDirty('uri_override') || $this->isDirty('content_type') || $this->isDirty('isfolder') || $refreshChildURIs))) {
                          $this->set('uri', $this->getAliasPath($this->get('alias')));
                      }
          Severity: Major
          Found in core/model/modx/modresource.class.php - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                    if (!empty ($origContent) && is_string($origContent) && strpos($origContent, $prefix) !== false) {
                        $openCount= 0;
                        $offset= 0;
                        $openPos= 0;
                        $closePos= 0;
            Severity: Major
            Found in core/model/modx/modparser.class.php - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                              if (isset($this->context) && $this->context->get('key') === $context && is_array($this->aliasMap) && array_key_exists($uri, $this->aliasMap)) {
                                  $resourceId = (integer) $this->aliasMap[$uri];
                              } elseif ($ctx = $this->getContext($context)) {
                                  $useAliasMap = $ctx->getOption('cache_alias_map', false) && is_array($ctx->aliasMap) && array_key_exists($uri, $ctx->aliasMap);
                                  if ($useAliasMap && array_key_exists($uri, $ctx->aliasMap)) {
              Severity: Major
              Found in core/model/modx/modx.class.php - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if ($k == 'properties' && !empty($value) && is_array($value)
                               && is_object($this->xpdo) && $this->xpdo instanceof modX && $this->xpdo->lexicon) {
                            foreach ($value as &$property) {
                                if (!empty($property['lexicon'])) {
                                    if (strpos($property['lexicon'],':') !== false) {
                Severity: Major
                Found in core/model/modx/modpropertyset.class.php - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                              if (
                                  strtolower($header_key) === 'content-md5' ||
                                  strtolower($header_key) === 'content-type' ||
                                  strtolower($header_key) === 'date' ||
                                  (strtolower($header_key) === 'expires' && isset($opt['preauth']) && (integer) $opt['preauth'] > 0)
                  Severity: Major
                  Found in core/model/aws/services/s3.class.php - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if ($_template->mustCompile === null) {
                                $_template->mustCompile = (!$_template->source->handler->uncompiled &&
                                                           ($_template->smarty->force_compile || $_template->source->handler->recompiled ||
                                                            !$_template->compiled->exists || ($_template->compile_check &&
                                                                                              $_template->compiled->getTimeStamp() <
                    Severity: Major
                    Found in core/model/smarty/sysplugins/smarty_internal_method_mustcompile.php - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if ((!($this->template->source->handler->recompiled) || $this->forceNocache) && $this->caching
                                      && !$this->suppressNocacheProcessing && ($this->nocache || $this->tag_nocache)
                                  ) {
                                      $this->template->compiled->has_nocache_code = true;
                                      $_output = addcslashes($content, '\'\\');
                      Severity: Major
                      Found in core/model/smarty/sysplugins/smarty_internal_templatecompilerbase.php - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                    if (!$no_output_filter
                                        && (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled)
                                        && (isset($this->smarty->autoload_filters[ 'output' ])
                                            || isset($this->smarty->registered_filters[ 'output' ]))
                                    ) {
                        Severity: Major
                        Found in core/model/smarty/sysplugins/smarty_internal_template.php - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled)
                                              && !$no_output_filter && (isset($this->smarty->autoload_filters[ 'output' ])
                                                                        || isset($this->smarty->registered_filters[ 'output' ]))
                                          ) {
                                              echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this);
                          Severity: Major
                          Found in core/model/smarty/sysplugins/smarty_internal_template.php - About 40 mins to fix

                            Similar blocks of code found in 5 locations. Consider refactoring.
                            Open

                                var tt = new Ext.ux.grid.CheckColumn({
                                    header: _('access')
                                    ,dataIndex: 'access'
                                    ,width: 40
                                    ,sortable: false
                            Severity: Major
                            Found in manager/assets/modext/widgets/element/modx.grid.tv.security.js and 4 other locations - About 40 mins to fix
                            manager/assets/modext/widgets/element/modx.grid.template.tv.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.template.js on lines 11..16
                            manager/assets/modext/widgets/security/modx.panel.access.policy.js on lines 153..158
                            manager/assets/modext/widgets/system/modx.grid.content.type.js on lines 46..51

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        store: new Ext.data.SimpleStore({
                                            fields: ['d','v']
                                            ,data: [[_('yes'),true],[_('no'),false]]
                                        })
                            Severity: Minor
                            Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 40 mins to fix
                            manager/assets/modext/widgets/core/modx.combo.js on lines 208..211

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 4 locations. Consider refactoring.
                            Open

                                    },{
                                        xtype: 'modx-combo-lexicon-topic'
                                        ,fieldLabel: _('topic')
                                        ,name: 'topic'
                                        ,id: 'modx-'+this.ident+'-topic'
                            Severity: Major
                            Found in manager/assets/modext/workspace/lexicon/lexicon.grid.js and 3 other locations - About 40 mins to fix
                            manager/assets/modext/workspace/lexicon/lexicon.grid.js on lines 424..431
                            manager/assets/modext/workspace/lexicon/lexicon.grid.js on lines 431..438
                            manager/assets/modext/workspace/lexicon/lexicon.grid.js on lines 487..494

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 5 locations. Consider refactoring.
                            Open

                                var binaryColumn = new Ext.ux.grid.CheckColumn({
                                    header: _('binary')
                                    ,dataIndex: 'binary'
                                    ,width: 40
                                    ,sortable: true
                            Severity: Major
                            Found in manager/assets/modext/widgets/system/modx.grid.content.type.js and 4 other locations - About 40 mins to fix
                            manager/assets/modext/widgets/element/modx.grid.template.tv.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.security.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.template.js on lines 11..16
                            manager/assets/modext/widgets/security/modx.panel.access.policy.js on lines 153..158

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 2 locations. Consider refactoring.
                            Open

                                    ,viewConfig: {
                                        forceFit: true
                                        ,enableRowBody: true
                                        ,autoFill: true
                                        ,showPreview: true
                            Severity: Minor
                            Found in manager/assets/modext/widgets/core/modx.grid.js and 1 other location - About 40 mins to fix
                            manager/assets/modext/widgets/core/modx.grid.js on lines 612..619

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 5 locations. Consider refactoring.
                            Open

                                var ac = new Ext.ux.grid.CheckColumn({
                                    header: _('enabled')
                                    ,dataIndex: 'enabled'
                                    ,width: 40
                                    ,sortable: true
                            manager/assets/modext/widgets/element/modx.grid.template.tv.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.security.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.template.js on lines 11..16
                            manager/assets/modext/widgets/system/modx.grid.content.type.js on lines 46..51

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 5 locations. Consider refactoring.
                            Open

                                var tt = new Ext.ux.grid.CheckColumn({
                                    header: _('access')
                                    ,dataIndex: 'access'
                                    ,width: 50
                                    ,sortable: true
                            Severity: Major
                            Found in manager/assets/modext/widgets/element/modx.grid.tv.template.js and 4 other locations - About 40 mins to fix
                            manager/assets/modext/widgets/element/modx.grid.template.tv.js on lines 11..16
                            manager/assets/modext/widgets/element/modx.grid.tv.security.js on lines 11..16
                            manager/assets/modext/widgets/security/modx.panel.access.policy.js on lines 153..158
                            manager/assets/modext/widgets/system/modx.grid.content.type.js on lines 46..51

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 48.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language