Showing 13 of 19 total issues
Method scan_and_wait
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def scan_and_wait(mod, resource, attempts)
method = nil
retries = attempts
if mod.name == "Uirusu::VTFile"
- 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 main
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def main(args)
parse_options(args)
load_config
if @options['output'] == :stdout
- 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_options
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_options(args)
begin
@options['output'] = :stdout
@options['verbose'] = false
@options['rescan'] = false
Method initialize
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def initialize hash, results
if results == nil or results.empty?
return
# Take into consideration being passed an array of results.
- 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_options
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def parse_options(args)
begin
@options['output'] = :stdout
@options['verbose'] = false
@options['rescan'] = false
- 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
File application.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Uirusu
module CLI
class Application
attr_accessor :config
Method scan_and_wait
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scan_and_wait(mod, resource, attempts)
method = nil
retries = attempts
if mod.name == "Uirusu::VTFile"
Method main
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main(args)
parse_options(args)
load_config
if @options['output'] == :stdout
Method initialize
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize hash, results
if results == nil or results.empty?
return
# Take into consideration being passed an array of results.
Method load_config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def load_config file=CONFIG_FILE
@config = nil
f = File.expand_path(file)
- 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 to_xml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_xml
result_string = String.new
result_string << "<results>\n"
@results.each do |result|
result_string << "\t<vtresult>\n"
- 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 recurse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Scanner.recurse file_name
Dir.new("#{file_name}").each do |file|
next if file.match(/^\.+/)
path = "#{file_name}/#{file}"
- 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_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_response(response)
puts "Parse Response"
begin
case response.code
when 429, 204
- 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"