guard/guard-minitest

View on GitHub

Showing 7 of 7 total issues

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 guard_message has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def self.guard_message(test_count, assertion_count, failure_count, error_count, skip_count, duration)
    Severity: Minor
    Found in lib/guard/minitest/notifier.rb - About 45 mins to fix

      Method notify has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def self.notify(test_count, assertion_count, failure_count, error_count, skip_count, duration)
      Severity: Minor
      Found in lib/guard/minitest/notifier.rb - About 45 mins to fix

        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

        Method plugin_guard_minitest_init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.plugin_guard_minitest_init(options) # :nodoc:
            return unless options[:guard]
        
            require 'guard/minitest/utils'
        
        
        Severity: Minor
        Found in lib/minitest/guard_minitest_plugin.rb - About 25 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

        Severity
        Category
        Status
        Source
        Language