mambax7/moduleinstaller

View on GitHub

Showing 122 of 200 total issues

Function replace_IE has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function replace_IE(element, content) {
        element = $(element);
        if (content && content.toElement)
            content = content.toElement();
        if (Object.isElement(content)) {
Severity: Minor
Found in assets/js/prototype.js - About 1 hr to fix

    Method loadSampleData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function loadSampleData(): void
    {
        global $xoopsConfig;
        $moduleDirName      = \basename(\dirname(__DIR__));
        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
    Severity: Minor
    Found in testdata/index.php - About 1 hr to fix

      Method xoops_module_deactivate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xoops_module_deactivate($mid)
      {
          $msgs = [];
          global $xoopsConfig;
          // Get module handler
      Severity: Minor
      Found in extras/modulesadmin.php - About 1 hr to fix

        Function getElementsByClassName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        if (!document.getElementsByClassName) document.getElementsByClassName = function (instanceMethods) {
            function iter(name) {
                return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
            }
        
        
        Severity: Minor
        Found in assets/js/prototype.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if (element && isPercentage) {
                      context = context || element.parentNode;
                      var decimal = toDecimal(value), whole = null;
          
                      var isHorizontal = property.include('left') || property.include('right') ||
          Severity: Major
          Found in assets/js/prototype.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                        if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                            support.getById && context.nodeType === 9 && documentIsHTML &&
                            Expr.relative[tokens[1].type]) {
            
                            context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
            Severity: Major
            Found in assets/js/prototype.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                          if (element === document.body) {
                              var bodyScrollNode = document.documentElement || document.body.parentNode || document.body;
                              valueT += !Object.isUndefined(window.pageYOffset) ? window.pageYOffset : bodyScrollNode.scrollTop || 0;
                              valueL += !Object.isUndefined(window.pageXOffset) ? window.pageXOffset : bodyScrollNode.scrollLeft || 0;
                              break;
              Severity: Major
              Found in assets/js/prototype.js - About 1 hr to fix

                Function Selector has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                Prototype.Selector = (function () {
                
                    function select() {
                        throw new Error('Method "Prototype.Selector.select" must be defined.');
                    }
                Severity: Minor
                Found in assets/js/prototype.js - About 55 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 recurseCopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function recurseCopy($src, $dst): void
                    {
                        $dir = \opendir($src);
                        //        @mkdir($dst);
                        if (!@\mkdir($dst) && !\is_dir($dst)) {
                Severity: Minor
                Found in class/Common/FilesManagement.php - About 55 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 Hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                var Hash = Class.create(Enumerable, (function () {
                    function initialize(object) {
                        this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
                    }
                
                
                Severity: Minor
                Found in assets/js/prototype.js - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function rcopy($src, $dest)
                    {
                        // Only continue if user is a 'global' Admin
                        if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                            return false;
                Severity: Minor
                Found in class/Common/FilesManagement.php - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function rmove($src, $dest)
                    {
                        // Only continue if user is a 'global' Admin
                        if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                            return false;
                Severity: Minor
                Found in class/Common/FilesManagement.php - About 55 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 (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 (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 ((newCache[2] = matcher(elem, context, xml))) {
                                                          return true;
                                                      }
                      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 ((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 ('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 (Expr.relative[tokens[j].type]) {
                                                          break;
                                                      }
                              Severity: Major
                              Found in assets/js/prototype.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language