Showing 9 of 9 total issues
Method parse
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(data)
info = new
data.each_line do |line|
line.strip!
next if line.start_with?('#')
- 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_entry
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_entry
entry = PackageEntry.new
%w[
filename
name
Method system
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def system(args, opts)
opts = opts.dup
env = {}
opts.delete(:env).tap do |e|
break unless e
- 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 init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init(name)
# Check key's validity
if options[:repo_key]
Signer.new(options[:repo_key])
end
Method validate!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate!
REQUIRED_ATTRIBUTES.each do |attr|
unless @config.has_key?(attr)
raise InvalidConfig.new("#{attr.inspect} is required")
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 archive_all
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def archive_all(src, dest, comp, format)
Archive::Writer.open_filename(dest.to_s, comp, format) do |archive|
list_tree_paths(src).sort.each do |path|
archive.new_entry do |entry|
entry.pathname = path.relative_path_from(src).to_s
- 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 build_in_chroot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_in_chroot(builder, chroot, repo_db, repo_files, abs, package_dir)
Method load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load(path)
path = Pathname.new(path)
return unless path.readable?
verify!(path)
db = {}
- 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 add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add(key, val)
ivar = "@#{key}".intern
if ARRAY_ATTRIBUTES.include?(key)
instance_variable_get(ivar) << val
elsif DESC_ATTRIBUTES.include?(key)
- 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"