Showing 86 of 86 total issues
Avoid parameter lists longer than 5 parameters. [7/5] Open
def ask_for_new_password(prompt, default: nil, allow_empty: false, retry_limit: 1, confirm_password: true, validation: nil, validation_err: nil)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Method initialize_from_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize_from_hash(hash) hash.each do |k, v| next if v.nil? setter = "#{k}=" if self.respond_to?(setter)
- Read upRead up
- Create a ticketCreate a ticket
Method ask_for_uri
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_for_uri(prompt, expected_scheme, opts = {}) require 'uri' just_ask(prompt, nil, nil, 'a valid URI') do |q| q.validate = lambda do |a| # Convert all backslashes in the URI to forward slashes and strip whitespace
- Read upRead up
- Create a ticketCreate a ticket
Method ask_with_menu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_with_menu(prompt, options, default = nil, clear_screen_after = true) say("#{prompt}\n\n") default = default_to_index(default, options) selection = nil
- Read upRead up
- Create a ticketCreate a ticket
Method node_number_valid?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def node_number_valid? rec = record_for_node_number return true if rec.nil? node_state = rec["active"] ? "active" : "inactive"
- Read upRead up
- Create a ticketCreate a ticket
Method fetch_from_server
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch_from_server(src_file, dst_file) return if file_found?(dst_file) FileUtils.mkdir_p(dst_file.dirname) unless dst_file.dirname.directory?
- Read upRead up
- Create a ticketCreate a ticket
Method ask_questions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_questions return false unless valid_environment? ask_for_parameters show_parameters return false unless agree("\nProceed? (Y/N): ")
- Read upRead up
- Create a ticketCreate a ticket
Method set_server_state
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_server_state case options[:server] when "start" EvmServer.start unless EvmServer.running? when "stop"
- Read upRead up
- Create a ticketCreate a ticket
Method ask_yn?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_yn?(prompt, default = nil) ask("#{prompt}? (Y/N): ") do |q| q.default = default if default q.validate = ->(p) { (p.blank? && default) || %w(y n).include?(p.downcase[0]) } q.responses[:not_valid] = "Please provide yes or no."
- Read upRead up
- Create a ticketCreate a ticket
Method activate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def activate if !key_exist? || force if get_new_key save_new_key else
- Read upRead up
- Create a ticketCreate a ticket
Method selected_verb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def selected_verb(key, flag) if EXT_AUTH_OPTIONS[key][:logic] flag ? "Enable" : "Disable" else flag ? "Disable" : "Enable"
- Read upRead up
- Create a ticketCreate a ticket
Method valid_environment?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def valid_environment? if already_configured? unconfigure if agree("\nAlready configured on this Appliance, Un-Configure first? (Y/N): ") return false unless agree("\nProceed with Configuration? (Y/N): ") end
- Read upRead up
- Create a ticketCreate a ticket
Method ask_questions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_questions @current_config = load_current apply = EXT_AUTH_OPTIONS.keys.count + 1 skip = apply + 1 selection = 0
- Read upRead up
- Create a ticketCreate a ticket
Method has too many optional parameters. [4/3] Open
def ask_for_many(prompt, collective = nil, default = nil, max_length = 255, max_count = 6) collective ||= "#{prompt}s" validate = ->(p) { (p.length < max_length) && (p.split(/[\s,;]+/).length <= max_count) } error_message = "up to #{max_count} #{prompt}s separated by a space and up to #{max_length} characters" just_ask(collective, default, validate, error_message).split(/[\s,;]+/).collect(&:strip)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Method has too many optional parameters. [4/3] Open
def just_ask(prompt, default = nil, validate = nil, error_text = nil, klass = nil) ask("Enter the #{prompt}: ", klass) do |q| q.default = default.to_s if default q.validate = validate if validate q.responses[:not_valid] = error_text ? "Please provide #{error_text}" : "Please provide in the specified format"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Method ask_questions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ask_questions clear_screen say("Establish Replication Standby Server\n") return false if !data_dir_empty? && !confirm_data_resync self.disk = ask_for_disk("Standby database disk")
- Read upRead up
- Create a ticketCreate a ticket
Method load_current
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.load_current require 'yaml' unless File.exist?(DB_YML) require 'fileutils' FileUtils.cp(DB_YML_TMPL, DB_YML) if File.exist?(DB_YML_TMPL)
- Read upRead up
- Create a ticketCreate a ticket
Method set_db
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_db raise "No encryption key (v2_key) present" unless key_configuration.key_exist? raise "A password is required to configure a database" unless password? if local? set_internal_db
- Read upRead up
- Create a ticketCreate a ticket
Method rename_mellon_configfiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rename_mellon_configfiles debug_msg("Renaming mellon config files ...") Dir.chdir(SAML2_CONFIG_DIRECTORY) do Dir.glob("https_*.*") do |mellon_file| saml2_file =
- Read upRead up
- Create a ticketCreate a ticket
Method activate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def activate say("Configuring Replication Standby Server...") stop_postgres stop_repmgrd initialize_postgresql_disk if disk
- Read upRead up
- Create a ticketCreate a ticket