library/cwm/src/modules/CWMTsigKeys.rb
File CWMTsigKeys.rb
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "yast"
require "shellwords"
module Yast
class CWMTsigKeysClass < Module
Method Handle
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
Open
def Handle(widget, _key, event)
widget = deep_copy(widget)
event = deep_copy(event)
ret = Ops.get(event, "ID")
existing_filename = Convert.to_string(
- 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 Handle
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def Handle(widget, _key, event)
widget = deep_copy(widget)
event = deep_copy(event)
ret = Ops.get(event, "ID")
existing_filename = Convert.to_string(
Method CreateWidget
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def CreateWidget(settings)
settings = deep_copy(settings)
# tsig keys management dialog help 1/4
help = _(
"<p><big><b>TSIG Key Management</b></big><br>\nUse this dialog to manage the TSIG keys.</p>\n"
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil unless Popup.YesNo(_("Specified file exists. Rewrite it?"))
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil if !Popup.YesNo(_("The key will be created now. Continue?"))
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this method. Open
Open
return nil
Method NormalizeFilename
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def NormalizeFilename(filename)
while filename != "" &&
(Builtins.substring(filename, 0, 1) == " " ||
Builtins.substring(filename, 0, 1) == "\"")
filename = Builtins.substring(filename, 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"