Method verify_xml!
has a Cognitive Complexity of 32 (exceeds 8 allowed). Consider refactoring. Open
def self.verify_xml!(xmlhash)
xmlhash = Xmlhash.parse(xmlhash) if xmlhash.is_a?(String)
xmlhash.elements('target') do |p|
prj = Project.get_by_name(p['project'])
raise UnknownRepository, "Repository does not exist #{prj.name}/#{p['repository']}" unless prj.repositories.find_by_name(p['repository'])
- 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
has a Cognitive Complexity of 30 (exceeds 8 allowed). Consider refactoring. Open
def update_from_xml(xmlhash)
xmlhash = Xmlhash.parse(xmlhash) if xmlhash.is_a?(String)
self.disabled = xmlhash.key?('disabled')
_update_from_xml_targets(xmlhash)
- 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_binary_lists
has a Cognitive Complexity of 17 (exceeds 8 allowed). Consider refactoring. Open
def _update_from_xml_binary_lists(xmlhash)
# sync binary lists
hasharray = []
xmlhash.elements('binaries').each do |p|
repository = nil
- 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 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 _update_from_xml_binaries
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
def _update_from_xml_binaries(cbl, xmlhash)
hasharray = []
xmlhash.each do |b|
arch = nil
arch = Architecture.find_by_name!(b['arch']) if b['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"