mambax7/moduleinstaller

View on GitHub

Showing 122 of 200 total issues

Method checkVerModule has 42 lines of code (exceeds 25 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 1 hr to fix

    Function serializeElements has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        serializeElements: function (elements, options) {
            if (typeof options != 'object') options = {hash: !!options};
            else if (Object.isUndefined(options.hash)) options.hash = true;
            var key, value, submitted = false, submit = options.submit, accumulator, initial;
    
    
    Severity: Minor
    Found in assets/js/prototype.js - About 1 hr to fix

      Function checkAccess has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function checkAccess()
          {
              if (INSTALL_USER != '' && INSTALL_PASSWORD != '') {
                  if (!isset($_SERVER['PHP_AUTH_USER'])) {
                      \header('WWW-Authenticate: Basic realm="XOOPS Installer"');
      Severity: Minor
      Found in class/InstallWizard.php - About 1 hr 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 loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function loadTableFromArrayWithReplace($table, $data, $search, $replace)
      {
          /** @var \XoopsMySQLDatabase $db */
          $db = \XoopsDatabaseFactory::getDatabaseConnection();
      
      
      Severity: Minor
      Found in testdata/index.php - About 1 hr 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 passwordStrength has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function passwordStrength(password) {
          if (password.length == 0) {
              var score = 0;
          } else {
              var score = 1;
      Severity: Minor
      Found in assets/js/xo-installer.js - About 1 hr 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 getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 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

      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 addCombinator has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function addCombinator(matcher, combinator, base) {
              var dir = combinator.dir,
                  checkNonElements = base && dir === "parentNode",
                  doneName = done++;
      
      
      Severity: Minor
      Found in assets/js/prototype.js - About 1 hr to fix

        Function update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function update(element, content) {
                element = $(element);
        
                var descendants = element.getElementsByTagName('*'),
                    i = descendants.length;
        Severity: Minor
        Found in assets/js/prototype.js - About 1 hr to fix

          Function addMethods has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function addMethods(methods) {
                  if (arguments.length === 0) addFormMethods();
          
                  if (arguments.length === 2) {
                      var tagName = methods;
          Severity: Minor
          Found in assets/js/prototype.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                            if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
                                submit !== false && (!submit || key == submit) && (submitted = true)))) {
                                result = accumulator(result, key, value);
                            }
            Severity: Critical
            Found in assets/js/prototype.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                                          } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
                                              diff = cache[1];
              
                                          } else {
                                              while ((node = ++nodeIndex && node && node[dir] ||
              Severity: Critical
              Found in assets/js/prototype.js - About 1 hr to fix

                Method getServerStats has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getServerStats()
                    {
                        //mb    $wfdownloads = WfdownloadsWfdownloads::getInstance();
                        $moduleDirName      = \basename(\dirname(__DIR__, 2));
                        $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                Severity: Minor
                Found in class/Common/ServerStats.php - About 1 hr to fix

                  Function addMethods has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function addMethods(source) {
                          var ancestor = this.superclass && this.superclass.prototype,
                              properties = Object.keys(source);
                  
                          if (IS_DONTENUM_BUGGY) {
                  Severity: Minor
                  Found in assets/js/prototype.js - About 1 hr to fix

                    Function respondToReadyState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        respondToReadyState: function (readyState) {
                            var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
                    
                            if (state == 'Complete') {
                                try {
                    Severity: Minor
                    Found in assets/js/prototype.js - About 1 hr 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 rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function rrmdir($src)
                        {
                            // 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 1 hr 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

                    Method checkAccess has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function checkAccess()
                        {
                            if (INSTALL_USER != '' && INSTALL_PASSWORD != '') {
                                if (!isset($_SERVER['PHP_AUTH_USER'])) {
                                    \header('WWW-Authenticate: Basic realm="XOOPS Installer"');
                    Severity: Minor
                    Found in class/InstallWizard.php - About 1 hr to fix

                      Method xoops_module_install_moduleinstaller has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function xoops_module_install_moduleinstaller(\XoopsModule $module)
                      {
                          require_once \dirname(__DIR__, 3) . '/mainfile.php';
                      
                          $moduleDirName = \basename(\dirname(__DIR__));
                      Severity: Minor
                      Found in include/oninstall.php - About 1 hr to fix

                        Method loadTableFromArrayWithReplace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function loadTableFromArrayWithReplace($table, $data, $search, $replace)
                        {
                            /** @var \XoopsMySQLDatabase $db */
                            $db = \XoopsDatabaseFactory::getDatabaseConnection();
                        
                        
                        Severity: Minor
                        Found in testdata/index.php - About 1 hr to fix

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

                              request: function (url) {
                                  this.url = url;
                                  this.method = this.options.method;
                                  var params = Object.isString(this.options.parameters) ?
                                      this.options.parameters :
                          Severity: Minor
                          Found in assets/js/prototype.js - About 1 hr to fix

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