Showing 218 of 255 total issues
Class ProposalSettings
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalSettings
include Yast::Logger
include Yast::I18n
# @return [Symbol] network service to be used after the installation (:wicked, :network_manager
Class UdevRule
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class UdevRule
class << self
# Returns all persistent network rules
#
# @return [Array<UdevRule>] Persistent network rules
Method main
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
textdomain "network"
Method Write
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def Write(gui: true, apply_config: !write_only)
log.info("Writing configuration")
# Query modified flag in all components
if !Modified()
- 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 Write
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Write(gui: true, apply_config: !write_only)
log.info("Writing configuration")
# Query modified flag in all components
if !Modified()
File boot_protocol.rb
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "cwm/custom_widget"
require "y2network/boot_protocol"
Method update_builder_from_options!
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def update_builder_from_options!(builder, options)
case builder.type.short_name
when "bond"
# change only if user specify it
builder.ports = options["bond_ports"].split if options["bond_ports"]
- 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_generic
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def load_generic(config, interface_section)
if interface_section.bootproto.to_s.empty?
issues_list.add(::Installation::AutoinstIssues::MissingValue,
interface_section, :bootproto)
else
- 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 attributes
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.attributes
[
{ name: :bootproto },
{ name: :broadcast },
{ name: :device },
Class Routing
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Routing < Yast::Client
include Yast::Logger
# Constructor
def initialize
File interface_config_builder.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "forwardable"
require "y2network/connection_config"
require "y2network/hwinfo"
Method load_wireless
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def load_wireless(config, interface_section)
if !interface_section.wireless_mode.to_s.empty?
config.mode = interface_section.wireless_mode
end
config.ap = interface_section.wireless_ap if !interface_section.wireless_ap.to_s.empty?
- 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 HostDialog
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def HostDialog(id, entry)
entry = deep_copy(entry)
Builtins.y2debug("id=%1", id)
Builtins.y2debug("entry=%1", entry)
- 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 adapt_for_autoyast
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def adapt_for_autoyast(settings)
settings = deep_copy(settings)
interfaces = settings["interfaces"] || []
log.info("interfaces: #{interfaces.inspect}")
net_udev = settings["net-udev"] || []
- 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 host.rb
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Yast
module NetworkServicesHostInclude
include Logger
def initialize_network_services_host(include_target)
Class Remote
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Remote
include Singleton
include Yast::Logger
include Yast::I18n
Method text
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def text
return "" if @name.to_s.empty?
interface = @config.interfaces.by_name(@name)
hardware = interface ? interface.hardware : nil
Method contents
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def contents
RadioButtonGroup(
Id(:bootproto),
VBox(
Left(
Method port_items_from
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def port_items_from(add_ifaces, included_ifaces, config)
raise ArgumentError, "list of devices for adding cannot be nil" if add_ifaces.nil?
raise ArgumentError, "some interfaces must be selected" if included_ifaces.nil?
if add_ifaces.empty? && !included_ifaces.empty?
- 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 startDialog
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def startDialog
# Network dialog caption
caption = _("Network Configuration")
# Network dialog help