tlab-jp/rakudax

View on GitHub

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"
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 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 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

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 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

          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

              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(
              Severity: Minor
              Found in lib/rakudax/base.rb - About 1 hr 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 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
              
              
              Severity: Minor
              Found in lib/rakudax/base.rb - About 1 hr 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

              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
              Severity: Major
              Found in lib/rakudax/tasks/generate.rb - About 40 mins to fix
                Severity
                Category
                Status
                Source
                Language