src/lib/installation/clients/inst_update_installer.rb
Class InstUpdateInstaller
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class InstUpdateInstaller
include Yast::Logger
include Yast::I18n
UPDATED_FLAG_FILENAME = "installer_updated".freeze
File inst_update_installer.rb
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "installation/instsys_packages"
require "installation/update_repositories_finder"
require "installation/updates_manager"
require "installation/selfupdate_verifier"
require "y2packager/self_update_addon_repo"
Method add_repository
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_repository(repo)
log.info("Adding update from #{repo.inspect}")
updates_manager.add_repository(repo.uri)
rescue ::Installation::UpdatesManager::NotValidRepo
if repo.user_defined?
- 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 main
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def main
return :back if GetInstArgs.going_back
require_registration_libraries
- 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"