yast/yast-installation

View on GitHub
src/lib/installation/clients/inst_update_installer.rb

Summary

Maintainability
C
1 day
Test Coverage

Class InstUpdateInstaller has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

  class InstUpdateInstaller
    include Yast::Logger
    include Yast::I18n

    UPDATED_FLAG_FILENAME = "installer_updated".freeze
Severity: Minor
Found in src/lib/installation/clients/inst_update_installer.rb - About 3 hrs to fix

    File inst_update_installer.rb has 313 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "installation/instsys_packages"
    require "installation/update_repositories_finder"
    require "installation/updates_manager"
    require "installation/selfupdate_verifier"
    require "y2packager/self_update_addon_repo"
    Severity: Minor
    Found in src/lib/installation/clients/inst_update_installer.rb - About 3 hrs to fix

      Method add_repository has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      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?
      Severity: Minor
      Found in src/lib/installation/clients/inst_update_installer.rb - About 1 hr to fix

      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

          def main
            return :back if GetInstArgs.going_back
      
            require_registration_libraries
      
      
      Severity: Minor
      Found in src/lib/installation/clients/inst_update_installer.rb - About 1 hr to fix

      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

      There are no issues that match your filters.

      Category
      Status