Showing 806 of 967 total issues
Method initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(systemd_unit, property_text)
super()
self[:systemd_unit] = systemd_unit
if property_text.nil?
raw_output = load_systemd_properties
Method FormatSimpleType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def FormatSimpleType(variable, indent)
variable = deep_copy(variable)
if Ops.is_void?(variable)
Builtins.sformat("%2%1 (void)", variable, indent)
elsif Ops.is_boolean?(variable)
Method Initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Initialize
@_mode = "normal"
@_test = "none"
arg_count = Builtins.size(WFM.Args)
arg_no = 0
Method main
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
Yast.import "LogViewCore"
@file = "/var/log/messages"
Method GetTypeFromSysfs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def GetTypeFromSysfs(dev)
sys_dir_path = Builtins.sformat("/sys/class/net/%1", dev)
sys_type_path = Builtins.sformat("%1/type", sys_dir_path)
return nil if IsEmpty(dev) || !FileUtils.Exists(sys_type_path)
Method CreateNewPortRange
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateNewPortRange(min_pr, max_pr)
if min_pr.nil? || min_pr == 0
Builtins.y2error(
"Wrong definition of the starting port '%1', it must be between 1 and 65535",
min_pr
Method SetServicesForZones
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def SetServicesForZones(services_ids, firewall_zones, new_status)
# setting for each service
Builtins.foreach(services_ids) do |service_id|
Builtins.foreach(firewall_zones) do |firewall_zone|
# zone must be known one
Method StartScanDb
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def StartScanDb
Builtins.y2milestone("Scanning RPM DB...")
if Mode.commandline
# progress message (command line mode)
Method control_file
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def control_file(source)
package = case source
when ::Integer
product = find_product(source)
return nil unless product&.product_package
Method PrepareWorkflows
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PrepareWorkflows(workflows)
workflows = deep_copy(workflows)
new_workflows = []
# Going through all workflows
Method Launch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Launch(modul)
function = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Call"], "")
argument = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Argument"], "")
Builtins.y2debug("Calling: %1 (%2)", function, argument)
Method load_file_locale
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_file_locale(patterns, file_path, language)
patterns = deep_copy(patterns)
i = 0
while Ops.less_than(i, Builtins.size(patterns))
p = Ops.get(patterns, i, "")
Method DebugBrowseHelper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DebugBrowseHelper(variable, indent)
variable = deep_copy(variable)
simple = FormatSimpleType(variable, indent)
if !simple.nil?
Builtins.y2debug("%1", simple)
Method MkTempInternal
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def MkTempInternal(template, usergroup, modes, directory)
mktemp = Builtins.sformat(
"/bin/mktemp %1 %2",
directory ? "-d" : "",
template.shellescape
Method Check4
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Check4(netmask)
return false if netmask.nil? || netmask == ""
# 255.255.240.0
s1 = "(128|192|224|240|248|252|254|255)"
Method zone_services
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def zone_services(services)
services_status = {}
services.each do |service|
service_supported = firewalld.current_service_names.include?(service)
- 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 HidePasswords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def HidePasswords(in_)
ret = ""
if in_.nil?
ret = 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 read_modules_to_load
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_modules_to_load
@modules_to_load = { MODULES_CONF_FILE => [] }
if FileUtils.Exists(MODULES_DIR)
config_files = SCR::Read(path(".target.dir"), MODULES_DIR)
- 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 CreateKey
has a Cognitive Complexity of 10 (exceeds 5 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)
- 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 RetranslateButtons
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def RetranslateButtons
textdomain "base" # Reload translations
if UI.WidgetExists(Id(:WizardDialog)) == true # NCurses wizard
UI.ChangeWidget(Id(:help), :Label, Label.HelpButton) if UI.WidgetExists(Id(:help))
ReplaceButtonBox(
- 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"