Showing 62 of 64 total issues
Method latex
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def latex(dir = Dir.pwd, type = :beamer, options = {})
ap options if options[:debug]
error "Unsupported type" unless [ :beamer, :article, :letter, :bookchapter ].include?( type )
path = normalized_path(dir)
config = FalkorLib::Config::Bootstrap::DEFAULTS[:latex].clone
- 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 readme
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
def readme(dir = Dir.pwd, options = {})
info "Bootstrap a README file for this project"
path = normalized_path(dir)
# get the local configuration
local_config = FalkorLib::Config.get(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 pyenv
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
def pyenv(dir = Dir.pwd, options = {})
info "Initialize Pyenv-virtualenv and direnv setup in '#{dir}'"
ap options if options[:debug]
path = normalized_path(dir)
unless File.directory?(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 init
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def init(rootdir = Dir.pwd, name = '', _options = {})
config = {}
#login = `whoami`.chomp
config[:name] = name unless name.empty?
moduledir = rootdir
- 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 a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def init(path = Dir.pwd, options = {})
exit_status = FalkorLib::Git.init(path, options)
unless command?('git-flow')
# Check (mainly for Linux) if the command is not available under `/usr/lib/git-core`
git_lib = '/usr/lib/git-core/'
- 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
File base.rb
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "falkorlib"
require "falkorlib/common"
require "falkorlib/bootstrap"
require 'erb' # required for module generation
Method rvm
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def rvm(dir = Dir.pwd, options = {})
info "Initialize Ruby Version Manager (RVM)"
ap options if options[:debug]
path = normalized_path(dir)
use_git = FalkorLib::Git.init?(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 latex
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
def latex(dir = Dir.pwd, type = :beamer, options = {})
ap options if options[:debug]
error "Unsupported type" unless [ :beamer, :article, :letter, :bookchapter ].include?( type )
path = normalized_path(dir)
config = FalkorLib::Config::Bootstrap::DEFAULTS[:latex].clone
Method repo
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def repo(name, options = {})
ap options if options[:debug]
path = normalized_path(name)
project = File.basename(path)
use_git = FalkorLib::Git.init?(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 gitcrypt
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def gitcrypt(dir = Dir.pwd, options = {})
path = normalized_path(dir)
unless File.directory?(path)
warning "The directory '#{path}' does not exist yet."
warning 'Do you want to create (and git init) this 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"
Further reading
Method readme
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
def readme(dir = Dir.pwd, options = {})
info "Bootstrap a README file for this project"
path = normalized_path(dir)
# get the local configuration
local_config = FalkorLib::Config.get(dir)
Method pyenv
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pyenv(dir = Dir.pwd, options = {})
info "Initialize Pyenv-virtualenv and direnv setup in '#{dir}'"
ap options if options[:debug]
path = normalized_path(dir)
unless File.directory?(path)
File base.rb
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "falkorlib"
require "falkorlib/common"
require "minigit"
require "pathname"
Method set_version
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def set_version(version, rootdir = Dir.pwd, options = {})
exit_status = 0
type = (options[:type]) ? options[:type] : FalkorLib.config[:versioning][:type]
source = (options[:source]) ? options[:source] : FalkorLib.config[:versioning][:source][ type ]
versionfile = File.join( rootdir, source[:filename] ) unless source[:filename].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
File common.rb
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "falkorlib"
require 'open3'
require 'erb' # required for module generation
require 'diffy'
require 'json'
File modules.rb
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "falkorlib"
require "falkorlib/common"
require "pathname"
require 'json'
Method metadata
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def metadata(moduledir = Dir.pwd, options = {
:use_symbols => true,
:extras => true,
: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 init
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init(rootdir = Dir.pwd, name = '', _options = {})
config = {}
#login = `whoami`.chomp
config[:name] = name unless name.empty?
moduledir = rootdir
Method motd
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def motd(dir = Dir.pwd, options = {})
config = FalkorLib::Config::Bootstrap::DEFAULTS[:motd].merge!(::ActiveSupport::HashWithIndifferentAccess.new(options).symbolize_keys)
path = normalized_path(dir)
erbfile = File.join( FalkorLib.templates, 'motd', 'motd.erb')
outfile = (config[:file] =~ /^\//) ? config[:file] : File.join(path, config[:file])
- 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 gitcrypt
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gitcrypt(dir = Dir.pwd, options = {})
path = normalized_path(dir)
unless File.directory?(path)
warning "The directory '#{path}' does not exist yet."
warning 'Do you want to create (and git init) this directory?'