Showing 806 of 967 total issues
Method InterfacesValidate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def InterfacesValidate(_widget, _key, _event)
trusted_zone = firewalld.find_zone("trusted")
ifaces = Convert.convert(
UI.QueryWidget(Id("_cwm_interface_list"), :SelectedItems),
- 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 Selected2Opened
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def Selected2Opened(ifaces, _nm_ifaces_have_to_be_selected)
log.info("Selected ifaces: #{ifaces}")
zone_names = ifaces.map do |name|
zone = interface_zone(name)
zone ? zone.name : default_zone.name
- 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 getProposals
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def getProposals(stage, mode, proptype)
props = getMatchingProposal(stage, mode, proptype)
unique_id = Ops.get_string(props, [0, "unique_id"], "")
disabled_subprops = GetDisabledSubProposals()
- 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 TimedOKCancel
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def TimedOKCancel(message, timeout_seconds)
success = UI.OpenDialog(
Opt(:decorated),
HBox(
HSpacing(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"
Further reading
Method find_longest_records
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_longest_records(items)
return [] unless items
# searching all rows
items.each_with_object([]) do |row, result|
- 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 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
Yast.import "Arch"
Yast.import "Label"
Method GetAdditionalServices
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def GetAdditionalServices(protocol, zone)
if !IsSupportedProtocol(protocol)
Builtins.y2error("Unknown protocol '%1'", protocol)
return nil
end
Method main
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "Stage"
Yast.import "Linuxrc"
Yast.import "Directory"
Method SignFile
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def SignFile(keyid, file, passphrase, ascii_signature)
if passphrase.nil? || keyid.nil? || keyid == "" || file.nil? ||
file == ""
Builtins.y2error(
"Invalid parameters: keyid: %1, file: %2, passphrase: %3",
Method AddForwardIntoMasqueradeRule
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def AddForwardIntoMasqueradeRule(source_net, forward_to_ip, protocol, req_port, redirect_to_port, requested_ip)
SetModified()
masquerade_rules = Ops.get_string(@SETTINGS, "FW_FORWARD_MASQ", "")
Method TimedAnyQuestion
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds)
button_box = AnyQuestionButtonBox(
yes_button_message,
no_button_message,
focus
Method TimedOKCancel
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def TimedOKCancel(message, timeout_seconds)
success = UI.OpenDialog(
Opt(:decorated),
HBox(
HSpacing(1),
Method PushState
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PushState
current_subprogress = CurrentSubprogressType()
state = {
# global variable
"stages" => @stages,
Method CreateKey
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateKey
command = Ops.add("GPG_AGENT_INFO='' ", buildGPGcommand("--gen-key"))
text_mode = Ops.get_boolean(UI.GetDisplayInfo, "TextMode", false)
Builtins.y2debug("text_mode: %1", text_mode)
Method PrepareScripts
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PrepareScripts(workflow)
workflow = deep_copy(workflow)
tmp_dir = Convert.to_string(WFM.Read(path(".local.tmpdir"), []))
if Builtins.haskey(workflow, "prescript")
interpreter = Ops.get_string(workflow, ["prescript", "interpreter"], "shell")
Method SaveLogs
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def SaveLogs
env_home = ENV["HOME"]
homedir = if env_home && !env_home.empty?
env_home
Method Start
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Start(log)
if (@type == "dsl" && @capi_adsl) || @type == "isdn"
status = Service.Status("isdn")
Builtins.y2milestone("We need ISDN service, status: %1", status)
if status != 0 && !Service.Start("isdn")
Method FindBaseProducts
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def FindBaseProducts
return unless load_zypp
log.info "Looking for base products"
Method CreateLdapWidget
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateLdapWidget(settings)
settings = deep_copy(settings)
use_ldap_checkbox = Ops.get_locale(
settings,
Method ValidateMaps
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ValidateMaps(widgets)
widgets = deep_copy(widgets)
ret = true
Builtins.foreach(widgets) do |k, v|
Builtins.foreach(v) do |kk, vv|