yast/yast-installation

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

Summary

Maintainability
C
1 day
Test Coverage

File inst_deploy_image.rb has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Yast
  class InstDeployImageClient < Client
    include Yast::Logger

    def main
Severity: Minor
Found in src/lib/installation/clients/inst_deploy_image.rb - About 3 hrs to fix

    Method SetOneImageProgress has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def SetOneImageProgress(current_progress)
          current_image = ImageInstallation.GetCurrentImageDetails
          max_progress = Ops.get_integer(current_image, "max_progress", 0)
    
          another_image = false
    Severity: Minor
    Found in src/lib/installation/clients/inst_deploy_image.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 MyProgressDownloadHandler has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def MyProgressDownloadHandler(percent, _bps_avg, bps_current)
          # changing settings on the fly
          # ... first when download handler is hit
          #
          # if a repository is remote, there are twice more steps to do (download, deploy)
    Severity: Minor
    Found in src/lib/installation/clients/inst_deploy_image.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 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def main
          Yast.import "Pkg"
          Yast.import "Installation"
          Yast.import "ImageInstallation"
          Yast.import "Progress"
    Severity: Minor
    Found in src/lib/installation/clients/inst_deploy_image.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 OverallProgressHandler has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def OverallProgressHandler(id, current_step)
          # new set of steps
          if @_previous_id != id
            # reset steps in subprogress
            @_current_step_in_subprogress = 0
    Severity: Minor
    Found in src/lib/installation/clients/inst_deploy_image.rb - About 55 mins 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