rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method log_and_print has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def log_and_print(msg, level: :debug)
          case level
          when :debug
            vprint_status(msg) if respond_to?(:vprint_status)
            dlog(msg)
Severity: Minor
Found in lib/msf/core/post/windows/task_scheduler.rb - About 55 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 execute_script has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def execute_script(script, greedy_kill = false)
          @session_pids ||= []
          running_pids = greedy_kill ? get_ps_pids : []
          open_channels = []
          # Execute using -EncodedCommand
Severity: Minor
Found in lib/msf/core/post/windows/powershell.rb - About 55 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 query has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def query(filter, max_results, fields, domain = nil)
          domain ||= datastore['DOMAIN']
          domain ||= get_domain

          if domain.blank?
Severity: Minor
Found in lib/msf/core/post/windows/ldap.rb - About 55 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 invalidate_login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def invalidate_login(opts)
    begin
      add_opts_workspace(opts)
      # Search for an existing Metasploit::Credential::Core object. It requires specific attributes.
      core_opts = {}
Severity: Minor
Found in lib/metasploit/framework/data_service/proxy/login_data_proxy.rb - About 55 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 start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def start(opts)
    @mutex.synchronize do

      return if @running

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 process_logins has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def process_logins(opts = {})
          self.queued_results ||= []
          self.queued_credentials ||= []

          unless opts[:final] || self.queued_credentials.length > queue_size
Severity: Minor
Found in lib/metasploit/framework/login_scanner/snmp.rb - About 55 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 live_compile? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def live_compile?
    return false unless %w{ Auto True }.include?(datastore['COMPILE'])

    if datastore['COMPILER'] == 'gcc' && has_gcc?
      vprint_good 'gcc is installed'
Severity: Minor
Found in lib/msf/core/post/linux/compile.rb - About 55 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 try_login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def try_login(credential)
          begin
            res = try_credential(credential)

            if res && res.code == 302
Severity: Minor
Found in lib/metasploit/framework/login_scanner/zabbix.rb - About 55 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 attempt_login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def attempt_login(credential)
          result_options = {
            credential: credential,
            status: Metasploit::Model::Login::Status::INCORRECT,
            host: host,
Severity: Minor
Found in lib/metasploit/framework/login_scanner/redis.rb - About 55 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 attempt_login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def attempt_login(credential)
          result_options = {
              credential: credential,
              host: host,
              port: port,
Severity: Minor
Found in lib/metasploit/framework/login_scanner/vnc.rb - About 55 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 Exec has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
Open

            public override void Exec(int oldLen)
            {
                try {
                    // generate JIT-code for Payload()
                    Payload();
Severity: Minor
Found in external/source/exploits/cve-2013-0074/SilverApp1/MainPage.xaml.cs - About 55 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

Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, command='', username='', password=None, domain='', hashes=None, share=None,
Severity: Major
Found in modules/auxiliary/scanner/smb/impacket/wmiexec.py - About 50 mins to fix

    Method defineAndCreate has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static void defineAndCreate(final ConfusingClassLoader cl, final String name[], final byte data[][], final String hexdata, final String jar, final String lhost, final int lport) {

      Method scheduleme has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def scheduleme(session,schtype,cmd,tmmod,cmdopt,username,password)
      Severity: Major
      Found in scripts/meterpreter/scheduleme.rb - About 50 mins to fix

        Method connect has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=0)
        Severity: Major
        Found in lib/rbmysql.rb - About 50 mins to fix

          Method make_ntlmssp_secblob_auth has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.make_ntlmssp_secblob_auth(domain, name, user, lm, ntlm, enc_session_key, flags = 0x080201)
          Severity: Major
          Found in lib/rex/proto/ntlm/utils.rb - About 50 mins to fix

            Method make_ntlmssp_blob_auth has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def self.make_ntlmssp_blob_auth(domain, name, user, lm, ntlm, enc_session_key, flags = 0x080201)
            Severity: Major
            Found in lib/rex/proto/ntlm/utils.rb - About 50 mins to fix

              Method encode_ldap_response has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def encode_ldap_response(msgid, code, dn, msg, tag, context_data = nil, context_code = nil)
              Severity: Major
              Found in lib/rex/proto/ldap/server.rb - About 50 mins to fix

                Method process_type1_message has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def self.process_type1_message(message, nonce = "\x11\x22\x33\x44\x55\x66\x77\x88", win_domain = 'DOMAIN',
                          win_name = 'SERVER', dns_name = 'server', dns_domain = 'example.com', downgrade = true)
                Severity: Major
                Found in lib/rex/proto/ntlm/message.rb - About 50 mins to fix

                  Method create_pkt has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def create_pkt(src_call, dst_call, tstamp, out_seq, inp_seq, itype, data)
                  Severity: Major
                  Found in lib/rex/proto/iax2/client.rb - About 50 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language