Showing 48 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 has too many lines. [145/30] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [145/30] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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 has too many lines. [95/30] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [91/30] Open
def self.verify
require 'csv'
FileUtils.rm_rf Rakudax::Base.verify_path
FileUtils.mkdir_p Rakudax::Base.verify_path
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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
Cyclomatic complexity for generate is too high. [44/6] 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
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Cyclomatic complexity for migrate is too high. [42/6] 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
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
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 has too many lines. [52/30] Open
def self.parse_options(argv)
if argv.empty?
self.exit_with_message 2, true
end
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Cyclomatic complexity for submit is too high. [25/6] 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
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
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
Cyclomatic complexity for verify is too high. [22/6] Open
def self.verify
require 'csv'
FileUtils.rm_rf Rakudax::Base.verify_path
FileUtils.mkdir_p Rakudax::Base.verify_path
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Cyclomatic complexity for parse_options is too high. [19/6] Open
def self.parse_options(argv)
if argv.empty?
self.exit_with_message 2, true
end
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
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