Showing 62 of 64 total issues
Method write_from_erb_template
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def write_from_erb_template(erbfile, outfile, config = {},
options = {
:no_interaction => false
})
erbfiles = (erbfile.is_a?(Array)) ? erbfile : [ erbfile ]
- 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
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(moduledir = Dir.pwd, options = {
:no_interaction => false
})
name = File.basename(moduledir)
metadata = metadata(moduledir, :use_symbols => false,
Method makefile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def makefile(dir = Dir.pwd, options = {})
path = normalized_path(dir)
path = FalkorLib::Git.rootdir(path) if FalkorLib::Git.init?(path)
info "=> Setup a root repository makefile in '#{dir}'"
# Preparing submodule
Method root
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def root(dir = Dir.pwd, options = {})
raise FalkorLib::ExecError "Not used in a Git repository" unless FalkorLib::Git.init?
exit_status = 0
path = normalized_path(dir)
relative_path_to_root = (Pathname.new( FalkorLib::Git.rootdir(dir) ).relative_path_from Pathname.new( File.realpath(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 versionfile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def versionfile(dir = Dir.pwd, options = {})
file = (options[:file]) ? options[:file] : 'VERSION'
version = (options[:version]) ? options[:version] : '0.0.0'
info " ==> bootstrapping a VERSION file"
path = normalized_path(dir)
- 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 makefile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def makefile(dir = Dir.pwd, options = {})
path = normalized_path(dir)
path = FalkorLib::Git.rootdir(path) if FalkorLib::Git.init?(path)
info "=> Setup a root repository makefile in '#{dir}'"
# Preparing submodule
- 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 metadata
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def metadata(moduledir = Dir.pwd, options = {
:use_symbols => true,
:extras => true,
:no_interaction => false
})
Method init
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def init(path = Dir.pwd, _options = {})
# FIXME: for travis test: ensure the global git configurations
# 'user.email' and 'user.name' are set
[ 'user.name', 'user.email' ].each do |userconf|
next unless MiniGit[userconf].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 show_diff_and_write
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show_diff_and_write(content, outfile, options = {
:no_interaction => false,
:json_pretty_format => false,
:no_commit => false
})
Method upgrade
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upgrade(moduledir = Dir.pwd,
options = {
:no_interaction => false,
:only => nil,
:exclude => []
Method default
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def default
res = FalkorLib::Config::DEFAULTS.clone
$LOADED_FEATURES.each do |path|
res[:git] = FalkorLib::Config::Git::DEFAULTS if path.include?('lib/falkorlib/git.rb')
res[:gitflow] = FalkorLib::Config::GitFlow::DEFAULTS if path.include?('lib/falkorlib/git.rb')
- 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
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse(moduledir = Dir.pwd, options = {
:no_interaction => false
})
name = File.basename(moduledir)
metadata = metadata(moduledir, :use_symbols => 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 config
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def config(key, dir = Dir.pwd, options = {})
#info "Retrieve the Git configuration"
res = nil
if (options[:list] || (key.is_a? Regexp) || (key =~ /\*/))
cg = MiniGit::Capturing.new(dir)
- 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 normalized_path
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def normalized_path(dir = Dir.pwd, options = {})
rootdir = (FalkorLib::Git.init?(dir)) ? FalkorLib::Git.rootdir(dir) : dir
path = dir
path = Dir.pwd if dir == '.'
path = File.join(Dir.pwd, dir) unless (dir =~ /^\// || (dir == '.'))
- 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 license
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def license(dir = Dir.pwd,
license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
authors = '',
options = {
:filename => 'LICENSE'
- 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 upgrade_from_template
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def upgrade_from_template(moduledir = Dir.pwd,
subdir = 'tests',
options = {
:no_interaction => 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 write_from_template
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write_from_template(src, dstdir, options = {
:no_interaction => false,
:no_commit => false,
:srcdir => '',
:outfile => ''
- 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 command
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def command(name, type = 'feature', action = 'start', path = Dir.pwd, optional_args = '')
Method init_rvm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def init_rvm(rootdir = Dir.pwd, gemset = '')
rvm_files = {
:version => File.join(rootdir, '.ruby-version'),
:gemset => File.join(rootdir, '.ruby-gemset')
}
- 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 command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def command(name, type = 'feature', action = 'start', path = Dir.pwd, optional_args = '')
error "Invalid git-flow type '#{type}'" unless %w(feature release hotfix support).include?(type)
error "Invalid action '#{action}'" unless %w(start finish).include?(action)
error "You must provide a name" if name == ''
error "The name '#{name}' cannot contain spaces" if name =~ /\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"