datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

Avoid deeply nested control flow statements.
Open

            if (eAttachment.left === 'left') {
              left -= targetWidth;
              tAttachment.left = 'left';
              left -= width;
              eAttachment.left = 'right';
Severity: Major
Found in src/browser/static/dbwipes/js/lib/tether.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

              } else if (tAttachment.left === 'center') {
                if (left + width > bounds[2] && eAttachment.left === 'left') {
                  left -= width;
                  eAttachment.left = 'right';
                } else if (left < bounds[0] && eAttachment.left === 'right') {
    Severity: Major
    Found in src/apps/dbwipes/static/js/lib/tether.js - About 45 mins to fix

      Function cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function cmn(q, a, b, x, s, t) {
      Severity: Minor
      Found in src/browser/static/dbwipes/js/lib/md5.js - About 45 mins to fix

        Function cmn has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function cmn(q, a, b, x, s, t) {
        Severity: Minor
        Found in src/apps/dbwipes/static/js/lib/md5.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    } else if (tAttachment.left === 'center') {
                      if (left + width > bounds[2] && eAttachment.left === 'left') {
                        left -= width;
                        eAttachment.left = 'right';
                      } else if (left < bounds[0] && eAttachment.left === 'right') {
          Severity: Major
          Found in src/browser/static/dbwipes/js/lib/tether.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (priorKey) {
                          execIteration(priorKey, i-1);
                        }
            Severity: Major
            Found in src/browser/static/datatables/js/dataTables.extra.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (eAttachment.left === 'left') {
                            left -= targetWidth;
                            tAttachment.left = 'left';
                            left -= width;
                            eAttachment.left = 'right';
              Severity: Major
              Found in src/apps/dbwipes/static/js/lib/tether.js - About 45 mins to fix

                Function db_schema has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def db_schema(db, table):
                  """
                  only works for postgres
                
                  @return dictionary of column name -> python type object
                Severity: Minor
                Found in src/apps/dbwipes/db.py - 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

                Function export_table has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def export_table(self, repo, table, file_name=None, file_format='CSV',
                Severity: Minor
                Found in src/api/serializer.py - About 45 mins to fix

                  Function find_security_policies has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def find_security_policies(
                  Severity: Minor
                  Found in src/api/serializer.py - About 45 mins to fix

                    Function schema has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def schema(request, repo, table):
                        username = request.user.get_username()
                        manager = DataHubManager(username)
                        repos = get_repos(manager)
                        if repos is not None and repo in repos:
                    Severity: Minor
                    Found in src/apps/datatables/views.py - 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

                    Function schema has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def schema(request, repo_name, table_name):
                        username = request.user.get_username()
                        manager = DataHubManager(username)
                        repos = get_repos(manager)
                        if repos is not None and repo_name in repos:
                    Severity: Minor
                    Found in src/apps/dataq/views.py - 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

                    Function add_password has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def add_password(request, is_disconnect=False):
                        """
                        Presents a form asking the current user to set a password on their account.
                    
                        Used by both the settings page and disconnect pipeline.
                    Severity: Minor
                    Found in src/account/views.py - 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

                    Function create_table_from_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def create_table_from_file(self, repo, table, file_name, delimiter,
                    Severity: Minor
                    Found in src/api/serializer.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if c_name == col_name and can_apply(agg_type, col_name):
                                              result = manager.execute_sql(
                                                  "SELECT %s(%s) FROM %s.%s" % (agg_type.lower(), col_name.lower(), repo, table))
                                              if "tuples" in result and len(result["tuples"]) > 0 and len(result["tuples"][0]) > 0:
                                                  return json_response({"value": result["tuples"][0]})
                      Severity: Major
                      Found in src/apps/datatables/views.py - About 45 mins to fix

                        Function license_view_delete has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def license_view_delete(request, repo_base, repo, table,
                        Severity: Minor
                        Found in src/browser/views.py - About 45 mins to fix

                          Function default has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def default(self, o):
                                  if isinstance(o, float):
                                      if o == float('inf'):
                                          return 1e100
                                      elif o == float('-inf'):
                          Severity: Minor
                          Found in src/apps/dbwipes/util.py - 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

                          Function export_table has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def export_table(self, repo, table, file_name, file_format='CSV',
                          Severity: Minor
                          Found in src/core/db/manager.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if op == "=":
                                                        text = "'%" + text + "%'"
                                                        op = "ILIKE"
                                                    elif op == "!=":
                                                        text = "'%" + text + "%'"
                            Severity: Major
                            Found in src/apps/datatables/util/run_draw_request.py - About 45 mins to fix

                              Function create_user_db_and_data_folder_if_needed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def create_user_db_and_data_folder_if_needed(sender, instance, **kwargs):
                                  """
                                  Creates a Postgres role and db and data folder to go with new Django users.
                              
                                  Raises an exception if the role, database, or user data folder exists
                              Severity: Minor
                              Found in src/account/signals.py - 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

                              Severity
                              Category
                              Status
                              Source
                              Language