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'
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'
Class XMLParser
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class XMLParser
attr_reader :project
def initialize(source, reporter = nil)
@source = source
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
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'
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_")
- Read upRead up
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
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
- Read upRead up
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)
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),
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
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 || ""
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)
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'
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
- Read upRead up
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
- Read upRead up
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)
- Read upRead up
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',
- Read upRead up
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"
- Read upRead up
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
- Read upRead up
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"