guard/guard-minitest

View on GitHub
lib/guard/minitest/runner.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Class Runner has 32 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Runner
      attr_accessor :inspector

      def initialize(options = {})
        @options = {
Severity: Minor
Found in lib/guard/minitest/runner.rb - About 4 hrs to fix

    Method run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

          def run(paths, options = {})
            return unless options[:all] || !paths.empty?
    
            message = "Running: #{options[:all] ? 'all tests' : paths.join(' ')}"
            Compat::UI.info message, reset: true
    Severity: Minor
    Found in lib/guard/minitest/runner.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_deprecated_options has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def parse_deprecated_options
            if @options.key?(:notify)
              # TODO: no coverage
              Compat::UI.info %(DEPRECATION WARNING: The :notify option is deprecated. Guard notification configuration is used.)
            end
    Severity: Minor
    Found in lib/guard/minitest/runner.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

    Method spring_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def spring_command(paths)
            command = @options[:spring].is_a?(String) ? @options[:spring] : 'bin/rake test'
            cmd_parts = [command]
            cmd_parts << File.expand_path('../runners/old_runner.rb', __FILE__) unless Utils.minitest_version_gte_5? || command != 'spring testunit'
            if cli_options.length > 0
    Severity: Minor
    Found in lib/guard/minitest/runner.rb - About 35 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