jgraichen/gurke

View on GitHub

Showing 9 of 15 total issues

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

  class Reporter
    # List of all callback methods as symbols.
    #
    CALLBACKS = %i[
      before_features
Severity: Minor
Found in lib/gurke/reporter.rb - About 2 hrs to fix

    Method after_step has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def after_step(result, scenario, *)
          return unless result.state == :failed
    
          io.print red 'E'
    
    
    Severity: Minor
    Found in lib/gurke/reporters/compact_reporter.rb - About 1 hr to fix

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

          def after_step(result, scenario, *)
            return unless result.state == :failed
      
            io.print red 'E'
      
      
      Severity: Minor
      Found in lib/gurke/reporters/compact_reporter.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 filter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def filter(options, files)
            list   = FeatureList.new
            filter = Filter.new options, files
      
            each do |feature|
      Severity: Minor
      Found in lib/gurke/feature_list.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 expand_files has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def expand_files(files, options)
            files = Dir[options[:pattern].to_s] if files.empty? && options[:pattern]
            files.each_with_object([]) do |input, memo|
              if File.directory? input
                Dir["#{input}/**/*"].each do |file_in_dir|
      Severity: Minor
      Found in lib/gurke/cli.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 format_exception has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def format_exception(err, backtrace: true, indent: 0)
            s = ::StringIO.new
            s << (' ' * indent) << err.class.to_s << ': ' << err.message.strip << "\n"
      
            if backtrace && err.respond_to?(:backtrace)
      Severity: Minor
      Found in lib/gurke/reporter.rb - About 55 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 after_features has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def after_features(features)
            scenarios = features.map(&:scenarios).flatten
      
            size    = scenarios.size
            passed  = scenarios.count(&:passed?)
      Severity: Minor
      Found in lib/gurke/reporters/default_reporter.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 initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(feature, file, line, tags, raw)
      Severity: Minor
      Found in lib/gurke/scenario.rb - About 35 mins to fix

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

            def run(runner, reporter)
              reporter.invoke :before_scenario, self
        
              _run(runner, reporter)
        
        
        Severity: Minor
        Found in lib/gurke/scenario.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