tlab-jp/rakudax

View on GitHub

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"
Severity: Minor
Found in lib/rakudax/tasks/migrate.rb - About 2 days to fix

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}"
Severity: Minor
Found in lib/rakudax/tasks/generate.rb - About 2 days to fix

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}"
Severity: Minor
Found in lib/rakudax/tasks/generate.rb by rubocop

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"
Severity: Minor
Found in lib/rakudax/tasks/migrate.rb by rubocop

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
Severity: Minor
Found in lib/rakudax/tasks/submit.rb - About 1 day to fix

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
Severity: Minor
Found in lib/rakudax/tasks/submit.rb by rubocop

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
Severity: Minor
Found in lib/rakudax/tasks/verify.rb by rubocop

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
Severity: Minor
Found in lib/rakudax/tasks/verify.rb - About 1 day to fix

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}"
Severity: Minor
Found in lib/rakudax/tasks/generate.rb by rubocop

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"
Severity: Minor
Found in lib/rakudax/tasks/migrate.rb by rubocop

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"
Severity: Major
Found in lib/rakudax/tasks/migrate.rb - About 5 hrs to fix

    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}"
    Severity: Major
    Found in lib/rakudax/tasks/generate.rb - About 5 hrs to fix

      Method has too many lines. [52/30]
      Open

          def self.parse_options(argv)
            if argv.empty?
              self.exit_with_message 2, true
            end
      
      
      Severity: Minor
      Found in lib/rakudax/base.rb by rubocop

      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
      Severity: Minor
      Found in lib/rakudax/tasks/submit.rb by rubocop

      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
      Severity: Major
      Found in lib/rakudax/tasks/submit.rb - About 3 hrs to fix

        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
        Severity: Major
        Found in lib/rakudax/tasks/verify.rb - About 3 hrs to fix

          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
          Severity: Minor
          Found in lib/rakudax/tasks/verify.rb by rubocop

          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
          
          
          Severity: Minor
          Found in lib/rakudax/base.rb by rubocop

          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
          Severity: Minor
          Found in lib/rakudax/base.rb - About 2 hrs to fix

            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
            
            
            Severity: Major
            Found in lib/rakudax/base.rb - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language