openSUSE/open-build-service

View on GitHub

Showing 336 of 425 total issues

Method cleanup_before_destroy has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def cleanup_before_destroy
    # change all linking repository pathes
    linking_repositories.each do |lrep|
      lrep.path_elements.includes(:link, :repository).find_each do |pe|
        next unless pe.link == self # this is not pointing to our repo
Severity: Minor
Found in src/api/app/models/repository.rb - About 1 hr to fix

    Method parse_single_bugzilla_issue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def parse_single_bugzilla_issue(bugzilla_response)
        issue = Issue.find_by_name_and_tracker(bugzilla_response['id'].to_s, name)
        return unless issue
    
        issue.state = if bugzilla_response['is_open']
    Severity: Minor
    Found in src/api/app/models/issue_tracker.rb - About 1 hr to fix

      Method internal_register has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def internal_register
          if ::Configuration.ldap_enabled?
            render_error(
              status: 403,
              errorcode: 'permission_denied',
      Severity: Minor
      Found in src/api/app/controllers/person_controller.rb - About 1 hr to fix

        Method search has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def search
            # If there is nothing to search for, just return
            return unless params[:search_text]
        
            # If the search is too short, return too
        Severity: Minor
        Found in src/api/app/controllers/webui/search_controller.rb - About 1 hr to fix

          Method show has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def show
              # TODO: Remove this `if` condition, and the `else` clause once request_show_redesign is rolled out
              if Flipper.enabled?(:request_show_redesign, User.session)
                @history_elements = @bs_request.history_elements.includes(:user)
                @active_tab = 'conversation'
          Severity: Minor
          Found in src/api/app/controllers/webui/request_controller.rb - About 1 hr to fix

            Method put_or_post has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def self.put_or_post(method, path, data, in_headers)
                  start_time = Time.now
                  Rails.logger.debug { "[backend] #{method}: #{path}" }
                  timeout = in_headers.delete('Timeout')
                  backend_request = if method == 'PUT'
            Severity: Minor
            Found in src/api/app/lib/backend/connection.rb - About 1 hr to fix

              Method add_channel_repos_to_project has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def add_channel_repos_to_project(target_package, mode = nil)
                  if channel_targets.empty?
                    # not defined in channel, so take all from project
                    target_package.project.branch_to_repositories_from(package.project, package, extend_names: true)
                    return
              Severity: Minor
              Found in src/api/app/models/channel.rb - About 1 hr 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 13 (exceeds 8 allowed). Consider refactoring.
              Open

                    def all
                      return [bs_request_action.source_package] if bs_request_action.bs_request_action_accept_info # the old package can be gone
              
                      if bs_request_action.source_package
                        bs_request_action.source_access_check! unless skip_access_check?

              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_action_target has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def check_action_target(action)
                  return unless action.action_type.in?(%i[submit change_devel maintenance_release maintenance_incident])
              
                  raise PostRequestNoPermission, "Target package is missing in request #{action.bs_request.number} (type #{action.action_type})" if action.action_type == :change_devel && !action.target_package
              
              
              Severity: Minor
              Found in src/api/app/models/bs_request_permission_check.rb - About 1 hr 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_maintenance_release_accept has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def check_maintenance_release_accept(action)
                  if action.source_rev
                    # FIXME2.4 we have a directory model
                    c = Backend::Api::Sources::Package.files(action.source_project, action.source_package, expand: 1)
                    data = REXML::Document.new(c)
              Severity: Minor
              Found in src/api/app/models/bs_request_permission_check.rb - About 1 hr 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 validate_target_for_package_command_exists! has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def validate_target_for_package_command_exists!
                  @project = nil
                  @package = nil
              
                  follow_project_links = SOURCE_UNTOUCHED_COMMANDS.include?(@command)
              Severity: Minor
              Found in src/api/app/controllers/source_controller.rb - About 1 hr 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_devel_package has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def resolve_devel_package
                  pkg = self
                  prj_name = pkg.project.name
                  processed = {}
              
              
              Severity: Minor
              Found in src/api/app/models/package.rb - About 1 hr 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 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def search
                  # If there is nothing to search for, just return
                  return unless params[:search_text]
              
                  # If the search is too short, return too
              Severity: Minor
              Found in src/api/app/controllers/webui/search_controller.rb - About 1 hr 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_flags has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def update_flags(xmlhash, flagtype, position)
                  # translate the flag types as used in the xml to model name + s
                  validate_type flagtype
              
                  # we need to catch duplicates - and prefer the last
              Severity: Minor
              Found in src/api/app/helpers/flag_helper.rb - About 1 hr 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 monitor_set_filter has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def monitor_set_filter(defaults)
                  @avail_status_values = Buildresult.avail_status_values
                  @status_filter = []
                  excluded_status = %w[disabled excluded unknown]
                  @avail_status_values.each do |s|

              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 has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def find(xpath)
                  # logger.debug "---------------------- parsing xpath: #{xpath} -----------------------"
              
                  begin
                    @stack = @lexer.parse xpath
              Severity: Minor
              Found in src/api/lib/xpath_engine.rb - About 1 hr 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 destroy has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
              Open

                def destroy
                  @comment = Comment.find(params[:id])
                  authorize @comment, :destroy?
                  @commentable = @comment.commentable
              
              
              Severity: Minor
              Found in src/api/app/controllers/webui/comments_controller.rb - About 1 hr 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 extend_packages_to_link has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def extend_packages_to_link(p)
                  return unless p[:package].is_a?(Package) # only for local packages
              
                  pkg = p[:package]
                  if pkg.is_link?
              Severity: Minor
              Found in src/api/app/models/branch_package.rb - About 1 hr to fix

                Method update_generic_relationships has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def update_generic_relationships(xmlhash)
                    # we remember the current relationships in a hash
                    cache = {}
                    relationships.each do |purr|
                      next if @updater.ignore?(purr)
                Severity: Minor
                Found in src/api/app/models/concerns/has_relationships.rb - About 1 hr to fix

                  Method statistic has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def statistic
                        result = backend_statistics
                        return if result.blank?
                  
                        disk = result.dig('disk', 'usage')
                  Severity: Minor
                  Found in src/api/app/models/local_build_statistic/for_package.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language