Showing 44 of 143 total issues
Method execute
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def execute
request.process do |request|
case request.code
when 200
hint = ""
- 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
File node.rb
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Crowbar
module Client
module App
#
# A Thor based CLI wrapper for node commands
- Create a ticketCreate a ticket
File upgrade.rb
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Crowbar
module Client
module App
#
# A Thor based CLI wrapper for upgrade commands
- Create a ticketCreate a ticket
File proposal.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Crowbar
module Client
module App
#
# A Thor based CLI wrapper for proposal commands
- Create a ticketCreate a ticket
Class Config
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Config
include Singleton
attr_writer :options
attr_writer :config
- Create a ticketCreate a ticket
Method execute
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
request.process do |request|
case request.code
when 200
hint = ""
- Create a ticketCreate a ticket
Method execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def execute
request.process do |request|
case request.code
when 200
formatter = Formatter::Hash.new(
- 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 process_hash
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_hash(values, path = "", type = :table)
[].tap do |result|
values.map do |key, value|
new_path = [path.to_s.dup, key].reject(&:empty?).join(".")
- Create a ticketCreate a ticket
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
validate_barclamp! args.barclamp
request.process do |request|
case request.code
- Create a ticketCreate a ticket
Method content_from
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def content_from(request)
result = [].tap do |row|
request.parsed_response["nodes"].each do |child|
if options["meta"]
row.push(
- Create a ticketCreate a ticket
Method execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def execute
validate_barclamp! args.barclamp
request.process do |request|
case request.code
- 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 execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
request.process do |request|
case request.code
when 200
if args.component == "crowbar"
- Create a ticketCreate a ticket
Method from_file
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_file
json = begin
file = File.read(
options[:file]
)
- Create a ticketCreate a ticket
Method execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def execute
unless ["normal", "non_disruptive", nil].include? args.mode
err "Invalid upgrade mode '#{args.mode}'. " \
"Only 'normal' and 'non_disruptive' are valid upgrade modes"
end
- 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 execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def execute
request.process do |request|
case request.code
when 200
if args.component == "crowbar"
- 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 check_nodes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_nodes(configuration)
invalid_nodes = []
nodes_and_clusters = valid_elements
configuration["deployment"].each do |service_name, service|
- 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 process_hash
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_hash(values, path = "", type = :table)
[].tap do |result|
values.map do |key, value|
new_path = [path.to_s.dup, key].reject(&:empty?).join(".")
- 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
argv,
stdin = STDIN,
stdout = STDOUT,
stderr = STDERR,
kernel = Kernel
- Create a ticketCreate a ticket
Method allocate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def allocate(proposal, node, network, range, suggestion = nil)
- Create a ticketCreate a ticket
Method allocate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def allocate(proposal, service, network, range, suggestion = nil)
- Create a ticketCreate a ticket