rubygem/lib/zeus/rails.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Class Rails has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Rails < Plan
    def after_fork
      reconnect_activerecord
      restart_girl_friday
      reconnect_redis
Severity: Minor
Found in rubygem/lib/zeus/rails.rb - About 2 hrs to fix

    Method _monkeypatch_rake has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _monkeypatch_rake
          if version = gem_is_bundled?('rake')
            gem 'rake', version
          end
          require 'rake/testtask'
    Severity: Minor
    Found in rubygem/lib/zeus/rails.rb - About 1 hr to fix

      Method test has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def test(argv=ARGV)
            # if there are two test frameworks and one of them is RSpec,
            # then "zeus test/rspec/testrb" without arguments runs the
            # RSpec suite by default.
            if using_rspec?(argv)
      Severity: Minor
      Found in rubygem/lib/zeus/rails.rb - About 55 mins 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 console has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def console
            if rails_5_1_or_higher?
              run_rails_5_1_or_higher_command('console')
            else
              require 'rails/commands/console'
      Severity: Minor
      Found in rubygem/lib/zeus/rails.rb - About 45 mins 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

      There are no issues that match your filters.

      Category
      Status