hiptest/hiptest-publisher

View on GitHub

Showing 71 of 88 total issues

Method normalize! has 35 lines of code (exceeds 25 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

    Method set_call_chunks has 34 lines of code (exceeds 25 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 1 hr to fix

      Method as_api has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def as_api
            data = {}
      
            data[:deleted] = @diff[:deleted].map {|aw|
              {
      Severity: Minor
      Found in lib/hiptest-publisher/formatters/diff_displayer.rb - About 1 hr to fix

        Method set_actionwords_chunks has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def set_actionwords_chunks(actionword)
                name = actionword.uniq_name
                actionword_parameters = evaluated_map(actionword.children[:parameters])
                name_chunks = name.split("\"", -1)
                inline_parameter_names = []
        Severity: Minor
        Found in lib/hiptest-publisher/node_modifiers/gherkin_adder.rb - About 1 hr to fix

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

              def display_summary
                command_line = @cli_options.command_line_used(exclude: [:actionwords_diff])
          
                unless @diff[:deleted].nil?
                  puts I18n.t('actionwords_diff.summary.deleted', count: @diff[:deleted].length, command_line: command_line, list: displayable_list(@diff[:deleted]))
          Severity: Minor
          Found in lib/hiptest-publisher/formatters/diff_displayer.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 run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def run
                if @cli_options.check_version
                  return VersionChecker.check_version
                end
          
          
          Severity: Minor
          Found in lib/hiptest-publisher.rb - About 1 hr to fix

            Method make_language_group_config has 30 lines of code (exceeds 25 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 1 hr to fix

              Method register_partials has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def register_partials
                  dirs.reverse_each do |path|
                    next unless File.directory?(path)
                    Dir.entries(path).select do |file_name|
                      file_path = File.join(path, file_name)
              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 node_name has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def node_name
                  if self[:node_name] == "tests" || self[:node_name] == "scenarios" || self[:group_name] == "tests"
                    @leafless_export ? :tests : :scenarios
                  elsif self[:node_name] == "actionwords" || self[:group_name] == "actionwords"
                    :actionwords
              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 as_api has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def as_api
                    data = {}
              
                    data[:deleted] = @diff[:deleted].map {|aw|
                      {
              Severity: Minor
              Found in lib/hiptest-publisher/formatters/diff_displayer.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_definition_changed has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def compute_definition_changed
                    @definition_changed_uids = []
              
                    @definition_changed = @current_uid.map do |uid, aw|
                      next if @old_uid[uid].nil?
              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

              Method config_path_for has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.config_path_for(cli_options)
                  config_name = if cli_options.framework.empty?
                                  "#{cli_options.language}.conf"
                                else
                                  "#{cli_options.language}-#{cli_options.framework}.conf"
              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 show_status_message has 27 lines of code (exceeds 25 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

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

                      def initialize(name, description = '', tags = [], parameters = [], body = [], folder_uid = nil, datatable = Datatable.new, order_in_parent = 0)
                Severity: Major
                Found in lib/hiptest-publisher/nodes.rb - About 1 hr to fix

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

                      def run
                        if @cli_options.check_version
                          return VersionChecker.check_version
                        end
                  
                  
                  Severity: Minor
                  Found in lib/hiptest-publisher.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 check_push_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def check_push_file
                        if cli_options.push && !cli_options.global_failure_on_missing_reports
                          agnostic_path = clean_path(cli_options.push)
                          globbed_files = Dir.glob(agnostic_path)
                  
                  
                  Severity: Minor
                  Found in lib/hiptest-publisher/cli_options_checker.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 add_node_weight has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add_node_weight(node, path)
                        path << node[:name]
                  
                        node[:calls].each do |item_name|
                          next if path.include?(item_name)
                  Severity: Minor
                  Found in lib/hiptest-publisher/project_grapher.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 initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        def initialize(uid, parent_uid, name, description, tags = [], order_in_parent = 0, body = [])
                  Severity: Major
                  Found in lib/hiptest-publisher/nodes.rb - About 50 mins to fix

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

                          def initialize(name, description = '', test_plan = TestPlan.new, scenarios = Scenarios.new, actionwords = Actionwords.new, tests = Tests.new, libraries = Libraries.new)
                    Severity: Major
                    Found in lib/hiptest-publisher/nodes.rb - About 50 mins to fix

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

                            def organize_folders
                              @children[:root_folder] = @children[:folders].find(&:root?)
                              @children[:root_folder].parent = self if @children[:root_folder]
                      
                              @children[:folders].each do |folder|
                      Severity: Minor
                      Found in lib/hiptest-publisher/nodes.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

                      Severity
                      Category
                      Status
                      Source
                      Language