Showing 13 of 48 total issues
Method migrate
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
def self.migrate
puts "[start migrate]=============#{Time.now}"
Rakudax::Settings.models.each do |migration|
classname = migration.name
classname_before = "#{classname}Before"
- 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 a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
def self.generate
FileUtils.rm_rf Rakudax::Base.im_path
FileUtils.mkdir_p Rakudax::Base.im_path
puts "[start generate]=============#{Time.now}"
- 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 submit
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def self.submit
unless Dir.exists?(Rakudax::Base.im_path)
puts "error: Intermediate directory not found."
puts "Intermediate directory path: #{Rakudax::Base.im_path}"
exit 2
- 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 verify
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
def self.verify
require 'csv'
FileUtils.rm_rf Rakudax::Base.verify_path
FileUtils.mkdir_p Rakudax::Base.verify_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 migrate
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.migrate
puts "[start migrate]=============#{Time.now}"
Rakudax::Settings.models.each do |migration|
classname = migration.name
classname_before = "#{classname}Before"
Method generate
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate
FileUtils.rm_rf Rakudax::Base.im_path
FileUtils.mkdir_p Rakudax::Base.im_path
puts "[start generate]=============#{Time.now}"
Method submit
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.submit
unless Dir.exists?(Rakudax::Base.im_path)
puts "error: Intermediate directory not found."
puts "Intermediate directory path: #{Rakudax::Base.im_path}"
exit 2
Method verify
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.verify
require 'csv'
FileUtils.rm_rf Rakudax::Base.verify_path
FileUtils.mkdir_p Rakudax::Base.verify_path
Class Base
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
require 'pathname'
USAGE=<<-EOS
===========================================================================
<>: required
Method parse_options
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_options(argv)
if argv.empty?
self.exit_with_message 2, true
end
Method load_dbconfig
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.load_dbconfig(str)
path = Pathname.new str
path = self.root.join(str) unless path.absolute?
@@dbconfig = YAML.load(
File.read(
- 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_options
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_options(argv)
if argv.empty?
self.exit_with_message 2, true
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
Consider simplifying this complex logical expression. Open
if v.nil? || v.blank? || k == "creater" || k == "updater" || (model.keep_encodes || []).include?(k)
next
elsif v.is_a?(String)
value[k] = NKF.nkf opt, v
else