atpsoft/dohtest

View on GitHub

Showing 16 of 20 total issues

Class StreamOutput has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

class StreamOutput
  DEFAULT_COLORS = {:failure => :red, :error => :magenta, :info => :blue, :success => :green}.freeze

  def initialize(std_ios = nil, err_ios = nil)
    @error_count = @groups_ran = @groups_skipped = @tests_ran = @tests_skipped = @assertions_failed = @assertions_passed = 0
Severity: Minor
Found in lib/dohtest/stream_output.rb - About 2 hrs to fix

    Method run_end has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_end(duration)
        total_assertions = @assertions_passed + @assertions_failed
    
        if duration >= 1
          tests_per_second = (@tests_ran / duration).round(2)
    Severity: Minor
    Found in lib/dohtest/stream_output.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 run_end has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def run_end(duration)
        total_assertions = @assertions_passed + @assertions_failed
    
        if duration >= 1
          tests_per_second = (@tests_ran / duration).round(2)
    Severity: Minor
    Found in lib/dohtest/stream_output.rb - About 1 hr to fix

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

        def assert_raises(*expected)
          msg = expected.pop if expected.last.is_a?(String)
          begin
            yield
            no_exception = true
      Severity: Minor
      Found in lib/dohtest/assertions.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 group_end has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
          @tests_skipped += tests_skipped
          if tests_ran == 0
            if tests_skipped > 0
              @groups_skipped += 1
      Severity: Minor
      Found in lib/dohtest/stream_output.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 find_relevant_stack has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def find_relevant_stack
          retval = []
          found_start = false
          @backtrace.each do |location|
            has_doh_test = location.index('dohtest')
      Severity: Minor
      Found in lib/dohtest/backtrace_parser.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 load_configuration_file has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def load_configuration_file(start_path)
        start_path = File.expand_path(start_path || '.')
        if File.directory?(start_path)
          start_directory = start_path
        else
      Severity: Minor
      Found in lib/dohtest/configure.rb - About 1 hr to fix

        Method load_configuration_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def load_configuration_file(start_path)
          start_path = File.expand_path(start_path || '.')
          if File.directory?(start_path)
            start_directory = start_path
          else
        Severity: Minor
        Found in lib/dohtest/configure.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 group_end has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
        Severity: Minor
        Found in lib/dohtest/capture_output.rb - About 35 mins to fix

          Method group_end has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
          Severity: Minor
          Found in lib/dohtest/stream_output.rb - About 35 mins to fix

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

              def run_tests
                determine_test_methods
                find_before_each_method
                find_after_each_method
                setup_brink
            Severity: Minor
            Found in lib/dohtest/group_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 run_after_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def run_after_all
                @group.after_all if @group.respond_to?(:after_all)
                @config[:post_group_callback].each do |callback|
                  if (!callback.call(total_problems))
                    @error_count += 1
            Severity: Minor
            Found in lib/dohtest/group_runner.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

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

              def run
                start_time = Time.now
                srand(@config[:seed])
                @output.run_begin(@config)
            
            
            Severity: Minor
            Found in lib/dohtest/master_runner.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

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

              def run_before_each
                @config[:pre_each_callback].each do |callback|
                  if !callback.call
                    @error_count += 1
                    @output.callback_failed(callback.inspect)
            Severity: Minor
            Found in lib/dohtest/group_runner.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

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

              def run_before_all
                @group.before_all if @group.respond_to?(:before_all)
                @config[:pre_group_callback].each do |callback|
                  if (!callback.call(@group))
                    @error_count += 1
            Severity: Minor
            Found in lib/dohtest/group_runner.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

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

              def run_after_each
                @group.send(@after_each_method) if @after_each_method
                @config[:post_each_callback].each do |callback|
                  if !callback.call
                    @error_count += 1
            Severity: Minor
            Found in lib/dohtest/group_runner.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