Showing 806 of 967 total issues
Method PrintActionHelp
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def PrintActionHelp(action)
# lookup action in actions
command = Ops.get_map(@allcommands, ["actions", action], {})
# translators: the command does not provide any help
commandhelp = Ops.get(command, "help")
- 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 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
textdomain "base"
Method PrintGeneralHelp
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PrintGeneralHelp
# display custom defined help instead of generic one
if Builtins.haskey(@modulecommands, "customhelp")
Print(Ops.get_string(@modulecommands, "customhelp", ""))
return
File LogView.rb
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class LogViewClass < Module
def main
Class SuSEFirewallClass
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class SuSEFirewallClass < Module
# @return [String] the systemd service name: "firewalld" or "SuSEfirewall2"
attr_reader :firewall_service
Yast.import "Mode"
Method PrintActionHelp
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
def PrintActionHelp(action)
# lookup action in actions
command = Ops.get_map(@allcommands, ["actions", action], {})
# translators: the command does not provide any help
commandhelp = Ops.get(command, "help")
Method Load
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Load(modulename, moduleargs, vendorname, devicename, ask_before_loading, with_modprobe)
if modulename != "" &&
# there is no reason for checking initrd, if I need the module to get loaded, I just need to
# check if it isn't already loaded
# && (!contains (Initrd::ListModules (), modulename))
Class NetworkServiceClass
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class NetworkServiceClass < Module
# return [String, nil] current network backend identification, nil is valid value for "no service selected / running"
attr_accessor :current_name
# return [String, nil] new network backend identification, nil is valid value for "no service selected / running"
attr_writer :cached_name
Method DoneProvide
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DoneProvide(error, reason, name)
Builtins.y2milestone("DoneProvide: %1, %2, %3", error, reason, name)
if @_provide_popup
UI.CloseDialog
Method Build
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Build(tokens)
tokens = deep_copy(tokens)
url = ""
userpass = ""
Method AddWizardSteps
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
def AddWizardSteps(stagemode)
stagemode = deep_copy(stagemode)
debug_workflow = ProductFeatures.GetBooleanFeature(
"globals",
"debug_workflow"
Class ReportClass
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class ReportClass < Module
include Yast::Logger
def main
textdomain "base"
Method has_many
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def has_many(*relations, scope: nil, cache: false) # rubocop:disable Naming/PredicateName
scope = "#{scope}_" if scope
enable_modifications_cache if cache
define_method "relations" do
- 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 ProgressDownload
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def ProgressDownload(percent, bps_avg, bps_current)
if @autorefreshing && @autorefreshing_aborted
Builtins.y2milestone("Refresh aborted")
return false
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
File susefirewall2services.rb
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "network/susefirewallservices"
module Yast
# Global Definition of Firewall Services
Class Api
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Api
# This module contains specific API methods for handling zones
# configuration.
module Zones
# @return [Array<String>] List of firewall zones
Method New
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def New(window_title, progress_title, length, stg, tits, help_text)
stg = deep_copy(stg)
tits = deep_copy(tits)
return if !@visible
Method ProcessSystemCommands
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def ProcessSystemCommands(command)
command = deep_copy(command)
# handle help for specific command
# this needs to be before general help, so "help help" works
if Ops.get(command, ["options", "help"])
- 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 ConvertToServicesDefinedByPackages
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ConvertToServicesDefinedByPackages
return if @already_converted
if FileUtils.Exists(@converted_to_services_dbp_file)
@already_converted = true
Class ProgressClass
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class ProgressClass < Module
include Yast::Logger
def main
Yast.import "UI"