Showing 395 of 429 total issues
Method load_from_xml
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_from_xml(patchinfo_xml)
self.binaries = []
patchinfo_xml.elements('binary').each do |binaries|
self.binaries << binaries
end
Method default_reviewers
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def default_reviewers
reviews = []
return reviews unless target_project
tprj = Project.get_by_name(target_project)
Method package_command
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def package_command
params[:user] = User.session!.login
raise MissingParameterError, 'POST request without given cmd parameter' unless params[:cmd]
Method call_diststats
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call_diststats(bdep, jobs)
@timings = {}
@pngkey = Digest::MD5.hexdigest(params.to_s)
@rebuildtime = 0
Method changestate_accepted
has a Cognitive Complexity of 15 (exceeds 8 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)
- Read upRead up
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 branch_copy_flags
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def branch_copy_flags(project)
# Copy the flags from the other project, adjusting them appropriately
# for this one being a branch of it:
#
# - enable building
- Read upRead up
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 perform
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def perform
if semaphore.locked?
Rails.logger.debug 'skip lastnotifications, still locked'
return
end
- Read upRead up
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_expand_errors!
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def check_for_expand_errors!(add_revision)
return unless action_type.in?(%i[submit release maintenance_incident maintenance_release])
# validate that the sources are not broken
begin
- Read upRead up
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 instantiate_container
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def instantiate_container(project, opackage, opts = {})
opkg = opackage.origin_container
pkg_name = opkg_name = opkg.name
if opkg.is_a?(Package) && opkg.project.is_maintenance_release?
# strip incident suffix
- Read upRead up
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 start
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def self.start(options = {})
return unless Rails.env.test?
return if @backend
return if ENV['BACKEND_STARTED']
- Read upRead up
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 rdiff
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
def rdiff
@last_rev = @package.dir_hash['rev']
@linkinfo = @package.linkinfo
if params[:oproject]
@oproject = ::Project.find_by_name(params[:oproject])
- Read upRead up
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 post_userinfo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def post_userinfo
authorize @user, :update?
login = params[:login]
# just for permission checking
Method check_action_permission!
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_action_permission!(skip_source = nil)
# find objects if specified or report error
role = nil
sprj = nil
if person_name
Method show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
project_name = params[:project]
if params.key?(:deleted)
unless Project.find_by_name(project_name) || Project.is_remote_project?(project_name)
# project is deleted or not accessible
Method update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
@configuration = ::Configuration.fetch
xml = Xmlhash.parse(request.raw_post) || {}
attribs = {}
Method render_xml
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_xml
builder = Nokogiri::XML::Builder.new
builder.binary(render_attributes) do |binary|
binary.operation(operation)
Method show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
logger.info("Statistics for RebuildTimesController#show: #{User.possibly_nobody.login}")
@repository = params[:repository]
@arch = params[:arch]
@hosts = (params[:hosts] || 40).to_i
Consider simplifying this complex logical expression. Open
if Flipper.enabled?(:request_show_redesign, User.session)
@history_elements = @bs_request.history_elements.includes(:user)
@active_tab = 'conversation'
render :beta_show
else
Method update_from_xml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_from_xml(xmlhash)
with_lock do
self.email = xmlhash.value('email')
end
save!
Method build
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build
# the target is by default the _link target
# maintenance_release creates new packages instance, but are changing the source only according to the link
provided_in_other_action = check_for_local_linked_packages(source_package)
# fallback name as last resort