Showing 12 of 14 total issues
Method generate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def generate
project_path = @ignore_source_file ? @current_path : File.dirname(Rdm::SourceLocator.locate(@current_path))
template_detector = Rdm::Templates::TemplateDetector.new(project_path)
render_helper_path = "#{project_path}/.rdm/helpers/render_helper.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 generate
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate
project_path = @ignore_source_file ? @current_path : File.dirname(Rdm::SourceLocator.locate(@current_path))
template_detector = Rdm::Templates::TemplateDetector.new(project_path)
render_helper_path = "#{project_path}/.rdm/helpers/render_helper.rb"
Method compile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def compile
Rdm::SourceParser.read_and_init_source(Rdm::SourceLocator.locate(@project_path))
@overwrite_directory ||= ->() { STDIN.gets.chomp.downcase == YES }
@compile_path ||= Rdm.settings.compile_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 compile
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compile
FileUtils.rm_rf(@compile_path) if Dir.exists?(@compile_path)
FileUtils.mkdir_p(@compile_path)
dependent_packages = Rdm::Handlers::DependenciesHandler.show_packages(
Method draw
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def draw(pkg_name = @package_name, uniq_packages = [], self_predicate = '', child_predicate = '')
raise Rdm::Errors::InvalidParams, "Type package name, ex: rdm gen.deps repository" if pkg_name.to_s.empty?
raise Rdm::Errors::PackageHasNoDependencies, @package_name if source.packages[@package_name].local_dependencies.empty?
node = [format(pkg_name, self_predicate)]
- 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 update_using_hash
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_using_hash(hash, scope: nil)
scope ||= root_scope
hash.each do |key, value|
if value.is_a?(Hash)
- 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 compile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compile
FileUtils.rm_rf(@compile_path) if Dir.exists?(@compile_path)
FileUtils.mkdir_p(@compile_path)
dependent_packages = Rdm::Handlers::DependenciesHandler.show_packages(
- 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 handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle
@revision = 'HEAD' if @revision.nil? || @revision.empty?
modified_packages = Rdm::Git::DiffManager
.run(path: path, revision: revision)
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(package_name, current_path, path, locals, stdout)
Method import_package
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_package(package_name, source:, group: nil)
return imported_packages if imported_packages.include?(package_name.to_s)
package = source.packages[package_name.to_s]
raise "Can't find package with name: #{package_name}" if package.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 init_and_set_env_variables
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def init_and_set_env_variables(source)
return unless settings.read_setting(:env_file_name)
unless File.exists?(env_file_path)
@stdout.puts "WARNING! Environment file '#{settings.read_setting(:env_file_name)}' was not found. Please, add #{env_file_path} 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 check_input_params!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_input_params!
if @package_name
unless is_package_included?(@package_name)
exit_with_message(
view.package_not_found_message(@package_name, prepared_command_params)
- 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"