yast/yast-network

View on GitHub

Showing 255 of 255 total issues

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
Severity: Minor
Found in src/lib/y2network/udev_rule.rb - About 3 hrs to fix

    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
    Severity: Minor
    Found in src/lib/y2network/proposal_settings.rb - About 3 hrs to fix

      Method main has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def main
            Yast.import "UI"
      
            textdomain "network"
      
      
      Severity: Major
      Found in src/clients/host_auto.rb - About 3 hrs to fix

        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()
        Severity: Minor
        Found in src/modules/Lan.rb - About 3 hrs to fix

        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()
        Severity: Major
        Found in src/modules/Lan.rb - About 3 hrs to fix

          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"
          
          
          Severity: Minor
          Found in src/lib/y2network/widgets/boot_protocol.rb - About 2 hrs to fix

            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
            Severity: Minor
            Found in src/lib/y2network/autoinst/interfaces_reader.rb - About 2 hrs to fix

            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 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"]
            Severity: Minor
            Found in src/include/network/lan/cmdline.rb - About 2 hrs to fix

            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 },
            Severity: Major
            Found in src/lib/y2network/autoinst_profile/interface_section.rb - About 2 hrs to fix

              Class Routing has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Routing < Yast::Client
                    include Yast::Logger
              
                    # Constructor
                    def initialize
              Severity: Minor
              Found in src/lib/y2network/clients/routing.rb - About 2 hrs to fix

                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"
                Severity: Minor
                Found in src/lib/y2network/interface_config_builder.rb - About 2 hrs to fix

                  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)
                  
                  
                  Severity: Minor
                  Found in src/include/network/services/host.rb - About 2 hrs to fix

                  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_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?
                  Severity: Minor
                  Found in src/lib/y2network/autoinst/interfaces_reader.rb - About 2 hrs to fix

                  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"] || []
                  Severity: Minor
                  Found in src/lib/y2network/clients/auto.rb - About 2 hrs to fix

                  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)
                  Severity: Minor
                  Found in src/include/network/services/host.rb - About 2 hrs to fix

                    Class Remote has 22 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class Remote
                        include Singleton
                        include Yast::Logger
                        include Yast::I18n
                    
                    
                    Severity: Minor
                    Found in src/lib/y2remote/remote.rb - About 2 hrs to fix

                      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
                      Severity: Major
                      Found in src/lib/y2network/presenters/interface_summary.rb - About 2 hrs to fix

                        Method contents has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def contents
                                RadioButtonGroup(
                                  Id(:bootproto),
                                  VBox(
                                    Left(
                        Severity: Major
                        Found in src/lib/y2network/widgets/boot_protocol.rb - About 2 hrs to fix

                          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?
                          Severity: Minor
                          Found in src/lib/y2network/widgets/port_items.rb - About 2 hrs to fix

                          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
                          Severity: Major
                          Found in src/clients/network.rb - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language