Showing 10 of 10 total issues
Class Bag
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Bag < Hash
##
# Create a new Bag object which holds key/value pairs.
# The Bag object inherits from the Hash object, the main
Method fetch_error_region_from_location
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.fetch_error_region_from_location(location, options = {})
prefix = options[:prefix] || " "
width = options[:width] || 4
file = File.new(location[:file], "r")
line = location[:line]
- 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 execute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def execute
parser = create_parser()
arguments = parse_options(parser)
return help(parser) if @show_help
- 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 create_parser
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_parser()
return OptionParser.new do |parser|
parser.banner = "Usage: vagrant user env [<options>]"
parser.separator ""
Method execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def execute
parser = create_parser()
arguments = parse_options(parser)
return error("Invalid format value '#{@format}'", parser) if not EnvExporter.valid?(@format)
- 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 execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
parser = create_parser()
arguments = parse_options(parser)
return error("Invalid format value '#{@format}'", parser) if not EnvExporter.valid?(@format)
Method create_parser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_parser()
return OptionParser.new do |parser|
parser.banner = "Usage: vagrant user parameters [<options>]"
parser.separator ""
Method find_project_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.find_project_path()
vagrantfile_name = ENV["VAGRANT_VAGRANTFILE"]
vagrantfile_name = [vagrantfile_name] if vagrantfile_name && !vagrantfile_name.is_a?(Array)
root_finder = lambda do |path|
- 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 call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
return @app.call(env) if not @config.user.auto_export
options = {
:type => :export,
- 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 merge!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def merge!(other, options = {})
other.each do |key, value|
current = __get(key)
case
when current == 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"