Showing 806 of 967 total issues
Method singleOptionEditPopup
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def singleOptionEditPopup(option)
option = deep_copy(option)
opt_key = Ops.get_string(option, "_cwm_key", "")
opt_id = Ops.get(option, "_cwm_id")
- 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 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
textdomain "base"
Yast.import "Arch"
Yast.import "Map"
Method InitPackageCallbacks
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def InitPackageCallbacks
SetProcessCallbacks()
SetProvideCallbacks()
File NetworkService.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "yast2/systemd/service"
require "shellwords"
module Yast
File dummy_callbacks.rb
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Packages
# Empty callbacks for package bindings. To register empty bindings in Yast::Pkg just call
# {Packages::DummyCallbacks.register}
Class MessageClass
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class MessageClass < Module
def main
textdomain "base"
end
Method ConfirmLicenses
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ConfirmLicenses
ret = true
to_install = Pkg.GetPackages(:selected, true)
licenses = Pkg.PkgGetLicensesToConfirm(to_install)
File PackageSystem.rb
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "yast2/execute"
require "shellwords"
module Yast
Method main
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
Yast.import "Label"
Yast.import "Popup"
Method Connect
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def Connect(show_continue_button)
# we already have a lock
return { "connected" => @have_lock, "aborted" => @aborted } if !@have_lock.nil?
try_again = true
- 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 SaveCurrentConfiguration
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def SaveCurrentConfiguration
LazyLoadCurrentConf()
# Removing nil entries from the configuration
new_configuration = {}
- 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 ReadServicesDefinedByRPMPackages
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ReadServicesDefinedByRPMPackages
log.info "Reading SuSEfirewall2 services from #{SERVICES_DIR}"
@services ||= {}
if !FileUtils.Exists(SERVICES_DIR) ||
Method PrintTable
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PrintTable(header, content)
header = deep_copy(header)
content = deep_copy(content)
aligns = []
widths = []
Method UseUnsignedItem
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def UseUnsignedItem(item_type, item_name, dont_show_dialog_ident, repository)
Builtins.y2milestone(
"UseUnsignedItem: type: %1, name: %2, dontshowid: %3, repo: %4",
item_type,
item_name,
Method RemoveAllowedPortsOrServices
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def RemoveAllowedPortsOrServices(remove_ports, protocol, zone, check_for_aliases)
remove_ports = deep_copy(remove_ports)
if Ops.less_than(Builtins.size(remove_ports), 1)
Builtins.y2warning(
"Undefined list of %1 services/ports for 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 has_attributes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def has_attributes(*attributes, scope: nil, cache: false) # rubocop:disable Naming/PredicateName
scope_method = scope ? "#{scope}_" : ""
enable_modifications_cache if cache
define_method "attributes" do
attributes
- 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 UpdateWorkflows
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def UpdateWorkflows(workflows, prod_name, domain)
workflows = deep_copy(workflows)
Builtins.foreach(workflows) do |workflow|
stage = Ops.get_string(workflow, "stage", "")
mode = Ops.get_string(workflow, "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 popupLayoutInternalTypeWithLabel
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def popupLayoutInternalTypeWithLabel(headline, message, button_box, label, richtext, width, height)
button_box = deep_copy(button_box)
rt = VWeight(
1,
VBox(
- 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 CreateOpenFirewallWidget
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateOpenFirewallWidget(settings)
settings = deep_copy(settings)
services = adapt_settings_services!(settings)
Method OpenMenu
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def OpenMenu
# check if user is root (#246015)
output = Convert.to_map(
SCR.Execute(path(".target.bash_output"), "/usr/bin/id --user")
)