hiptest/hiptest-publisher

View on GitHub

Showing 71 of 88 total issues

Avoid too many return statements within this method.
Open

        return
Severity: Major
Found in lib/hiptest-publisher.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return display_signature_changed if @cli_options.aw_signature_changed
    Severity: Major
    Found in lib/hiptest-publisher/formatters/diff_displayer.rb - About 30 mins to fix

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

          def needs_fixing?(call)
            scenario = call.parent
      
            return false unless scenario.is_a?(Hiptest::Nodes::Scenario)
            return false unless call.children[:annotation].nil? || ignore_case_equal?(call.children[:annotation], 'then')
      Severity: Minor
      Found in lib/hiptest-publisher/renderer_addons/groovy_spock_addon.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 evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def evaluate(value)
              if value.nil?
                nil
              elsif Hiptest::Nodes::Variable === value
                "<#{value.children[:name]}>"
      Severity: Minor
      Found in lib/hiptest-publisher/node_modifiers/gherkin_adder.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 check_secret_token has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_secret_token
            if absent?(cli_options.xml_file)
              if absent?(cli_options.token)
                raise CliOptionError, I18n.t('errors.cli_options.missing_token')
              end
      Severity: Minor
      Found in lib/hiptest-publisher/cli_options_checker.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 find_uniq_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def find_uniq_name(name, existing)
              return name unless existing.include?(name)
      
              index = 1
              new_name = ""
      Severity: Minor
      Found in lib/hiptest-publisher/node_modifiers/actionword_uniq_renamer.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 set_call_chunks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def set_call_chunks(call)
              all_arguments = all_valued_arguments_for(call)
              inline_parameter_names = []
              extra_inlined_arguments = []
      
      
      Severity: Minor
      Found in lib/hiptest-publisher/node_modifiers/gherkin_adder.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 url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def url
            if cli_options.push?
              "#{cli_options.site}/import_test_results/#{cli_options.token}/#{cli_options.push_format}#{push_query_parameters}"
            elsif test_run_id
              "#{base_publication_path}/test_run/#{test_run_id}#{test_run_export_filter}"
      Severity: Minor
      Found in lib/hiptest-publisher/client.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 compute_renamed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def compute_renamed
            excluded = [
              @created_uids,
              @deleted_uids,
              @definition_changed_uids,
      Severity: Minor
      Found in lib/hiptest-publisher/signature_differ.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 as_hh_join has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def as_hh_join(context, items, joiner, name, block, else_block = nil)
            joiner = joiner.to_s
            joiner.gsub!(/\\t/, "\t")
            joiner.gsub!(/\\n/, "\n")
      
      
      Severity: Minor
      Found in lib/hiptest-publisher/handlebars_helper.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 compute_signature_changed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def compute_signature_changed
            excluded = [
              @created_uids,
              @deleted_uids,
              @definition_changed_uids
      Severity: Minor
      Found in lib/hiptest-publisher/signature_differ.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