Method deployment_check
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def deployment_check
ret = {}
# Only allow the upgrade for mariadb setup
# TODO: update the search if we allow multiple proposals
db_node = ::Node.find("roles:database-server").first
- Read upRead up
- Create a ticketCreate a ticket
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 ha_config_check
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def ha_config_check
prop = Proposal.where(barclamp: "cinder").first
unless prop.nil?
backends = prop["attributes"]["cinder"]["volumes"].select do |volume|
- Read upRead up
- Create a ticketCreate a ticket
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 ha_config_check
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ha_config_check
prop = Proposal.where(barclamp: "cinder").first
unless prop.nil?
backends = prop["attributes"]["cinder"]["volumes"].select do |volume|
- Create a ticketCreate a ticket
Method upgrade!
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upgrade!
if upgrading?
return {
status: :unprocessable_entity,
message: I18n.t("api.crowbar.upgrade_ongoing")
- Create a ticketCreate a ticket
Method health_check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def health_check
ret = {}
unready = []
NodeObject.all.each do |node|
unready << node.name unless node.ready?
- Read upRead up
- Create a ticketCreate a ticket
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 upgrade!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upgrade!
if upgrading?
return {
status: :unprocessable_entity,
message: I18n.t("api.crowbar.upgrade_ongoing")
- Read upRead up
- Create a ticketCreate a ticket
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"