enkessler/cuke_modeler

View on GitHub

Showing 11 of 37 total issues

Class Gherkin9Adapter has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Gherkin9Adapter < GherkinBaseAdapter

    # Adapts the given AST into the shape that this gem expects
    def adapt(ast)
      adapted_ast = {}
Severity: Minor
Found in lib/cuke_modeler/adapters/gherkin_9_adapter.rb - About 2 hrs to fix

    Class Gherkin20Adapter has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Gherkin20Adapter < GherkinBaseAdapter
    
        # Adapts the given AST into the shape that this gem expects
        def adapt(ast)
          adapted_ast = {}
    Severity: Minor
    Found in lib/cuke_modeler/adapters/gherkin_20_adapter.rb - About 2 hrs to fix

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

          def to_s
            text = ''
      
            text << "#{tag_output_string}\n" unless tags.empty?
            text << "#{@keyword}:#{name_output_string}"
      Severity: Minor
      Found in lib/cuke_modeler/models/outline.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 to_s has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_s
            text = ''
      
            text << "#{tag_output_string}\n" unless tags.empty?
            text << "#{@keyword}:#{name_output_string}"
      Severity: Minor
      Found in lib/cuke_modeler/models/example.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 to_s has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_s
            text = ''
      
            text << "#{tag_output_string}\n" unless tags.empty?
            text << "#{@keyword}:#{name_output_string}"
      Severity: Minor
      Found in lib/cuke_modeler/models/scenario.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 to_s has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_s
            text = ''
      
            text << "#{tag_output_string}\n" unless tags.empty?
            text << "#{@keyword}:#{name_output_string}"
      Severity: Minor
      Found in lib/cuke_modeler/models/feature.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 to_s has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_s
            text = ''
      
            text << "#{tag_output_string}\n" unless tags.empty?
            text << "#{@keyword}:#{name_output_string}"
      Severity: Minor
      Found in lib/cuke_modeler/models/rule.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 to_s has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_s
            text = ''
      
            text << "#{@keyword}:#{name_output_string}"
            text << "\n#{description_output_string}" unless no_description_to_output?
      Severity: Minor
      Found in lib/cuke_modeler/models/background.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 clear_child_elements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def clear_child_elements(ast, child_paths)
            # rubocop:disable Security/Eval - This is not blind data
            # rubocop:disable Style/DocumentDynamicEvalDefinition - Nice idea but bad detection ability
            child_paths.each do |traversal_path|
              # Don't add any properties to the object if it didn't already have them
      Severity: Minor
      Found in lib/cuke_modeler/adapters/gherkin_20_adapter.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 adapt_child_elements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def adapt_child_elements(element_ast)
            return [] unless element_ast[:children]
      
            adapted_children = []
      
      
      Severity: Minor
      Found in lib/cuke_modeler/adapters/gherkin_9_adapter.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 adapt_test has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def adapt_test(test_ast)
            if (test_node?(test_ast) && test_has_examples?(test_ast)) ||
               (test_node?(test_ast) && test_uses_outline_keyword?(test_ast))
      
              adapt_outline(test_ast)
      Severity: Minor
      Found in lib/cuke_modeler/adapters/gherkin_9_adapter.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