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
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']
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',
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
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'
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'
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
- 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 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?
- 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_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
- 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_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)
- 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 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)
- 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 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 = {}
- 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 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
- 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 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
- 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 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|
- 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 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
- 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 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
- 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 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?
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)
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')