Showing 187 of 267 total issues
File cli.rb
has 1088 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Machinery
class Cli
extend GLI::App
program_desc "A systems management toolkit for Linux"
Method content
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def content(description)
return unless description.repositories
if description.repositories.empty?
puts "There are no repositories."
- 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 48 (exceeds 5 allowed). Consider refactoring. Open
def content(description)
return unless description["unmanaged_files"]
list do
file_status = description["unmanaged_files"].extracted
- 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 list
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def list(store, system_descriptions, options = {})
if options[:html]
list_html(store, options)
else
if system_descriptions.empty?
- 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
File salt_states.rb
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Machinery
# TODO(gyee): add .repositories
# NOTE(gyee): the order matters
SALT_INIT_SLS = %(include:
- .groups
Method parse_changes_line
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def parse_changes_line(line)
# rpm provides lines per config file where first 9 characters indicate which
# properties of the file are modified
@rpm_changes, *fields = line.split(" ")
# nine rpm changes are known
- 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
File bootstrap-tooltip.js
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ========================================================================
* Bootstrap: tooltip.js v3.2.0
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
File kiwi_config.rb
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Machinery::KiwiConfig < Machinery::Exporter
attr_accessor :xml_text, :sh
attr_accessor :name
def initialize(system_description, options = {})
Method matches?
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def matches?(value)
@matchers.each do |operator, matchers|
matchers.each do |matcher|
values_equal = case value
when Machinery::Array
- 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 SystemDescription
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Machinery::SystemDescription < Machinery::Object
CURRENT_FORMAT_VERSION = 10
EXTRACTABLE_SCOPES = [
"changed_managed_files",
"changed_config_files",
Method apply_repositories
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def apply_repositories(xml)
if @system_description.repositories
usable_repositories = false
@system_description.repositories.each do |repo|
# workaround kiwi issue by replacing spaces
- 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 findUnmanagedFiles
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
func findUnmanagedFiles(dir string, rpmFiles map[string]string, rpmDirs map[string]bool,
unmanagedFiles map[string]string, ignoreList map[string]bool) {
files, _ := readDir(dir)
for _, f := range files {
fileName := dir + f.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 integration_tests_sheet
has a Cognitive Complexity of 23 (exceeds 5 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|
- 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 SaltStates
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class SaltStates < Machinery::Exporter
attr_accessor :name
def initialize(system_description, options)
@name = "salt"
Method migrate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def migrate
if @hash.key?("packages")
@hash["packages"] = {
"_attributes" => {
"package_system" => "rpm"
- 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 a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def apply_services(xml)
return unless @system_description.services
xml.tag!("services-manager") do
xml.services("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 build
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build(system_description, output_path, options = {})
Machinery::LocalSystem.validate_architecture("x86_64")
Machinery::LocalSystem.validate_existence_of_packages(
["python3-kiwi", "kiwi-image-vmx-requires"]
)
Function parallaxImgScroll
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function parallaxImgScroll(){
for (i = 0; i < parallaxElementsArray.length; i++) {
scrolled = $(window).scrollTop();
- 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 build
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def build(system_description, output_path, options = {})
Machinery::LocalSystem.validate_architecture("x86_64")
Machinery::LocalSystem.validate_existence_of_packages(
["python3-kiwi", "kiwi-image-vmx-requires"]
)
- 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 shadow_attributes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def shadow_attributes(shadow, user)
line = shadow.lines.find { |l| l.start_with?("#{user}:") }
if line
user, passwd, changed, min, max, warn, inactive, expire = line.split(":").map(&:chomp)
- 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"