mambax7/moduleinstaller

View on GitHub

Showing 200 of 200 total issues

Avoid deeply nested control flow statements.
Open

                            if ((elem = matcherOut[i])) {
                                temp.push((matcherIn[i] = elem));
                            }
Severity: Major
Found in assets/js/prototype.js - About 45 mins to fix

    Function updateContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        updateContent: function (responseText) {
            var receiver = this.container[this.success() ? 'success' : 'failure'],
                options = this.options;
    
            if (!options.evalScripts) responseText = responseText.stripScripts();
    Severity: Minor
    Found in assets/js/prototype.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                        if (Element.getStyle(element, 'position') == 'absolute') break;
    Severity: Major
    Found in assets/js/prototype.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (!selector) {
                                  push.apply(results, seed);
                                  return results;
                              }
      Severity: Major
      Found in assets/js/prototype.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        for ($k = 0; $k < $btcount; ++$k) {
                                            if (!$tplfileHandler->delete($tplfiles[$k])) {
                                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">' . _AM_SYSTEM_MODULES_BLOCK_DEPRECATED_ERROR . '(ID: <strong>' . $tplfiles[$k]->getVar('tpl_id') . '</strong>)</span>';
                                            } else {
                                                $msgs[] = '&nbsp;&nbsp;' . sprintf(_AM_SYSTEM_MODULES_BLOCK_DEPRECATED, '<strong>' . $tplfiles[$k]->getVar('tpl_file') . '</strong>');
        Severity: Major
        Found in extras/modulesadmin.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (!$moduleHandler->insert($module)) {
                                      $error = true;
                                  }
          Severity: Major
          Found in extras/main.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (Expr.relative[tokens[j].type]) {
                                        break;
                                    }
            Severity: Major
            Found in assets/js/prototype.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (is_file($templateFolder . $v)) {
                                              unlink($templateFolder . $v);
                                          }
              Severity: Major
              Found in include/onupdate.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                    if ('default' === $xoopsConfig['template_set']) {
                                                        if (!xoops_template_touch($tplfile_new->getVar('tpl_id'))) {
                                                            $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE_ERROR, '<strong>' . $block['template'] . '</strong>') . '</span>';
                                                        } else {
                                                            $msgs[] = '&nbsp;&nbsp;' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE, '<strong>' . $block['template'] . '</strong>');
                Severity: Major
                Found in extras/modulesadmin.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
                                              contains(context, elem) && elem.id === m) {
                                              results.push(elem);
                                              return results;
                                          }
                  Severity: Major
                  Found in assets/js/prototype.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                        if ('default' === $xoopsConfig['template_set']) {
                                                            if (!xoops_template_touch($newid)) {
                                                                $msgs[] = '&nbsp;&nbsp;<span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE_FAILD, '<strong>' . $block['template'] . '</strong>') . '</span>';
                                                            } else {
                                                                $msgs[] = '&nbsp;&nbsp;' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_RECOMPILE, '<strong>' . $block['template'] . '</strong>');
                    Severity: Major
                    Found in extras/modulesadmin.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                              if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
                                                                  return false;
                                                              }
                      Severity: Major
                      Found in assets/js/prototype.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ((newCache[2] = matcher(elem, context, xml))) {
                                                            return true;
                                                        }
                        Severity: Major
                        Found in assets/js/prototype.js - About 45 mins to fix

                          Function pageURI has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function pageURI($page)
                              {
                                  $pages     = \array_keys($this->pages);
                                  $pageIndex = $this->pageIndex;
                                  if (!(int)$page[0]) {
                          Severity: Minor
                          Found in class/InstallWizard.php - About 45 mins 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

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (elem && elem.parentNode) {
                                                      if (elem.id === m) {
                                                          results.push(elem);
                                                          return results;
                                                      }
                          Severity: Major
                          Found in assets/js/prototype.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
                                                                    if (useCache) {
                                                                        (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
                                                                    }
                            
                            
                            Severity: Major
                            Found in assets/js/prototype.js - About 45 mins to fix

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

                              Form.Observer = Class.create(Abstract.TimedObserver, {
                                  getValue: function () {
                                      return Form.serialize(this.element);
                                  }
                              });
                              Severity: Minor
                              Found in assets/js/prototype.js and 1 other location - About 40 mins to fix
                              assets/js/prototype.js on lines 6755..6759

                              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 49.

                              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 2 locations. Consider refactoring.
                              Open

                              Form.EventObserver = Class.create(Abstract.EventObserver, {
                                  getValue: function () {
                                      return Form.serialize(this.element);
                                  }
                              });
                              Severity: Minor
                              Found in assets/js/prototype.js and 1 other location - About 40 mins to fix
                              assets/js/prototype.js on lines 6702..6706

                              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 49.

                              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

                              Consider simplifying this complex logical expression.
                              Open

                                              if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
                                                  (classNames && classNames.all(function (name) {
                                                      return !name.toString().blank() && cn.include(' ' + name + ' ');
                                                  }))))
                                                  elements.push(Element.extend(child));
                              Severity: Major
                              Found in assets/js/prototype.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (support.matchesSelector && documentIsHTML &&
                                            (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
                                            (!rbuggyQSA || !rbuggyQSA.test(expr))) {
                                
                                            try {
                                Severity: Major
                                Found in assets/js/prototype.js - About 40 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language