hiptest/hiptest-publisher

View on GitHub

Showing 71 of 88 total issues

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

    def push_query_parameters
      parameters = {}
      unless cli_options.execution_environment.strip.empty?
        parameters['execution_environment'] = cli_options.execution_environment
      end
Severity: Minor
Found in lib/hiptest-publisher/client.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 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def initialize(name, tags = [], parameters = [], body = [], uid = nil, description = '')
Severity: Minor
Found in lib/hiptest-publisher/nodes.rb - About 45 mins to fix

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

      def self.show_languages
        puts I18n.t('help.languages.supported_languages')
        languages.each do |language, frameworks|
          puts "#{language}:"
          if frameworks.empty?
    Severity: Minor
    Found in lib/hiptest-publisher/options_parser.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 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def initialize(name, tags = [], parameters = [], body = [], uid = nil, description = '')
    Severity: Minor
    Found in lib/hiptest-publisher/nodes.rb - About 45 mins to fix

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

          def check_language_and_only
            if present?(cli_options.language)
              begin
                language_config_parser = LanguageConfigParser.new(cli_options)
              rescue ArgumentError => err
      Severity: Minor
      Found in lib/hiptest-publisher/cli_options_checker.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 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def initialize(short, long, default, type, help, attribute)
      Severity: Minor
      Found in lib/hiptest-publisher/options_parser.rb - About 45 mins to fix

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

            def as_hh_join(context, items, joiner, name, block, else_block = nil)
        Severity: Minor
        Found in lib/hiptest-publisher/handlebars_helper.rb - About 45 mins to fix

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

              def display
                return export_as_json if @cli_options.actionwords_diff_json && @cli_options.output_directory
                return display_as_json if @cli_options.actionwords_diff_json
                return display_deleted if @cli_options.aw_deleted
                return display_created if @cli_options.aw_created
          Severity: Minor
          Found in lib/hiptest-publisher/formatters/diff_displayer.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 hh_if_includes has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def hh_if_includes(context, expression, element, block_true, block_false = nil)
          Severity: Minor
          Found in lib/hiptest-publisher/handlebars_helper.rb - About 35 mins to fix

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

                def hh_join(context, items, joiner, block, else_block = nil)
            Severity: Minor
            Found in lib/hiptest-publisher/handlebars_helper.rb - About 35 mins to fix

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

                    def initialize(name, tags = [], description = '', parameters = [], body = [])
              Severity: Minor
              Found in lib/hiptest-publisher/nodes.rb - About 35 mins to fix

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

                    def fetch_project_export_asynchronously
                      publication_export_id = fetch_asynchronous_publication_export_id
                      url = "#{base_publication_path}/async_project/#{publication_export_id}"
                      response = nil
                
                
                Severity: Minor
                Found in lib/hiptest-publisher/client.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 make_language_group_config has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def make_language_group_config group_name
                    # List of options that can be set in the config file but not in command line
                    non_visible_options = {
                      package: @cli_options.package,
                      meta: meta,
                Severity: Minor
                Found in lib/hiptest-publisher/options_parser.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 each_direct_children has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def each_direct_children
                        children.each_value do |child|
                          if child.is_a? Hiptest::Nodes::Node
                            yield child
                          elsif child.is_a? Array
                Severity: Minor
                Found in lib/hiptest-publisher/nodes.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 fetch_project has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def fetch_project
                      cached = export_cache.cache_for(url)
                
                      unless cached.nil?
                        @reporter.with_status_message I18n.t(:using_cached_data) do
                Severity: Minor
                Found in lib/hiptest-publisher/client.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 replace_parameter_value_with_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def replace_parameter_value_with_type(collection, parameters)
                      collection.map do |obj|
                        if obj[:is_parameter]
                          parameter = parameters.find { |parameter| parameter.children[:name] == obj[:name] }
                          obj[:typed_value] = parameter ? "{#{parameter.type.downcase}}" : "{}"
                Severity: Minor
                Found in lib/hiptest-publisher/renderer_addons/gherkin_addon.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 call_node_walker has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def call_node_walker(node)
                      if node.is_a? Hiptest::Nodes::Node
                        @rendered_children = {}
                
                        node.children.each do |name, child| 
                Severity: Minor
                Found in lib/hiptest-publisher/renderer.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

                Avoid too many return statements within this method.
                Open

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

                  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_renamed if @cli_options.aw_renamed
                    Severity: Major
                    Found in lib/hiptest-publisher/formatters/diff_displayer.rb - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language