Method ProbeKernel
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def ProbeKernel
kernel_desktop_exists = ((Mode.normal || Mode.repair) &&
Pkg.PkgInstalled("kernel-desktop")) ||
Pkg.PkgAvailable("kernel-desktop")
Builtins.y2milestone(
- 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 Kernel.rb
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class KernelClass < Module
include Yast::Logger
Class KernelClass
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class KernelClass < Module
include Yast::Logger
# default configuration file for Kernel modules loaded on boot
MODULES_CONF_FILE = "yast.conf".freeze
Method ProbeKernel
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ProbeKernel
kernel_desktop_exists = ((Mode.normal || Mode.repair) &&
Pkg.PkgInstalled("kernel-desktop")) ||
Pkg.PkgAvailable("kernel-desktop")
Builtins.y2milestone(
Method ExtractCmdlineParameters
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def ExtractCmdlineParameters(line)
return unless line
# list of parameters to be discarded (yast internals)
cmdlist = list_of_params(line)
- 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 ComputePackage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ComputePackage
packages = GetPackages()
the_kernel = Ops.get(packages, 0, "")
Builtins.y2milestone("Selecting '%1' as kernel package", the_kernel)
- 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 SaveModulesToLoad
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def SaveModulesToLoad
modules_to_load
unless FileUtils.Exists(MODULES_DIR)
log.warn "Directory #{MODULES_DIR} does not exist, creating"
- 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 read_modules_to_load
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_modules_to_load
@modules_to_load = { MODULES_CONF_FILE => [] }
if FileUtils.Exists(MODULES_DIR)
config_files = SCR::Read(path(".target.dir"), MODULES_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 HidePasswords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def HidePasswords(in_)
ret = ""
if in_.nil?
ret = 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 ComputePackage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ComputePackage
packages = GetPackages()
the_kernel = Ops.get(packages, 0, "")
Builtins.y2milestone("Selecting '%1' as kernel package", the_kernel)
Method main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "Pkg"
Yast.import "Arch"
Yast.import "Mode"
Method list_of_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def list_of_params(line)
line = line.delete("\n")
cmdlist = []
parse_index = 0
in_quotes = 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"