openSUSE/open-build-service

View on GitHub

Showing 341 of 432 total issues

Method branch has 6 arguments (exceeds 5 allowed). Consider refactoring.
Open

        def self.branch(target_project, target_package, source_project, source_package, user, options = {})
Severity: Minor
Found in src/api/app/lib/backend/api/sources/package.rb - About 35 mins to fix

    Method log_chunk has 6 arguments (exceeds 5 allowed). Consider refactoring.
    Open

            def self.log_chunk(project_name, package_name, repository_name, architecture_name, starting_line, ending_line)
    Severity: Minor
    Found in src/api/app/lib/backend/api/build_results/status.rb - About 35 mins to fix

      Method raw_log_chunk has 6 arguments (exceeds 5 allowed). Consider refactoring.
      Open

        def raw_log_chunk(project, package_name, repo, arch, start, theend)
      Severity: Minor
      Found in src/api/app/mixins/build_log_support.rb - About 35 mins to fix

        Method info has 6 arguments (exceeds 5 allowed). Consider refactoring.
        Open

            def self.info(method, host, port, path, response, start_time)
        Severity: Minor
        Found in src/api/app/lib/backend/logger.rb - About 35 mins to fix

          Method get_log_chunk has 6 arguments (exceeds 5 allowed). Consider refactoring.
          Open

            def get_log_chunk(project, package_name, repo, arch, start, theend)
          Severity: Minor
          Found in src/api/app/mixins/build_log_support.rb - About 35 mins to fix

            Method can_register? has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def self.can_register?
                # No registering if LDAP is on
                if CONFIG['ldap_mode'] == :on && !User.admin_session?
                  logger.debug 'Someone tried to register with "ldap_mode" turned on'
                  raise ErrRegisterSave, 'Sorry, new users can only sign up via LDAP'
            Severity: Minor
            Found in src/api/app/models/unregistered_user.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 search has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def search(options = {})
                args = { ranker: RANKER,
                         star: STAR,
                         max_matches: MAX_MATCHES,
                         order: 'adjusted_weight DESC',
            Severity: Minor
            Found in src/api/app/models/full_text_search.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 check_for_local_linked_packages has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

                  def check_for_local_linked_packages(spkg)
                    # the target is by default the _link target
                    # maintenance_release creates new packages instance, but are changing the source only according to the link
                    return if action.target_package && action.action_type == :maintenance_incident
            
            
            Severity: Minor
            Found in src/api/app/models/bs_request_action/differ/query_builder.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 gather_current_buildcode has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def gather_current_buildcode(srep, arch)
                @buildcode = 'unknown'
                begin
                  package = CGI.escape(@multibuild_pkg || @pkg.name)
                  resultlist = Xmlhash.parse(Backend::Api::BuildResults::Status.build_result(@pkg.project.name, package, srep['name'], arch))
            Severity: Minor
            Found in src/api/app/models/package_build_status.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 _update_from_xml_binaries has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def _update_from_xml_binaries(cbl, xmlhash)
                hasharray = []
                xmlhash.each do |b|
                  arch = nil
                  arch = Architecture.find_by_name!(b['arch']) if b['arch']
            Severity: Minor
            Found in src/api/app/models/channel.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 cleanup_linking_repos has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def cleanup_linking_repos
                # replace links to this project repositories with links to the "deleted" repository
                find_repos(:linking_repositories) do |linking_repository|
                  linking_repository.path_elements.includes(:link).find_each do |path_element|
                    next unless path_element.link.db_project_id == id && path_element.repository.db_project_id != id
            Severity: Minor
            Found in src/api/app/models/project.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 get_by_name has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

                def get_by_name(name, include_all_packages: false)
                  dbp = find_by_name(name, skip_check_access: true)
                  if dbp.nil?
                    dbp, remote_name = find_remote_project(name)
                    return "#{dbp.name}:#{remote_name}" if dbp
            Severity: Minor
            Found in src/api/app/models/project.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 update_linked_projects has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

                def update_linked_projects(xmlhash)
                  position = 1
                  # destroy all current linked projects
                  project.linking_to.destroy_all
            
            
            Severity: Minor
            Found in src/api/app/models/project/update_from_xml_command.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 cmd_setincident_permissions has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def cmd_setincident_permissions
                raise ReviewChangeStateNoPermission, 'The request is not in state new or review' unless req.state.in?(%i[review new])
            
                req.bs_request_actions.each do |action|
                  set_permissions_for_action(action)
            Severity: Minor
            Found in src/api/app/models/bs_request_permission_check.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 write_attributes has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def write_attributes
                return unless CONFIG['global_write_through']
            
                project_name = is_a?(Project) ? name : project.name
                if is_a?(Package)
            Severity: Minor
            Found in src/api/app/models/concerns/has_attributes.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 all has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

                  def all
                    inner_or = []
                    @relation, inner_or = extend_relation('source', @relation, roles, package_name, subprojects, project_name, inner_or)
                    @relation, inner_or = extend_relation('target', @relation, roles, package_name, subprojects, project_name, inner_or)
            
            
            Severity: Minor
            Found in src/api/app/models/bs_request/find_for/project.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 run has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

                def run(xmlhash, force = nil)
                  project.check_write_access!
            
                  # check for raising read access permissions, which can't get ensured atm
                  raise ForbiddenError if !(project.new_record? || project.disabled_for?('access', nil, nil)) && (FlagHelper.xml_disabled_for?(xmlhash, 'access') && !User.admin_session?)
            Severity: Minor
            Found in src/api/app/models/project/update_from_xml_command.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 has_local_role? has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def has_local_role?(role, object)
                if object.is_a?(Package) || object.is_a?(Project)
                  logger.debug "running local role package check: user #{login}, package #{object.name}, role '#{role.title}'"
                  rels = object.relationships.where(role_id: role.id, user_id: id)
                  return true if rels.exists?
            Severity: Minor
            Found in src/api/app/models/user.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 find_with_credentials_via_ldap has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def self.find_with_credentials_via_ldap(login, password)
                user = find_by_login(login)
                ldap_info = nil
            
                return user.authenticate_via_password(password) if user.try(:ignore_auth_services?)
            Severity: Minor
            Found in src/api/app/models/user.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 set_parameters has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
            Open

              def set_parameters
                @search_attrib_type_id = nil
                @search_attrib_type_id = params[:attrib_type_id] if params[:attrib_type_id].present?
            
                search_issue
            Severity: Minor
            Found in src/api/app/controllers/webui/search_controller.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

            Severity
            Category
            Status
            Source
            Language