mambax7/moduleinstaller

View on GitHub

Showing 122 of 198 total issues

Function Selector has 29 lines of code (exceeds 25 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 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

      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

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

        function xoops_module_deactivate($mid)
        {
            global $xoopsConfig;
            // Get module handler
            /** @var \XoopsModuleHandler $moduleHandler */
        Severity: Minor
        Found in extras/modulesadmin.php - 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

            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

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

                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 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 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 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 (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 (is_file($templateFolder . $v)) {
                                                  unlink($templateFolder . $v);
                                              }
                  Severity: Major
                  Found in include/onupdate.php - 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 ((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

                      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 ((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 ('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
                            Severity
                            Category
                            Status
                            Source
                            Language