Showing 806 of 967 total issues
Method WriteConfiguration
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def WriteConfiguration
# just disabled
return true if !SuSEFirewallIsInstalled()
return false if !GetModified()
- 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 TableHandle
has a Cognitive Complexity of 18 (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")
attrib = Ops.get_map(descr, "_cwm_attrib", {})
- 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 ReplaceProposalModule
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def ReplaceProposalModule(proposal, old, new)
proposal = deep_copy(proposal)
new = deep_copy(new)
found = false
- 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 ConvertBackAndForth
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def ConvertBackAndForth(strings_in, to_punycode)
# Some (or maybe all) strings needn't be cached
not_cached = []
# Check the cache for already entered strings
- 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 Initrd.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "shellwords"
module Yast
class InitrdClass < Module
Method Write
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Write
Read() if !(@was_read || Mode.config)
Update() if Mode.update
Builtins.y2milestone(
"Initrd::Write called, changed: %1, list: %2",
Method GetSlideList
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def GetSlideList(lang)
slide_list = nil
txt_path = Builtins.sformat("%1/txt/%2", @slide_base_path, lang)
if FileUtils.Exists(txt_path)
Class Url
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Url < Base
class << self
# Enable downloading release notes
#
# This method is intended to be used during testing.
Class ModeClass
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ModeClass < Module
def main
textdomain "base"
# Current mode
Class FileUtilsClass
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class FileUtilsClass < Module
def main
textdomain "base"
Yast.import "Popup"
Yast.import "String"
Method WriteConfiguration
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def WriteConfiguration
# just disabled
return true if !SuSEFirewallIsInstalled()
# Progress only for normal configuration and command line
Method ReadFile
has 58 lines of code (exceeds 25 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))
Method ItemSignedWithPublicSignature
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ItemSignedWithPublicSignature(item_type, item_name, key)
key = deep_copy(key)
description_text = Builtins.sformat(
if item_type == :package
# popup question, %1 stands for the package name, %2 for the key ID, %3 for the key name
Method ParseSingleDesktopFile
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ParseSingleDesktopFile(file)
filename = Builtins.sformat("%1/%2.desktop", Directory.desktopdir, file)
# Do not use .yast2.desktop.v.$filename, because ini-agent reads
# all the desktop files anyway which is wasteful for setting one icon.
# The config is adapted from .yast2.desktop.
Method Write
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def Write
Read() if !(@was_read || Mode.config)
Update() if Mode.update
Builtins.y2milestone(
"Initrd::Write called, changed: %1, list: %2",
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def PackageDialog(packages, install, message)
packages = deep_copy(packages)
Builtins.y2debug("Asking for packages: %1", packages)
packs = Builtins.filter(packages) do |package|
install ? !Installed(package) : Installed(package)
- 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 IsValidPortRange
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def IsValidPortRange(port_range)
# not a port range
if !IsPortRange(port_range)
warning = Builtins.sformat("Not a port-range %1", port_range)
Builtins.y2milestone(warning) if ReportOnlyOnce(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
Method ReadConfig
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ReadConfig(config)
Builtins.y2debug("config=%1", config)
return {} if config.nil?
ret = {}
- 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 control_file
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def control_file(source)
package = case source
when ::Integer
product = find_product(source)
return nil unless product&.product_package
- 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 load_file_locale
has a Cognitive Complexity of 17 (exceeds 5 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, "")
- 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"