SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

Method update_timestamps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def update_timestamps(from, to)
            begin
              ["updated_at"].each do |key|
                if to.has_attribute?(key)
                  logger.debug("explicit_versioning - update_timestamps method - setting timestamp_column '#{key}'")
Severity: Minor
Found in lib/explicit_versioning.rb - About 35 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

Method resolve_admin_defined_role_projects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def resolve_admin_defined_role_projects
      projects =  Seek::Config.project_hierarchy_enabled ? self.projects_and_descendants : self.projects

      admin_defined_role_projects.each do |role|
        unless projects.include?(role.project)
Severity: Minor
Found in lib/seek/admin_defined_roles.rb - About 35 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

Method cache_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def cache_path(size=nil, include_local_name=false)
        id = self.kind_of?(Integer) ? self : self.id
        if self.kind_of?(ContentBlob)
          rtn = Seek::Config.temporary_filestore_path + '/image_assets'
        elsif self.kind_of?(Avatar)
Severity: Minor
Found in lib/seek/acts_as_fleximage_extension.rb - About 35 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

Method ontology_editor_display has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def ontology_editor_display type, root_id=nil, selected_id=nil

          # login users can edit new defined assay/technology types
          # only admin can edit/delete new defined assay/technology types
          show_edit = false
Severity: Minor
Found in lib/acts_as_ontology_view_helper.rb - About 35 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

Avoid too many return statements within this function.
Open

                return [arcIntersections[0], arcIntersections[1]];
Severity: Major
Found in app/assets/javascripts/modified_cytoscape.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return [arcIntersections[0], arcIntersections[1]];
    Severity: Major
    Found in app/assets/javascripts/modified_cytoscape.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return [arcIntersections[0], arcIntersections[1]];
      Severity: Major
      Found in app/assets/javascripts/modified_cytoscape.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return [arcIntersections[0], arcIntersections[1]];
        Severity: Major
        Found in app/assets/javascripts/modified_cytoscape.js - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return nil
          Severity: Major
          Found in app/models/content_blob.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return false
            Severity: Major
            Found in app/models/user.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return downloadable ? I18n.t('access.editing_downloadable') : I18n.t('access.editing')
              Severity: Major
              Found in app/models/policy.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return "Invalid access type"
                Severity: Major
                Found in app/models/policy.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return I18n.t('access.managing')
                  Severity: Major
                  Found in app/models/policy.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return false
                    Severity: Major
                    Found in app/models/user.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                return false
                      Severity: Major
                      Found in app/models/user.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return false unless process_from_url(item_params)
                        Severity: Major
                        Found in lib/seek/upload_handling/data_upload.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return false unless process_upload(item_params)
                          Severity: Major
                          Found in lib/seek/upload_handling/data_upload.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                      return false unless check_for_valid_scheme(item_params)
                            Severity: Major
                            Found in lib/seek/upload_handling/data_upload.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return false
                              Severity: Major
                              Found in lib/seek/permissions/authorization.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return access_type >= Policy::MANAGING
                                Severity: Major
                                Found in lib/seek/permissions/authorization.rb - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language