Showing 32 of 36 total issues
Avoid deeply nested control flow statements. Open
if symlinks.include? entry
# We have already seen this symlink
#TODO: it's okay to see a symlink twice if requested
raise MultiGit::Error::CyclicSymlink, "Cyclic symlink detected while traversing #{path} from #{self.inspect}."
else
Avoid deeply nested control flow statements. Open
if follow
parts.push(*entry.target.split(SLASH))
else
if parts.none?
return entry
Method each_branch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def each_branch(filter = :all)
return to_enum(:each_branch, filter) unless block_given?
which = case filter
when :all, Regexp then [:a]
when :local then []
- 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 >>
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def >>(repository)
ent = []
dirty_entries.each do |name, entry|
if entry
object = repository.write(entry)
- 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 []
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def [](*args)
forced = false
if args.last.kind_of? Hash
options = args.pop.dup
forced = options.delete(:forced){ 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
Method parse_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_string(string, forced)
if ma = REF.match(string)
if ma[2]
from = normalize(from_base, ma[2])
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 remote
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remote( name_or_url )
if looks_like_remote_url? name_or_url
remote = Rugged::Remote.new(__backend__, name_or_url)
else
remote = Rugged::Remote.lookup(__backend__, name_or_url)
- 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
Avoid too many return
statements within this method. Open
return true
Avoid too many return
statements within this method. Open
return new != old
Method call_env
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call_env(env, *args, &block)
s = cmd(*args)
block ||= READ_BLOCK
result = nil
message = 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"
Further reading
Method each_explicit_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def each_explicit_key
return to_enum(:each_explicit_key) unless block_given?
seen = Set.new
@cmd.('config','--list') do |io|
io.each_line do |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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(path, options = {})
options = initialize_options(path,options)
builder = Java::OrgEclipseJgitStorageFile::FileRepositoryBuilder.new
builder.setGitDir(Java::JavaIO::File.new(options[:repository]))
if options[:working_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"