Showing 187 of 267 total issues
Method integration_tests_sheet
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def integration_tests_sheet(matrix)
@document.text "Integration Tests", align: :center, size: 24
@document.move_down 22
matrix.integration_tests.each do |test, support|
Method upgrade
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def upgrade(store, name, options = {})
if !options[:all] && !store.list.include?(name)
raise Machinery::Errors::SystemDescriptionNotFound.new(
"System description '#{name}' does not exist."
)
- 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 compare_with
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def compare_with(other)
if extracted != other.extracted
Machinery::Ui.warn("Warning: Comparing extracted with unextracted" \
" unmanaged files. Only common attributes are considered.")
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 content
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def content(description)
return unless description["changed_managed_files"]
if description["changed_managed_files"]
files, errors = description["changed_managed_files"].partition 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 analyze
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def analyze(description)
description.assert_scopes("os")
check_os(description)
Machinery::LocalSystem.validate_existence_of_packages(["zypper"])
description.validate_analysis_compatibility
- 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
Function initialSetup
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initialSetup() {
$(".parallax-img-container").each(function() {
var widthOfContainer = $(this).width();
var heightOfContainer = $(this).height();
var setOfElements = $(this).children();
Method analyze
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def analyze(description)
description.assert_scopes("os")
check_os(description)
Machinery::LocalSystem.validate_existence_of_packages(["zypper"])
description.validate_analysis_compatibility
Method deploy
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deploy(description, cloud_config, options = {})
Machinery::LocalSystem.validate_architecture("x86_64")
Machinery::LocalSystem.validate_existence_of_packages(
["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"]
)
Method deploy
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def deploy(description, cloud_config, options = {})
Machinery::LocalSystem.validate_architecture("x86_64")
Machinery::LocalSystem.validate_existence_of_packages(
["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"]
)
- 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 mode_string_to_octal
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def mode_string_to_octal(mode)
result = 0
# The following code is intentionally stupid.
- 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 migrate_description
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def migrate_description(store, description_name, options = {})
load_migrations
hash = Machinery::Manifest.load(
description_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 managed_file_states
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def managed_file_states(output_location)
salt_root_dir = "root"
output_root_path = File.join(output_location, salt_root_dir)
FileUtils.mkdir_p(output_root_path)
- 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 convert_element
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def convert_element(element)
(self.class.element_classes || []).each do |definition|
condition = definition[:if]
klass = definition[:class]
if condition
- 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 apply_services
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_services
if @system_description["services"]
init_system = @system_description["services"].init_system
case init_system
Method compare_with
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def compare_with(other)
if extracted != other.extracted
Machinery::Ui.warn("Warning: Comparing extracted with unextracted" \
" unmanaged files. Only common attributes are considered.")
end
Method inspect_dpkg
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inspect_dpkg
dpkg_data = @system.run_command(
"dpkg", "-l", stdout: :capture
)
Method inject_extracted_files
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inject_extracted_files(output_location)
["changed_managed_files", "changed_config_files"].each do |scope|
next unless @system_description.scope_extracted?(scope)
output_root_path = File.join(output_location, "root")
Method parse_scopes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_scopes(scope_string)
unknown_scopes = []
invalid_scopes = []
scopes = []
Method generate_changelog
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def generate_changelog
changes = { @release_version => create_rpm_header(@release_version, @release_time, @mail) }
news = { @release_version => "" }
CHANGELOG_FILES.each do |file|
version = @release_version
- 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_with_progress
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run_with_progress(*command, type, &callback)
output = ""
error = ""
write_io = StringIO.new(output, "a")
error_io = StringIO.new(error, "a")
- 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"