mambax7/moduleinstaller

View on GitHub

Showing 122 of 198 total issues

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 (!selector) {
                                push.apply(results, seed);
                                return results;
                            }
    Severity: Major
    Found in assets/js/prototype.js - About 45 mins to fix

      Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
      Severity: Minor
      Found in assets/js/prototype.js - About 45 mins to fix

        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

          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) {
                                                        return false;
                                                    }
            Severity: Major
            Found in assets/js/prototype.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (!(unmatched[i] || setMatched[i])) {
                                                  setMatched[i] = pop.call(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 (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

                                                    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

                      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

                        Consider simplifying this complex logical expression.
                        Open

                                if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
                                    var style = element.style.left, rStyle = element.runtimeStyle.left;
                                    element.runtimeStyle.left = element.currentStyle.left;
                                    element.style.left = value || 0;
                                    value = element.style.pixelLeft;
                        Severity: Major
                        Found in assets/js/prototype.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (matcher[expando]) {
                                              j = ++i;
                                              for (; j < len; j++) {
                                                  if (Expr.relative[tokens[j].type]) {
                                                      break;
                          Severity: Major
                          Found in assets/js/prototype.js - About 40 mins to fix

                            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

                              Function condense has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  function condense(unmatched, map, filter, context, xml) {
                              Severity: Minor
                              Found in assets/js/prototype.js - About 35 mins to fix

                                Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
                                Severity: Minor
                                Found in class/Common/SysUtility.php - About 35 mins to fix

                                  Function superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                              superMatcher = function (seed, context, xml, results, outermost) {
                                  Severity: Minor
                                  Found in assets/js/prototype.js - About 35 mins to fix

                                    Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                                "CHILD": function (type, what, argument, first, last) {
                                    Severity: Minor
                                    Found in assets/js/prototype.js - About 35 mins to fix

                                      Function showThemeSelected has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      function showThemeSelected(element) {
                                          if (!document.getElementsByTagName) return;
                                          var divs = document.getElementsByTagName("div");
                                          for (var i = 0; i < divs.length; i++) {
                                              var div = divs[i];
                                      Severity: Minor
                                      Found in assets/js/xo-installer.js - About 35 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

                                      Function getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public static function getEditor($helper = null, $options = null)
                                          {
                                              /** @var Helper $helper */
                                              if (null === $options) {
                                                  $options           = [];
                                      Severity: Minor
                                      Found in class/Common/SysUtility.php - About 35 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language