Showing 339 of 429 total issues
Method parse_one_diff
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_one_diff(sourcediff)
# Sort files into categories by their ending and add all of them to a hash. We
# will later use the sorted and concatenated categories as key index into the per action file hash.
changes_file_keys = []
spec_file_keys = []
Method sync_hash_with_model
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync_hash_with_model(entry_class, dblist, inhasharray)
keys = entry_class._sync_keys
entries = {}
dblist.each do |e|
Method update_generic_relationships
has a Cognitive Complexity of 14 (exceeds 8 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)
- 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 create_xml
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def create_xml(options = {})
channel = channel_binary_list.channel
builder = Nokogiri::XML::Builder.new
attributes = {
- 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 as_json
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def as_json(options = nil)
if options
if options.key?(:methods)
if options[:methods].is_a?(Array)
options[:methods] << :attrib_namespace_name unless options[:methods].include?(:attrib_namespace_name)
- 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 change_state
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def change_state(opts)
with_lock do
permission_check_change_state!(opts)
changestate_revoked(opts) if opts[:newstate] == 'revoked'
changestate_accepted(opts) if opts[:newstate] == 'accepted'
- 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 write_to_backend
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def write_to_backend
# expire cache
reset_cache
raise ArgumentError, 'no commit_user set' unless @commit_opts[:no_backend_write] || @commit_opts[:login] || @commit_user
- 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_path_elements
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def update_path_elements(current_repo, xml_hash)
# destroy all current pathelements
current_repo.path_elements.destroy_all
return unless xml_hash['path'] || xml_hash['hostsystem']
- 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 remove_flag
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def remove_flag(flag, repository, arch = nil)
validate_type flag
flaglist = flags.of_type(flag)
arch = Architecture.find_by_name(arch) if arch
- 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 expand_targets
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def expand_targets(ignore_build_state, ignore_delegate)
expand_target_project if action_type == :submit && ignore_delegate.blank? && target_project.present?
# empty submission protection
if action_type.in?(%i[submit maintenance_incident]) && (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_patchinfo
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def check_patchinfo(pkg)
pkg.project.repositories.collect do |repo|
firstarch = repo.architectures.first
next unless firstarch
- 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 request_command_diff
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def request_command_diff
req = BsRequest.find_by_number!(params[:id])
superseded_request = req.superseding.find_by_number(params[:diff_to_superseded])
if params[:diff_to_superseded].present? && superseded_request.blank?
msg = "Request #{params[:diff_to_superseded]} does not exist or is not superseded by request #{req.number}."
- 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 gather_exception_defaults
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def gather_exception_defaults(opt)
if opt[:message]
@summary = opt[:message].to_s
elsif @exception
@summary = @exception.message
- 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 get_updateinfo_id
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def get_updateinfo_id(source_package, target_repo)
return unless source_package.is_patchinfo?
# check for patch name inside of _patchinfo file
xml = Patchinfo.new.read_patchinfo_xmlhash(source_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 call
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
def call
github_client = Octokit::Client.new(access_token: @scm_token,
api_endpoint: @event_subscription_payload[:api_endpoint])
# https://docs.github.com/en/rest/reference/repos#create-a-commit-status
github_client.create_status(@event_subscription_payload[:target_repository_full_name],
- 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_from_xml_register_update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _update_from_xml_register_update(rxml)
rxml.elements('updates') do |u|
update = {}
product_update_repositories.each do |pu|
next unless pu.repository # it may be remote or not yet exist
Method new_release_request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_release_request
if params[:skiprequest]
# FIXME2.3: do it directly here, api function missing
else
begin
Method set_permissions_for_action
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_permissions_for_action(action, new_state = nil)
# general write permission check on the target on accept
@write_permission_in_this_action = false
# all action types need a target project in any case for accept
Method change_review_state
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change_review_state(new_review_state, opts = {})
with_lock do
new_review_state = new_review_state.to_sym
raise InvalidStateError, 'request is not in a changeable state (new, review or declined)' unless state == :review || (state.in?(%i[new declined]) && new_review_state == :new)
Method new_tracker
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_tracker
# collection with all informations of the new issues
issue_collection = []
error = ''
invalid_format = ''