scitran/core

View on GitHub

Showing 294 of 518 total issues

Function _append_targets has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _append_targets(self, targets, cont_name, container, prefix, total_size, total_cnt, data_path, filters):
Severity: Major
Found in api/download.py - About 1 hr to fix

    Function process_upload has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def process_upload(request, strategy, container_type=None, id_=None, origin=None, context=None, response=None, metadata=None):
    Severity: Major
    Found in api/upload.py - About 1 hr to fix

      Function _mergeExampleWithRef has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      SchemaTranspiler.prototype._mergeExampleWithRef = function(schema, defs, id) {
          var ref, m;
          if( defs ) {
              m = RE_LOCAL_REF.exec(schema.$ref);
              if( m ) {
      Severity: Minor
      Found in swagger/support/schema-transpiler.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 packfile_start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def packfile_start(self, cont_name, **kwargs):
              """
              Declare intent to upload a packfile to a project, and recieve an upload token identifier.
              """
      
      
      Severity: Minor
      Found in api/handlers/listhandler.py - 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 get_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_all(self):
              projection = self.container_handler_configurations['collections']['list_projection']
              if self.superuser_request:
                  permchecker = always_ok
              elif self.public_request:
      Severity: Minor
      Found in api/handlers/collectionshandler.py - 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 notes_sublist has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def notes_sublist(handler, container):
          """
          permissions checker for notes_sublist
          """
          access = _get_access(handler.uid, container)
      Severity: Minor
      Found in api/auth/listauth.py - 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 upsert_fileinfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def upsert_fileinfo(cont_name, _id, fileinfo):
      
          cont_name = containerutil.pluralize(cont_name)
          _id = bson.ObjectId(_id)
      
      
      Severity: Minor
      Found in api/dao/hierarchy.py - 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 upload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def upload(self, strategy):
              """Receive a sortable reaper upload."""
      
              if not self.superuser_request:
                  user = self.uid
      Severity: Minor
      Found in api/upload.py - 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 process_file_field has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_file_field(self, field, file_attrs):
              if self.metadata is not None:
                  file_mds = self.metadata.get(self.container_type, {}).get('files', [])
      
                  for file_md in file_mds:
      Severity: Minor
      Found in api/placer.py - 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 mongo_sanitize_fields has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def mongo_sanitize_fields(d):
          """
          Sanitize keys of arbitrarily structured map without flattening into dot notation
      
          Adapted from http://stackoverflow.com/questions/8429318/how-to-use-dot-in-field-name
      Severity: Minor
      Found in api/util.py - 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 from_schema_path has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def from_schema_path(schema_url):
          if schema_url is None:
              return no_op
          # split the url in base_uri and schema_name
          schema, resolver = _resolve_schema(schema_url)
      Severity: Minor
      Found in api/validators.py - 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 f has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def f(method, _id=None, payload=None, unset_payload=None, recursive=False, r_payload=None, replace_metadata=False):
      Severity: Major
      Found in api/auth/containerauth.py - About 50 mins to fix

        Function download_ticket has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def download_ticket(ip, origin, type_, target, filename, size, projects = None):
        Severity: Major
        Found in api/util.py - About 50 mins to fix

          Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, container_type, container, id_, metadata, timestamp, origin, context):
          Severity: Major
          Found in api/placer.py - About 50 mins to fix

            Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, container_type, container, id_, metadata, timestamp, origin, context):
            Severity: Major
            Found in api/placer.py - About 50 mins to fix

              Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, container_type, container, id_, metadata, timestamp, origin, context):
              Severity: Major
              Found in api/placer.py - About 50 mins to fix

                Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, container_type, container, id_, metadata, timestamp, origin, context):
                Severity: Major
                Found in api/placer.py - About 50 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if( !this.validateName(k) ) {
                                          errors.push(new LintError('Invalid definition name: "' + k + '"', filename));
                                      }
                  Severity: Major
                  Found in swagger/support/schema-lint.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if c.get('inputs') is None:
                                                c['inputs'] = {}
                    
                    
                    Severity: Major
                    Found in api/jobs/handlers.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if y.get('_id') == self.uid:
                                                  ok = True
                                                  break
                      
                      
                      Severity: Major
                      Found in api/handlers/resolvehandler.py - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language