rubygem/lib/zeus/rails.rb
Class Rails
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Rails < Plan
def after_fork
reconnect_activerecord
restart_girl_friday
reconnect_redis
Method _monkeypatch_rake
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _monkeypatch_rake
if version = gem_is_bundled?('rake')
gem 'rake', version
end
require 'rake/testtask'
Method test
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
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)
- 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 console
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def console
if rails_5_1_or_higher?
run_rails_5_1_or_higher_command('console')
else
require 'rails/commands/console'
- 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"