File Progress.rb
has 580 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class ProgressClass < Module
include Yast::Logger
Method New
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def New(window_title, progress_title, length, stg, tits, help_text)
stg = deep_copy(stg)
tits = deep_copy(tits)
return if !@visible
Class ProgressClass
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class ProgressClass < Module
include Yast::Logger
def main
Yast.import "UI"
Method New
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def New(window_title, progress_title, length, stg, tits, help_text)
stg = deep_copy(stg)
tits = deep_copy(tits)
return if !@visible
- 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 Stage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def Stage(stage, title, step)
return if !@visible
Step(step) if -1 != step
- 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 PushState
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PushState
current_subprogress = CurrentSubprogressType()
state = {
# global variable
"stages" => @stages,
Method SubprogressType
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def SubprogressType(type, max_value)
return if !@visible || Mode.commandline
Builtins.y2debug(
"SubprogressType: type: %1, max_value: %2",
Method PopState
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PopState
# pop the config
state = Ops.get(
@progress_stack,
Ops.subtract(Builtins.size(@progress_stack), 1),
Method OpenSuperior
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def OpenSuperior(title, stages)
stages = deep_copy(stages)
if UI.HasSpecialWidget(:Wizard)
Wizard.OpenAcceptAbortStepsDialog
UI.WizardCommand(term(:AddStepHeading, title))
Method NextStage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def NextStage
return if !@visible
NextStep()
- 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 UpdateProgressBar
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def UpdateProgressBar
if Ops.greater_than(@current_step, @steps)
Builtins.y2error(
-2,
"Progress bar has only %1 steps, not %2.",
Method Stage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Stage(stage, title, step)
return if !@visible
Step(step) if -1 != step
Method NextStage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def NextStage
return if !@visible
NextStep()
Method SubprogressType
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def SubprogressType(type, max_value)
return if !@visible || Mode.commandline
Builtins.y2debug(
"SubprogressType: type: %1, max_value: %2",
- 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 NewProgressIcons
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def NewProgressIcons(window_title, progress_title, length, stg, tits, help_textmap, _icons_definition)
Method New
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def New(window_title, progress_title, length, stg, tits, help_text)
Method Finish
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Finish
return if !@visible || Mode.commandline
# decrease the reference counter
@progress_running -= 1
- 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"