Method main
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def main
textdomain "installation"
# local sources that have been attached under /mnt during upgrade
@local_urls = {}
- 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 inst_extrasources.rb
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "y2packager/known_repositories"
require "y2packager/resolvable"
Yast.import "UI"
Yast.import "Pkg"
Method RegisterRepos
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def RegisterRepos(url_list)
url_list = deep_copy(url_list)
ret = []
Builtins.foreach(url_list) do |new_url|
- 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 RegisteredUrls
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def RegisteredUrls
# get all registered installation sources
srcs = Pkg.SourceGetCurrent(false)
result = srcs.each_with_object([]) do |src, ret|
- 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 UpgradesAvailable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def UpgradesAvailable(repos)
ret = []
packages = []
# only package names (without 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
Avoid deeply nested control flow statements. Open
if Ops.greater_than(Builtins.size(@check_repos), 0)
UpgradeFrom(@check_repos)
@upgrade_info = UpgradesAvailable(@check_repos)
@upgrade_repos = Ops.get_list(@upgrade_info, "repositories", [])
Method InstallPackages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def InstallPackages(msg, details)
button_box = ButtonBox(
PushButton(
Id(:yes),
Opt(:default, :okButton, :key_F10),
- 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 GetURLsToRegister
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GetURLsToRegister(registered)
urls_from_control_file = ProductFeatures.GetFeature("software", "extra_urls")
if urls_from_control_file.nil?
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"