rsercano/mongoclient

View on GitHub

Showing 331 of 698 total issues

Avoid too many return statements within this function.
Open

        return false;
Severity: Major
Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return false;
    Severity: Major
    Found in client/plugins/chosen_fork/chosen.jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if (resource.db) return resource.db;
      Severity: Major
      Found in client/imports/ui/user_management/roles.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return;
        Severity: Major
        Found in client/imports/ui/collection/add.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return options;
          Severity: Major
          Found in client/imports/ui/collection/add.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return '';
            Severity: Major
            Found in client/imports/ui/user_management/roles.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  if (/getPlanCache\(\).$/gi.test(editorValue)) return 'planCache';
              Severity: Major
              Found in client/imports/ui/shell/index.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return;
                Severity: Major
                Found in client/imports/ui/collection/add.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return false;
                  Severity: Major
                  Found in client/plugins/chosen_fork/chosen.proto.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return false;
                    Severity: Major
                    Found in client/plugins/chosen_fork/chosen.proto.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return options;
                      Severity: Major
                      Found in client/imports/ui/collection/add.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return true;
                        Severity: Major
                        Found in client/plugins/chosen_fork/chosen.proto.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              if (/sh.$/gi.test(editorValue)) return 'sharding';
                          Severity: Major
                          Found in client/imports/ui/shell/index.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return type;
                            Severity: Major
                            Found in client/imports/ui/user_management/tree.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  if (type === 'non-system') return 'all non-system collections';
                              Severity: Major
                              Found in client/imports/ui/user_management/tree.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return 'collection';
                                Severity: Major
                                Found in client/imports/ui/shell/index.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      if (resource.collection) return `<b>${resource.collection}</b>`;
                                  Severity: Major
                                  Found in client/imports/ui/user_management/roles.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return document.documentMode >= 8;
                                    Severity: Major
                                    Found in client/plugins/chosen_fork/chosen.proto.js - About 30 mins to fix

                                      Function changeUsernameAndPasswordFromConnectionUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        changeUsernameAndPasswordFromConnectionUrl(connection, username, password) {
                                          const splitedForDash = connection.url.split('//');
                                      
                                          if (connection.url.indexOf('@') !== -1) {
                                            const splitedForAt = splitedForDash[1].split('@');
                                      Severity: Minor
                                      Found in server/imports/core/connection/helper.js - About 25 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 getResource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        getResource(resource) {
                                          if (!resource) return '';
                                          if (resource.anyResource) return 'anyResource';
                                          if (resource.cluster) return 'cluster';
                                          if (resource.db && resource.collection) return `<b>${resource.collection}</b>@${resource.db}`;
                                      Severity: Minor
                                      Found in client/imports/ui/user_management/roles.js - About 25 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