Showing 5 of 5 total issues
Method unpack
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def unpack destdir = ''
destdir = File.expand_path destdir unless destdir.empty?
archive = File.basename(@url)
if @unpack
Unpacker.archive? archive
- 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 missing
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.missing dependencies
if dependencies.is_a? String
dependencies = YAML.load_file dependencies
end
missing = []
- 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 require
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.require(dependencies, destdir = '')
destdir = File.expand_path destdir unless destdir.empty?
if dependencies.is_a? String
dependencies = YAML.load_file dependencies
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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, binaries, versionconfig, urlconfig,
unpack, libraries=[])
Method installed?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def installed? bin
path = which(bin)
if path.length > 0
ret = `#{@version_cmd} 2>&1`.split("\n").map{ |l| l.strip }.join('|')
if ret && (/#{@version}/ =~ ret)
- 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"