danmayer/coverband

View on GitHub
lib/coverband/configuration.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Configuration has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Configuration
    attr_accessor :root_paths, :root,
      :verbose,
      :reporter, :redis_namespace, :redis_ttl,
      :background_reporting_enabled,
Severity: Minor
Found in lib/coverband/configuration.rb - About 5 hrs to fix

    File configuration.rb has 262 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Coverband
      ###
      # Configuration parsing and options for the coverband gem.
      ###
      class Configuration
    Severity: Minor
    Found in lib/coverband/configuration.rb - About 2 hrs to fix

      Method reset has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def reset
            @root = Dir.pwd
            @root_paths = []
            @ignore = IGNORE_DEFAULTS.dup
            @search_paths = TRACKED_DEFAULT_PATHS.dup
      Severity: Minor
      Found in lib/coverband/configuration.rb - About 1 hr to fix

        Method railtie! has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def railtie!
              if Coverband.configuration.track_routes
                Coverband.configuration.route_tracker = Coverband::Collectors::RouteTracker.new
                trackers << Coverband.configuration.route_tracker
              end
        Severity: Minor
        Found in lib/coverband/configuration.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

        There are no issues that match your filters.

        Category
        Status