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
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
- 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 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)
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def main
Yast.import "Pkg"
Yast.import "Installation"
Yast.import "ImageInstallation"
Yast.import "Progress"
- 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 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
- 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"