Showing 806 of 967 total issues
Method SetServicesForZones
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def SetServicesForZones(services_ids, firewall_zones, new_status)
Yast.import "SuSEFirewallServices"
services_ids = deep_copy(services_ids)
zones = deep_copy(firewall_zones)
- 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 SetNeededPortsAndProtocols
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def SetNeededPortsAndProtocols(service, store_definition)
if !IsKnownService(service)
log.error "Service #{service} is unknown"
raise(
SuSEFirewalServiceNotFound,
- 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 PackageDialog
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def PackageDialog(packages, install, message)
log.info "Asking for packages: #{packages}"
packs = Builtins.filter(packages) do |package|
install ? !Installed(package) : Installed(package)
end
- 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 ReadFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def ReadFile(file, pathname)
Builtins.y2milestone("path=%1", pathname)
lines = []
if Ops.greater_than(SCR.Read(path(".target.size"), pathname), 0)
value = Convert.to_string(SCR.Read(path(".target.string"), pathname))
- 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 Detection
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Detection(class_, icon_name)
Builtins.y2warning(-1, "Parameter 'icon_name' is deprecated.") if !icon_name.nil?
return true if Linuxrc.manual != true
Method ErrorScanDb
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ErrorScanDb(error, description)
Builtins.y2error(
"ErrorScanDb callback: error: %1, description: %2",
error,
description
Method Summary
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Summary
summary = ""
# translators: summary header for messages generated through autoinstallation
summary = Summary.AddHeader(summary, _("Messages"))
summary = Summary.OpenList(summary)
File FileUtils.rb
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "shellwords"
module Yast
class FileUtilsClass < Module
Method Start
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Start(widget, data)
widget = deep_copy(widget)
data = deep_copy(data)
if !@id.nil?
SCR.Execute(path(".process.release"), @id)
Method CreateWidget
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateWidget(settings)
settings = deep_copy(settings)
tab_order = Ops.get_list(settings, "tab_order", [])
tabs = Ops.get_map(settings, "tabs", {})
initial_tab = Ops.get_string(settings, "initial_tab", "")
Class Firewalld
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Firewalld
include Singleton
include Yast::Logger
extend Forwardable
extend Relations
Class AbstractWidget
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class AbstractWidget
include Yast::UIShortcuts
include Yast::I18n
include Yast::Logger
Class CWMTabClass
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class CWMTabClass < Module
def main
Yast.import "UI"
textdomain "base"
Class CompoundService
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class CompoundService
include Yast::Logger
# Managed services
#
Class IPClass
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class IPClass < Module
include Yast::Logger
def main
textdomain "base"
Method SetNeededPortsAndProtocols
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def SetNeededPortsAndProtocols(service, store_definition)
if !IsKnownService(service)
log.error "Service #{service} is unknown"
raise(
SuSEFirewalServiceNotFound,
Method RunPatternSelector
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def RunPatternSelector(enable_back: false, cancel_label: Label.CancelButton)
Builtins.y2milestone("Running pattern selection dialog")
if !UI.HasSpecialWidget(:PatternSelector) ||
UI.WizardCommand(term(:Ping)) != true
Method board_compatible
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def board_compatible
if @_board_compatible.nil?
@_checkgeneration = ""
systemProbe = Convert.convert(
SCR.Read(path(".probe.system")),
Method Import
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def Import(import_settings)
Read()
import_settings = deep_copy(import_settings || {})
# Sanitize it
import_settings.each_key do |k|
- 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 InstallationSummary
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def InstallationSummary(summary)
ret = ""
if Builtins.haskey(summary, "success")
ret = HTML.Para(
- 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"