openSUSE/open-build-service

View on GitHub

Showing 574 of 632 total issues

Class BsRequestAction has 50 methods (exceeds 20 allowed). Consider refactoring.
Open

class BsRequestAction < ApplicationRecord
  #### Includes and extends
  include ParsePackageDiff
  include BsRequestAction::Errors
  #### Constants
Severity: Minor
Found in src/api/app/models/bs_request_action.rb - About 7 hrs to fix

    Class PackageController has 50 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Webui::PackageController < Webui::WebuiController
      include ParsePackageDiff
      include Webui::PackageHelper
      include Webui::ManageRelationships
      include BuildLogSupport
    Severity: Minor
    Found in src/api/app/controllers/webui/package_controller.rb - About 7 hrs to fix

      Method branch_local_repositories has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
      Open

        def branch_local_repositories(project, pkg_to_enable, opts = {})
          # shall we use the repositories from a different project?
          project = project.update_instance('OBS', 'BranchRepositoriesFromProject')
          skip_repos = []
          a = project.find_attribute('OBS', 'BranchSkipRepositories')
      Severity: Minor
      Found in src/api/app/models/project.rb - About 6 hrs 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 project_index has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

        def project_index
          prj = nil
          unless params[:project] == '_dispatchprios'
            prj = Project.get_by_name(params[:project])
          end
      Severity: Minor
      Found in src/api/app/controllers/build_controller.rb - About 6 hrs 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 determine_details_about_package_to_branch has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

        def determine_details_about_package_to_branch(p)
          return unless p[:link_target_project].is_a?(Project) # only for local source projects
      
          check_for_update_project(p) unless params[:ignoredevel]
      
      
      Severity: Minor
      Found in src/api/app/models/branch_package.rb - About 6 hrs 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 changestate_accepted has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

        def changestate_accepted(opts)
          # all maintenance_incident actions go into the same incident project
          incident_project = nil # .where(type: 'maintenance_incident')
          bs_request_actions.each do |action|
            source_project = Project.find_by_name(action.source_project)
      Severity: Minor
      Found in src/api/app/models/bs_request.rb - About 6 hrs 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_changestate_permissions has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

        def cmd_changestate_permissions(opts)
          # We do not support to revert changes from accepted requests (yet)
          if req.state == :accepted
            raise PostRequestNoPermission, 'change state from an accepted state is not allowed.'
          end
      Severity: Minor
      Found in src/api/app/models/bs_request_permission_check.rb - About 6 hrs 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 create_expand_package has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def create_expand_package(packages, opts = {})
          newactions = []
          incident_suffix = ''
      
          # The maintenance ID is always the sub project name of the maintenance project
      Severity: Major
      Found in src/api/app/models/bs_request_action.rb - About 5 hrs to fix

        Class Base has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Base < ApplicationRecord
            self.inheritance_column = 'eventtype'
            self.table_name = 'events'
        
            after_create :create_project_log_entry_job, if: -> { (PROJECT_CLASSES | PACKAGE_CLASSES).include?(self.class.name) }
        Severity: Minor
        Found in src/api/app/models/event/base.rb - About 5 hrs to fix

          Class ProjectController has 43 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Webui::ProjectController < Webui::WebuiController
            include Webui::RequestHelper
            include Webui::ProjectHelper
            include Webui::ManageRelationships
          
          
          Severity: Minor
          Found in src/api/app/controllers/webui/project_controller.rb - About 5 hrs to fix

            Method find_packages_to_branch has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

              def find_packages_to_branch
                @packages = []
                if params[:request]
                  # find packages from request
                  req = BsRequest.find_by_number(params[:request])
            Severity: Minor
            Found in src/api/app/models/branch_package.rb - About 5 hrs 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 default_reviewers has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

              def default_reviewers
                reviews = []
                return reviews unless target_project
            
                tprj = Project.get_by_name(target_project)
            Severity: Minor
            Found in src/api/app/models/bs_request_action.rb - About 5 hrs 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_update_project has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

              def check_for_update_project(p)
                pkg = p[:package]
                prj = p[:link_target_project]
                if pkg.is_a?(Package)
                  logger.debug "Check Package #{p[:package].project.name}/#{p[:package].name}"
            Severity: Minor
            Found in src/api/app/models/branch_package.rb - About 5 hrs 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

            File branch_package.rb has 398 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class BranchPackage
              attr_accessor :params
            
              include BranchPackage::Errors
            
            
            Severity: Minor
            Found in src/api/app/models/branch_package.rb - About 5 hrs to fix

              Method project_command_copy has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

                def project_command_copy
                  project_name = params[:project]
              
                  @project = Project.find_by_name(project_name)
                  unless (@project && User.session!.can_modify?(@project)) || User.session!.can_create_project?(project_name)
              Severity: Minor
              Found in src/api/app/controllers/source_controller.rb - About 5 hrs 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 render_grouplist_ldap has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.render_grouplist_ldap(grouplist, user = nil)
                  result = []
                  if @@ldap_search_con.nil?
                    @@ldap_search_con = initialize_ldap_con(CONFIG['ldap_search_user'], CONFIG['ldap_search_auth'])
                  end
              Severity: Minor
              Found in src/api/app/models/user_ldap_strategy.rb - About 5 hrs 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 binary_packages has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                def binary_packages
                  check_package_access(params[:project], params[:package], false)
                  @pkg = Package.find_by_project_and_name(params[:project], params[:package])
              
                  begin
              Severity: Minor
              Found in src/api/app/controllers/public_controller.rb - About 5 hrs 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 sync_repository_pathes has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                def sync_repository_pathes
                  # check all my repositories and ..
                  repositories.each do |repo|
                    cycle_detection = {}
                    repo.path_elements.each do |path|
              Severity: Minor
              Found in src/api/app/models/project.rb - About 4 hrs 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 render_xml has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                def render_xml
                  builder = Nokogiri::XML::Builder.new
                  builder.binary(render_attributes) do |binary|
                    binary.operation(operation)
              
              
              Severity: Minor
              Found in src/api/app/models/binary_release.rb - About 4 hrs 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 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                def update
                  respond_to do |format|
                    xml = Nokogiri::XML(request.raw_post, &:strict).root
                    attribs = {}
                    attribs[:name] = xml.xpath('name[1]/text()').to_s unless xml.xpath('name[1]/text()').empty?
              Severity: Minor
              Found in src/api/app/controllers/issue_trackers_controller.rb - About 4 hrs 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