mambax7/moduleinstaller

View on GitHub

Showing 122 of 200 total issues

File prototype.js has 6104 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*  Prototype JavaScript framework, version 1.7.3
 *  (c) 2005-2010 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
Severity: Major
Found in assets/js/prototype.js - About 2 wks to fix

    Function xoops_module_update has a Cognitive Complexity of 320 (exceeds 5 allowed). Consider refactoring.
    Open

    function xoops_module_update($dirname)
    {
        $errs = [];
        $config_old = [];
        $msgs = [];
    Severity: Minor
    Found in extras/modulesadmin.php - About 6 days 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 xoops_module_install has a Cognitive Complexity of 277 (exceeds 5 allowed). Consider refactoring.
    Open

    function xoops_module_install($dirname)
    {
        $pieces = null;
        global $xoopsUser, $xoopsConfig;
        $dirname = trim((string) $dirname);
    Severity: Minor
    Found in extras/modulesadmin.php - About 5 days 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

    File modulesadmin.php has 1224 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    /*
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
     * which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Major
    Found in extras/modulesadmin.php - About 3 days to fix

      Method xoops_module_install has 475 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xoops_module_install($dirname)
      {
          $pieces = null;
          global $xoopsUser, $xoopsConfig;
          $dirname = trim((string) $dirname);
      Severity: Major
      Found in extras/modulesadmin.php - About 2 days to fix

        Method xoops_module_update has 443 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoops_module_update($dirname)
        {
            $errs = [];
            $config_old = [];
            $msgs = [];
        Severity: Major
        Found in extras/modulesadmin.php - About 2 days to fix

          Function xoops_module_uninstall has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
          Open

          function xoops_module_uninstall($dirname)
          {
              $errs = [];
              global $xoopsConfig;
              $reservedTables = [
          Severity: Minor
          Found in extras/modulesadmin.php - About 2 days 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 setDocument has 215 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              setDocument = Sizzle.setDocument = function (node) {
                  var hasCompare,
                      doc = node ? node.ownerDocument || node : preferredDoc,
                      parent = doc.defaultView;
          
          
          Severity: Major
          Found in assets/js/prototype.js - About 1 day to fix

            Function xoops_module_update_moduleinstaller has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
            Open

            function xoops_module_update_moduleinstaller(\XoopsModule $module, $previousVersion = null)
            {
                $moduleDirName      = \basename(\dirname(__DIR__));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
            
            
            Severity: Minor
            Found in include/onupdate.php - About 1 day 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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function truncateHtml(
                    string  $text,
                    ?int    $length = null,
                    ?string $ending = null,
                    ?bool   $exact = null,
            Severity: Minor
            Found in class/Common/SysUtility.php - About 1 day 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 Enumerable has 206 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Enumerable = (function () {
                function each(iterator, context) {
                    try {
                        this._each(iterator, context);
                    } catch (e) {
            Severity: Major
            Found in assets/js/prototype.js - About 1 day to fix

              Method xoops_module_uninstall has 186 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function xoops_module_uninstall($dirname)
              {
                  $errs = [];
                  global $xoopsConfig;
                  $reservedTables = [
              Severity: Major
              Found in extras/modulesadmin.php - About 7 hrs to fix

                Function Serializers has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                Form.Element.Serializers = (function () {
                    function input(element, value) {
                        switch (element.type.toLowerCase()) {
                            case 'checkbox':
                            case 'radio':
                Severity: Minor
                Found in assets/js/prototype.js - About 5 hrs 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

                File main.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php declare(strict_types=1);
                /*
                 * You may not change or alter any portion of this comment or credits
                 * of supporting developers from this source code or any supporting source code
                 * which is considered copyrighted (c) material of the original comment or credit authors.
                Severity: Minor
                Found in extras/main.php - About 4 hrs to fix

                  Function Hash has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var Hash = Class.create(Enumerable, (function () {
                      function initialize(object) {
                          this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
                      }
                  
                  
                  Severity: Major
                  Found in assets/js/prototype.js - About 3 hrs to fix

                    Function Class has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var Class = (function () {
                    
                        var IS_DONTENUM_BUGGY = (function () {
                            for (var p in {toString: 1}) {
                                if (p === 'toString') return false;
                    Severity: Minor
                    Found in assets/js/prototype.js - About 3 hrs 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 createForm has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function createForm()
                        {
                            $hidden = '';
                            $ret    = '';
                    
                    
                    Severity: Minor
                    Found in class/InstallWizard.php - About 3 hrs 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 Sizzle has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function Sizzle(selector, context, results, seed) {
                            var match, elem, m, nodeType,
                                i, groups, old, nid, newContext, newSelector;
                    
                            if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
                    Severity: Major
                    Found in assets/js/prototype.js - About 3 hrs to fix

                      Function checkVerModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
                          {
                              $moduleDirName      = \basename(\dirname(__DIR__, 2));
                              $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                              $update             = '';
                      Severity: Minor
                      Found in class/Common/VersionChecks.php - About 2 hrs 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 Class has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Class = (function () {
                      
                          var IS_DONTENUM_BUGGY = (function () {
                              for (var p in {toString: 1}) {
                                  if (p === 'toString') return false;
                      Severity: Major
                      Found in assets/js/prototype.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language