lib/coverband/configuration.rb
Class Configuration
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Configuration
attr_accessor :root_paths, :root,
:verbose,
:reporter, :redis_namespace, :redis_ttl,
:background_reporting_enabled,
File configuration.rb
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Coverband
###
# Configuration parsing and options for the coverband gem.
###
class Configuration
Method reset
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def reset
@root = Dir.pwd
@root_paths = []
@ignore = IGNORE_DEFAULTS.dup
@search_paths = TRACKED_DEFAULT_PATHS.dup
Method railtie!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def railtie!
if Coverband.configuration.track_routes
Coverband.configuration.route_tracker = Coverband::Collectors::RouteTracker.new
trackers << Coverband.configuration.route_tracker
end
- 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"