rapid7/nexpose-client

View on GitHub

Showing 112 of 173 total issues

Method set_snmpv3_service has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def set_snmpv3_service(authentication_type = Credential::AuthenticationType::NOAUTH, username = nil, password = nil, privacy_type = Credential::PrivacyType::NOPRIV, privacy_password = nil)
Severity: Minor
Found in lib/nexpose/credential_helper.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def initialize(id, address, site_id, risk_factor = 1.0, risk_score = 0.0)
    Severity: Minor
    Found in lib/nexpose/device.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def initialize(name, baseURL, soft403Pattern, id = -1, enabled = true)
      Severity: Minor
      Found in lib/nexpose/web_credentials.rb - About 35 mins to fix

        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0)
        Severity: Minor
        Found in lib/nexpose/alert.rb - About 35 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def initialize(live, dead, filtered, unresolved, other)
          Severity: Minor
          Found in lib/nexpose/scan.rb - About 35 mins to fix

            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def initialize(name, value, type, dynamic, checked)
            Severity: Minor
            Found in lib/nexpose/web_credentials.rb - About 35 mins to fix

              Method execute has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def self.execute(url, req, api_version = '1.1', options = {}, trust_store = nil)
              Severity: Minor
              Found in lib/nexpose/api_request.rb - About 35 mins to fix

                Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def initialize(id, name, description = nil, risk_factor = 1.0, risk_score = 0.0)
                Severity: Minor
                Found in lib/nexpose/site.rb - About 35 mins to fix

                  Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def initialize(id, name, desc, risk, dynamic)
                  Severity: Minor
                  Found in lib/nexpose/group.rb - About 35 mins to fix

                    Method set_ssh_service has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def set_ssh_service(username = nil, password = nil, elevation_type = nil, elevation_user = nil, elevation_password = nil)
                    Severity: Minor
                    Found in lib/nexpose/credential_helper.rb - About 35 mins to fix

                      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def initialize(type, interval, start, enabled = true, scan_template_id = nil)
                      Severity: Minor
                      Found in lib/nexpose/common.rb - About 35 mins to fix

                        Method post has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def post(nsc, uri, payload = nil, content_type = CONTENT_TYPE::XML, timeout = nil)
                        Severity: Minor
                        Found in lib/nexpose/ajax.rb - About 35 mins to fix

                          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def initialize(id, config_id, status, generated_on, uri)
                          Severity: Minor
                          Found in lib/nexpose/report.rb - About 35 mins to fix

                            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def initialize(name, full_name, id = -1, enabled = true, scope = Scope::SILO)
                            Severity: Minor
                            Found in lib/nexpose/role.rb - About 35 mins to fix

                              Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def initialize(template_id, format, site_id = nil, owner = nil, time_zone = nil)
                              Severity: Minor
                              Found in lib/nexpose/report.rb - About 35 mins to fix

                                Method load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def self.load(connection, id)
                                      xml = '<EngineConfigRequest session-id="' + connection.session_id + '"'
                                      xml << %( engine-id="#{id}")
                                      xml << ' />'
                                      r = connection.execute(xml, '1.2')
                                Severity: Minor
                                Found in lib/nexpose/engine.rb - About 35 mins 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def self.parse(json)
                                      color         = json['attributes'].find { |attr| attr['tag_attribute_name'] == 'COLOR' }
                                      color         = color['tag_attribute_value'] if color
                                      source        = json['attributes'].find { |attr| attr['tag_attribute_name'] == 'SOURCE' }
                                      source        = source['tag_attribute_value'] if source
                                Severity: Minor
                                Found in lib/nexpose/tag.rb - About 35 mins 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 db_maintenance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def db_maintenance(clean_up = false, compress = false, reindex = false)
                                      return unless compress || clean_up || reindex
                                      parameters = { 'cmd' => 'startMaintenance', 'targetTask' => 'dbMaintenance' }
                                      parameters['cleanup']  = 1 if clean_up
                                      parameters['compress'] = 1 if compress
                                Severity: Minor
                                Found in lib/nexpose/maint.rb - About 35 mins 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 include? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def include?(single_ip)
                                      return false unless single_ip.respond_to? :from
                                      from  = IPAddr.new(@from)
                                      to    = @to.nil? ? from : IPAddr.new(@to)
                                      other = IPAddr.new(single_ip)
                                Severity: Minor
                                Found in lib/nexpose/site.rb - About 35 mins 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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def validate
                                      raise ArgumentError.new('Name is a required attribute.') unless @name
                                      raise ArgumentError.new('Scan filter is a required attribute.') unless @scan_filter
                                      raise ArgumentError.new('Vuln filter is a required attribute.') unless @vuln_filter
                                    end
                                Severity: Minor
                                Found in lib/nexpose/alert.rb - About 25 mins 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

                                Severity
                                Category
                                Status
                                Source
                                Language