Showing 9 of 9 total issues
Method exec
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.exec
h = {
'capistrano' => {
'home' => nil,
},
Method run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run
table :border => true do
row :header => true do
column 'Choice', :width => 6, :color => 'blue', :bold => true, :align => 'right'
- 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 exec
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.exec(options)
begin
config = Claws::Configuration.new( options.config_file )
rescue Claws::ConfigurationError => e
puts e.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 parse
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse
options = OpenStruct.new(
{
:config_file => nil,
:connect => true,
Method exec
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.exec(options)
begin
config = Claws::Configuration.new( options.config_file )
rescue Claws::ConfigurationError => e
puts e.message
Method run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
table :border => true do
row :header => true do
column 'Choice', :width => 6, :color => 'blue', :bold => true, :align => 'right'
Method tags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tags
@ec2.try(:tags) ? @ec2.tags.select {|k,v| [k,v] unless k.downcase == 'name'}.map{|k,v| "#{k}: #{v}"}.join(', ') : 'N/A'
end
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(filters = {})
collection = []
AWS::EC2.new.regions.each do |region|
if config.ec2.regions
- 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 method_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(meth)
case meth
when :name
@ec2.send(:tags)['Name'] || 'N/A'
when @ec2.try(:tags) && @ec2.tags.has_key?(meth)
- 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"