Method DoInstallAndRemoveInt
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DoInstallAndRemoveInt(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
return false if !PackageLock.Check
Method DoInstallAndRemoveInt
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def DoInstallAndRemoveInt(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
return false if !PackageLock.Check
- 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 PackageSystem.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "yast2/execute"
require "shellwords"
module Yast
Method InstallKernel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def InstallKernel(kernel_modules)
kernel_modules = deep_copy(kernel_modules)
# this function may be responsible for the horrible startup time
Builtins.y2milestone("want: %1", kernel_modules)
if kernel_modules == []
Method InstallKernel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def InstallKernel(kernel_modules)
kernel_modules = deep_copy(kernel_modules)
# this function may be responsible for the horrible startup time
Builtins.y2milestone("want: %1", kernel_modules)
if kernel_modules == []
- 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
Avoid too many return
statements within this method. Open
return false if ok != true
Avoid too many return
statements within this method. Open
return false
Method SelectPackages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def SelectPackages(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
ok = true
- 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"