File ImageInstallation.rb
has 1023 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "y2packager/resolvable"
module Yast
class ImageInstallationClass < Module
Class ImageInstallationClass
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class ImageInstallationClass < Module
include Yast::Logger
IMAGE_COMPRESS_RATIO = 3.6
MEGABYTE = 2**20
Method DeployTarImage
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def DeployTarImage(id, target)
InitRepo()
file = Ops.get_string(@_images, [id, "file"], "")
Builtins.y2milestone("Untarring image %1 (%2) to %3", id, file, target)
- 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 FindImageSet
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def FindImageSet(patterns)
patterns = deep_copy(patterns)
InitRepo()
# reset all data
- 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 RestoreAllChanges
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def RestoreAllChanges
nr_steps = Ops.multiply(4, Builtins.size(@all_supported_types))
id = "restoring_user_prefs"
AdjustProgressLayout(id, nr_steps, _("Restoring user preferences..."))
- 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 FileSystemCopy
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def FileSystemCopy(from, to, progress_start, progress_finish)
total_mb = if from == "/"
# root is a merge of two filesystems, df returns only one part for /
calculate_fs_size("/read-write") + calculate_fs_size("/read-only")
else
- 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 FillUpImagesDetails
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def FillUpImagesDetails
InitRepo()
# bnc #439104
if @_repo.nil?
- 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 DeployImages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def DeployImages(images, target, progress)
images = deep_copy(images)
progress = deep_copy(progress)
# unregister callbacks
PackageCallbacks.RegisterEmptyProgressCallbacks
- 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"