hiptest/hiptest-publisher

View on GitHub

Showing 71 of 88 total issues

File options_parser.rb has 695 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'i18n'
require 'optparse'
require 'parseconfig'
require 'ostruct'
require 'digest/md5'
Severity: Major
Found in lib/hiptest-publisher/options_parser.rb - About 1 day to fix

    File nodes.rb has 495 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'set'
    
    require 'hiptest-publisher/string'
    require 'hiptest-publisher/utils'
    require 'hiptest-publisher/renderer'
    Severity: Minor
    Found in lib/hiptest-publisher/nodes.rb - About 7 hrs to fix

      Class XMLParser has 55 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class XMLParser
          attr_reader :project
      
          def initialize(source, reporter = nil)
            @source = source
      Severity: Major
      Found in lib/hiptest-publisher/xml_parser.rb - About 7 hrs to fix

        Class HandlebarsHelper has 43 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class HandlebarsHelper
            def self.register_helpers(handlebars, context)
              instance = Hiptest::HandlebarsHelper.new(handlebars, context)
              instance.register_string_helpers
              instance.register_custom_helpers
        Severity: Minor
        Found in lib/hiptest-publisher/handlebars_helper.rb - About 5 hrs to fix

          File xml_parser.rb has 339 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'nokogiri'
          require 'colorize'
          
          require_relative 'nodes'
          require_relative 'utils'
          Severity: Minor
          Found in lib/hiptest-publisher/xml_parser.rb - About 4 hrs to fix

            Method update_options has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.update_options(options, reporter)
                config = ParseConfig.new(options.config)
                config.get_params.each do |param|
                  next if options.__cli_args && options.__cli_args.include?(param.to_sym)
                  if param.start_with?("no_")
            Severity: Minor
            Found in lib/hiptest-publisher/options_parser.rb - About 3 hrs 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

            Class CliOptionsChecker has 26 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class CliOptionsChecker
                attr_reader :reporter, :cli_options
                def initialize(cli_options, reporter)
                  @cli_options = cli_options
                  @reporter = reporter
            Severity: Minor
            Found in lib/hiptest-publisher/cli_options_checker.rb - About 3 hrs to fix

              Method each_sub_nodes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                    def each_sub_nodes(*types, deep: false)
                      return to_enum(:each_sub_nodes, *types, deep: deep) unless block_given?
                      path = [self]
                      parsed_nodes_id = Set.new
              
              
              Severity: Minor
              Found in lib/hiptest-publisher/nodes.rb - About 2 hrs 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

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

                class Client
                  attr_reader :cli_options
                  attr_writer :async_options
              
                  def initialize(cli_options, reporter = nil)
              Severity: Minor
              Found in lib/hiptest-publisher/client.rb - About 2 hrs to fix

                Method all_options has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.all_options
                    [
                      Option.new('t', 'token=TOKEN', nil, String, I18n.t('options.token'), :token),
                      Option.new('l', 'language=LANG', 'ruby', String, I18n.t('options.language'), :language),
                      Option.new('f', 'framework=FRAMEWORK', '', String, I18n.t('options.framework'), :framework),
                Severity: Major
                Found in lib/hiptest-publisher/options_parser.rb - About 2 hrs to fix

                  File handlebars_helper.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module Hiptest
                    class HandlebarsHelper
                      def self.register_helpers(handlebars, context)
                        instance = Hiptest::HandlebarsHelper.new(handlebars, context)
                        instance.register_string_helpers
                  Severity: Minor
                  Found in lib/hiptest-publisher/handlebars_helper.rb - About 2 hrs to fix

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

                    class LanguageGroupConfig
                      @@MAX_FILE_SIZE = 255
                    
                      def initialize(user_params, language_group_params = nil)
                        @output_directory = user_params.output_directory || ""
                    Severity: Minor
                    Found in lib/hiptest-publisher/options_parser.rb - About 2 hrs to fix

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

                        class Publisher
                          attr_reader :reporter
                      
                          def initialize(args, listeners: nil, exit_on_bad_arguments: true)
                            @reporter = Reporter.new(listeners)
                      Severity: Minor
                      Found in lib/hiptest-publisher.rb - About 2 hrs to fix

                        File client.rb has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'erb'
                        require 'i18n'
                        require 'json'
                        require 'net/http'
                        require 'uri'
                        Severity: Minor
                        Found in lib/hiptest-publisher/client.rb - About 2 hrs to fix

                          Method show_status_message has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def show_status_message(message, status=nil)
                              status_icon = " "
                              output = STDOUT
                          
                              if status == :success
                          Severity: Minor
                          Found in lib/hiptest-publisher/formatters/console_formatter.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 normalize! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def normalize!(reporter = nil)
                              self.uids = true if test_run? && uids_not_set_yet?
                              self.no_uids = !uids # silent normalization
                              modified_options = self.clone
                              if actionwords_only
                          Severity: Minor
                          Found in lib/hiptest-publisher/options_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 update_calls has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def update_calls
                                  @project.each_sub_nodes(Hiptest::Nodes::Scenario, Hiptest::Nodes::Actionword, Hiptest::Nodes::Test, Hiptest::Nodes::Folder) do |item|
                                    @last_annotation = nil
                                    item.each_sub_nodes(Hiptest::Nodes::Call) do |call|
                                      set_call_chunks(call)
                          Severity: Minor
                          Found in lib/hiptest-publisher/node_modifiers/gherkin_adder.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 project_export_filters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def project_export_filters
                                mapping = {
                                  filter_on_scenario_ids: 'filter_scenario_ids',
                                  filter_on_folder_ids: 'filter_folder_ids',
                                  filter_on_scenario_name: 'filter_scenario_name',
                          Severity: Minor
                          Found in lib/hiptest-publisher/client.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 test_run_id has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def test_run_id
                                return unless cli_options.test_run_id? || cli_options.test_run_name?
                          
                                if cli_options.test_run_id?
                                  key = "id"
                          Severity: Minor
                          Found in lib/hiptest-publisher/client.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 compute_diff has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def compute_diff(library_name = nil)
                                if library_name.nil?
                                  @old_uid = map_by_uid(@old)
                                  @current_uid = map_by_uid(@current)
                                else
                          Severity: Minor
                          Found in lib/hiptest-publisher/signature_differ.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

                          Severity
                          Category
                          Status
                          Source
                          Language