Showing 806 of 967 total issues
Method DonePackage
has 85 lines of code (exceeds 25 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")
Method singleOptionEditPopup
has 85 lines of code (exceeds 25 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")
File Arch.rb
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
# Representing architecture information yast have.
#
Method CreateAutoStartWidget
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def CreateAutoStartWidget(settings)
settings = deep_copy(settings)
start_auto_button = Ops.get_locale(
settings,
Method RemoveAllowedPortsOrServices
has 83 lines of code (exceeds 25 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",
Method DoInstallAndRemoveInt
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def DoInstallAndRemoveInt(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
return false if !PackageLock.Check
Method startController
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def startController(controller)
controller = deep_copy(controller)
# check module information
# skip controller if no module info available
- 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 DoInstallAndRemoveInt
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def DoInstallAndRemoveInt(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
Builtins.y2debug("toinstall: %1, toremove: %2", toinstall, toremove)
return false if !PackageLock.Check
- 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 Build
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def Build(tokens)
tokens = deep_copy(tokens)
url = ""
userpass = ""
- 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
Class CWMServiceStartClass
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class CWMServiceStartClass < Module
def main
Yast.import "UI"
textdomain "base"
Class ServiceClass
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class ServiceClass < Module
include Yast::Logger
private
File Desktop.rb
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class DesktopClass < Module
def main
Method InterfacesValidate
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def InterfacesValidate(_widget, _key, _event)
trusted_zone = firewalld.find_zone("trusted")
ifaces = Convert.convert(
UI.QueryWidget(Id("_cwm_interface_list"), :SelectedItems),
Method ImportGPGKeyIntoTrustedDialog
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ImportGPGKeyIntoTrustedDialog(key, repository)
key = deep_copy(key)
# additional Richtext (HTML) warning text (kind of help), 1/2
warning_text = _(
"<p>The owner of the key may distribute updates,\n" \
Method Parse
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Parse(url)
Builtins.y2debug("url=%1", url)
# We don't parse empty URLs
return {} if url.nil? || Ops.less_than(Builtins.size(url), 1)
Method Read
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Read(values_to_parse)
values_to_parse = deep_copy(values_to_parse)
extract_desktop_filename = lambda do |fullpath|
path_components = Builtins.splitstring(fullpath, "/")
filename = Ops.get(
Method Run
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def Run(aliases, sequence)
aliases = deep_copy(aliases)
sequence = deep_copy(sequence)
# Check aliases and sequence correctness
return Convert.to_symbol(WS_error("CHECK FAILED")) if @docheck && WS_check(aliases, sequence) != 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 Start
has a Cognitive Complexity of 22 (exceeds 5 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)
- 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 WriteConfiguration
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def WriteConfiguration
# just disabled
return true if !SuSEFirewallIsInstalled()
# Progress only for normal configuration and command line
- 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 ErrorScanDb
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def ErrorScanDb(error, description)
Builtins.y2error(
"ErrorScanDb callback: error: %1, description: %2",
error,
description
- 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"