Showing 66 of 98 total issues
Class Backup
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Backup
include Concerns::SystemHelpers
attr_accessor :standard_files, :katello_online_files, :katello_offline_files,
:foreman_online_files, :foreman_offline_files, :fpc_offline_files,
Class ForemanProxy
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Features::ForemanProxy < ForemanMaintain::Feature
metadata do
label :foreman_proxy
confine do
find_package('foreman-proxy')
Class Executable
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Executable
extend Forwardable
extend Concerns::Finders
attr_reader :options
Class Dnf
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Dnf < Base
PROTECTOR_CONFIG_FILE = '/etc/dnf/plugins/foreman-protector.conf'.freeze
PROTECTOR_WHITELIST_FILE = '/etc/dnf/plugins/foreman-protector.whitelist'.freeze
def self.parse_envra(envra)
File cli_reporter.rb
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'highline'
module ForemanMaintain
class Reporter
class CLIReporter < Reporter
Class CLIReporter
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class CLIReporter < Reporter
include Concerns::Logger
# Simple spinner able to keep updating current line
class Spinner
def initialize(reporter, interval = 0.1)
Class Scenario
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Scenario
include Concerns::Logger
include Concerns::SystemHelpers
include Concerns::ScenarioMetadata
include Concerns::Finders
Class Instance
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Features::Instance < ForemanMaintain::Feature
metadata do
label :instance
end
Class Base
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Base < Clamp::Command
include Concerns::Finders
attr_reader :runner
Class Hammer
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Features::Hammer < ForemanMaintain::Feature
attr_reader :configuration, :config_files
metadata do
label :hammer
Class UpgradeRunner
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class UpgradeRunner < Runner
include Concerns::Finders
# Phases of the upgrade, see README.md for more info
PHASES = [:pre_upgrade_checks,
Method scenario_failure_message
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scenario_failure_message(scenario)
return if scenario.passed? && !scenario.warning?
message = []
message << <<-MESSAGE.strip_heredoc
Method scenario_failure_message
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def scenario_failure_message(scenario)
return if scenario.passed? && !scenario.warning?
message = []
message << <<-MESSAGE.strip_heredoc
- 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 ensure_dir_unchanged
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ensure_dir_unchanged
matching = false
backup_file = File.join(@backup_dir, '.pulp.snar')
alternate_backup = File.join(@backup_dir, '.pulp.snar.backup')
until matching
- 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 facts
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def facts
unless defined?(@facts)
@facts = {}
regex = /^(["'])(.*)(\1)$/
File.open(os_release_file) do |file|
- 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 run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run
unless @preserve_dir
puts "Creating backup folder #{@backup_dir}"
FileUtils.mkdir_p @backup_dir
- 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 tar_command
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def tar_command(options)
volume_size = options.fetch(:volume_size, nil)
absolute_names = options.fetch(:absolute_names, nil)
validate_volume_size(volume_size) unless volume_size.nil?
- 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 ask_to_select
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def ask_to_select(message, steps, run_strategy)
if assumeyes?
step = steps[@select_option_counter]
@select_option_counter += 1
puts("(assuming option #{@select_option_counter})")
- 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 ask_to_select
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def ask_to_select(message, steps, run_strategy)
if assumeyes?
puts('(assuming first option)')
return steps.first
end
- 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 tar_command
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tar_command(options)
volume_size = options.fetch(:volume_size, nil)
absolute_names = options.fetch(:absolute_names, nil)
validate_volume_size(volume_size) unless volume_size.nil?