Showing 187 of 267 total issues
Method parse_scopes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_scopes(scope_string)
unknown_scopes = []
invalid_scopes = []
scopes = []
- 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_repositories
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def apply_repositories(xml)
return unless @system_description.repositories
xml.tag!("add-on") do
xml.add_on_products("config:type" => "list") do
- 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_server
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.run_server(system_description_store, opts, &block)
if opts[:public] && opts[:ip]
raise RuntimeError.new("It's only possible to use either an IP address or the 'public' " \
"flag bot not both.")
end
Method migrate_description
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrate_description(store, description_name, options = {})
load_migrations
hash = Machinery::Manifest.load(
description_name,
File autoyast.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Machinery::Autoyast < Machinery::Exporter
attr_accessor :name
def initialize(description)
@name = "autoyast"
Method content
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def content(description)
return unless description["changed_config_files"]
diffs_dir = description.scope_file_store("analyze/changed_config_files_diffs").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 render_comparison
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def render_comparison(description1, description2, scopes, options = {})
output = ""
identical = true
identical_scopes = []
common_scopes = false
- 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 handle_error
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.handle_error(e)
Machinery::Ui.kill_pager
case e
when GLI::MissingRequiredArgumentsException
Method migrate
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def migrate
if @hash.key?("packages")
@hash["packages"] = {
"_attributes" => {
"package_system" => "rpm"
Method list
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list(store, system_descriptions, options = {})
if options[:html]
list_html(store, options)
else
if system_descriptions.empty?
Method migrate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def migrate
["changed_managed_files", "config_files"].each do |scope|
next unless @hash.key?(scope)
@hash[scope]["files"].each 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 apply!
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def apply!(system_description)
element_filters.each do |path, element_filter|
steps = path.split("/").reject(&:empty?)
target = steps.pop
- 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 handle_error
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.handle_error(e)
Machinery::Ui.kill_pager
case e
when GLI::MissingRequiredArgumentsException
- 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_server
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.run_server(system_description_store, opts, &block)
if opts[:public] && opts[:ip]
raise RuntimeError.new("It's only possible to use either an IP address or the 'public' " \
"flag bot not both.")
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
Class KiwiConfig
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Machinery::KiwiConfig < Machinery::Exporter
attr_accessor :xml_text, :sh
attr_accessor :name
def initialize(system_description, options = {})
Class Array
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Array
class << self
attr_reader :attribute_keys, :element_classes
def has_attributes(*keys)
Method define_inspect_command_options
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.define_inspect_command_options(c)
c.flag [:name, :n],
type: String,
required: false,
arg_name: "NAME",
Method extract
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def extract(system_description, workloads, path)
Dir.mktmpdir do |dir|
unless workloads.select { |_, w| w["data"] }.empty?
system_description.unmanaged_files.export_files_as_tarballs(dir)
workloads.each do |workload, config|
- 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 show
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Method upgrade
has 49 lines of code (exceeds 25 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."
)