Showing 255 of 255 total issues
File Lan.rb
has 577 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "cfa/sysctl_config"
require "network/network_autoyast"
require "network/confirm_virt_proposal"
require "network/wicked"
File routines.rb
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "shellwords"
module Yast
module NetworkRoutinesInclude
include I18n
Method HostsMainDialog
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def HostsMainDialog(standalone)
# Hosts dialog caption
caption = _("Host Configuration")
# Hosts dialog help 1/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
File dns.rb
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "ui/text_helpers"
module Yast
module NetworkServicesDnsInclude
include ::UI::TextHelpers
Method initialize_network_services_dns
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_network_services_dns(include_target)
textdomain "network"
Yast.import "CWM"
Yast.import "DNS"
Class InterfaceConfigBuilder
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class InterfaceConfigBuilder
include Yast::Logger
extend Forwardable
# Load fresh instance of interface config builder for given type.
Class LanClass
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class LanClass < Module
include ::UI::TextHelpers
include Wicked
def main
Method HostsMainDialog
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
def HostsMainDialog(standalone)
# Hosts dialog caption
caption = _("Host Configuration")
# Hosts dialog help 1/2
Method initialize_network_lan_help
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_network_lan_help(_include_target)
textdomain "network"
@help = {
"read" => # Network cards read dialog help 1/2
Method ReadHardware
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def ReadHardware(hwtype)
hardware = []
Builtins.y2debug("hwtype=%1", hwtype)
- 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 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main
Yast.import "UI"
# **
# <h3>Network configuration</h3>
Method ReadHardware
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ReadHardware(hwtype)
hardware = []
Builtins.y2debug("hwtype=%1", hwtype)
Method Read
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def Read(cache)
if cache == :cache && @initialized
Builtins.y2milestone("Using cached data")
return true
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
Method text
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def text
return "" if @name.to_s.empty?
interface = @config.interfaces.by_name(@name)
hardware = interface ? interface.hardware : nil
- 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 ControllerType
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ControllerType(hwdevice)
hwdevice = deep_copy(hwdevice)
return "modem" if Ops.get_string(hwdevice, "subclass", "") == "Modem"
return "isdn" if Ops.get_string(hwdevice, "subclass", "") == "ISDN"
return "dsl" if Ops.get_string(hwdevice, "subclass", "") == "DSL"
File routing.rb
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
require "y2network/config"
require "y2network/wicked/config_writer"
require "y2network/serializer/route_sysconfig"
Class InterfaceFile
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class InterfaceFile
# Auxiliar class to hold variables definition information
Variable = Struct.new(:name, :type, :collection?)
# @return [String] Interface name
Method Read
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Read(cache)
if cache == :cache && @initialized
Builtins.y2milestone("Using cached data")
return true
end
Method cmdline_definition
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmdline_definition
{
# Commandline help title
"help" => _("Routing Configuration"),
"id" => "routing",
Method HostDialog
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def HostDialog(id, entry)
entry = deep_copy(entry)
Builtins.y2debug("id=%1", id)
Builtins.y2debug("entry=%1", entry)