Showing 967 of 967 total issues
Method TableHandle
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
def TableHandle(descr, key, event_descr)
descr = deep_copy(descr)
event_descr = deep_copy(event_descr)
event_id = Ops.get(event_descr, "ID")
UI.SetFocus(Id(:_tp_table))
- 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 FlattenServices
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
def FlattenServices(old_list, protocol)
old_list = deep_copy(old_list)
if !Builtins.contains(["TCP", "UDP"], protocol)
message = Builtins.sformat(
"Protocol %1 doesn't support port ranges, skipping...",
- 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 MediaChange
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
def MediaChange(error_code, error, url, product, current, current_label, wanted, wanted_label, double_sided, devices, current_device)
devices = deep_copy(devices)
if @autorefreshing && @autorefreshing_aborted
Builtins.y2milestone("Refresh aborted")
return "C"
File susefirewall.rb
has 629 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
# Factory for construction of appropriate firewall object based on
# desired backend.
Method ProposalSummary
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
def ProposalSummary
# output: $[ "output" : "HTML Proposal", "warning" : "HTML Warning" ];
output = ""
warning = ""
- 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
File PackagesUI.rb
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "cgi"
require "packages/commit_result"
require "packages/update_messages_view"
Class PopupClass
has 68 methods (exceeds 20 allowed). Consider refactoring. Open
class PopupClass < Module
def main
Yast.import "UI"
textdomain "base"
File Progress.rb
has 580 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class ProgressClass < Module
include Yast::Logger
File CWMTsigKeys.rb
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "shellwords"
module Yast
class CWMTsigKeysClass < Module
Class SuSEFirewalldClass
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
class SuSEFirewalldClass < SuSEFirewallClass
require "set"
attr_reader :special_all_interface_zone
# Valid attributes for firewalld zones
Method RunFrom
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
def RunFrom(from, allow_back)
former_result = :next
final_result = nil
@current_step = from # current module
File CWMServiceStart.rb
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
# Routines for service start widget handling.
#
Method initialize_hwinfo_classnames
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_hwinfo_classnames(_include_target)
textdomain "base"
# Class names collected
@ClassNames = {
Class NetworkInterfacesClass
has 58 methods (exceeds 20 allowed). Consider refactoring. Open
class NetworkInterfacesClass < Module
attr_reader :Devices
include Logger
Method Handle
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. 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 DonePackage
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def DonePackage(error, reason)
# remove invalid characters (bnc#876459)
if !reason.valid_encoding?
reason.encode!("UTF-16", undef: :replace, invalid: :replace, replace: "?")
reason.encode!("UTF-8")
- 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 FlattenServices
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
def FlattenServices(old_list, protocol)
old_list = deep_copy(old_list)
if !Builtins.contains(["TCP", "UDP"], protocol)
message = Builtins.sformat(
"Protocol %1 doesn't support port ranges, skipping...",
Method AddWizardSteps
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def AddWizardSteps(stagemode)
stagemode = deep_copy(stagemode)
debug_workflow = ProductFeatures.GetBooleanFeature(
"globals",
"debug_workflow"
- 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
File SuSEFirewallProposal.rb
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class SuSEFirewallProposalClass < Module
include Yast::Logger
Class SlideShowClass
has 53 methods (exceeds 20 allowed). Consider refactoring. Open
class SlideShowClass < Module
include Yast::Logger
def main
Yast.import "UI"