Showing 4 of 6 total issues
Class Secrets
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Secrets
CRYPTO_LIB = "openssl".freeze
CIPHER = "aes-256-cbc".freeze
PLAINTEXT_EXT = "priv".freeze
CIPHERTEXT_EXT = "crypt".freeze
Method install_symlinks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.install_symlinks(config)
config.symlinks.each do |source_path, target_path|
# source = Symlink.new(source_path: File.expand_path(source_path))
# source.link
source = Pathname.new(source_path).expand_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 link
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.link(source, target)
if File.exist?(target)
if File.symlink?(target)
existing_link = File.readlink(target)
- 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 each_child
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each_child(dir, &block)
dir.children.each do |child|
next if child.basename.to_s.start_with?(".")
if child.directory?
- 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"