rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method getMethod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

   private Method getMethod(Class class1, String s, boolean flag)
  {
    try {
      Method[] amethod = (Method[])Introspector.elementFromComplex(class1, "declaredMethods");
      Method[] amethod1 = amethod;
Severity: Minor
Found in external/source/exploits/cve-2013-0431/Exploit.java - 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

Function get_ad_domain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_ad_domain(rhost, rport, user_agent):
    """Retrieve the NTLM domain out of a specific challenge/response"""
    domain_urls = ['aspnet_client', 'Autodiscover', 'ecp', 'EWS', 'OAB',
                   'Microsoft-Server-ActiveSync', 'PowerShell', 'rpc']
    headers = {'Authorization': 'NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==',
Severity: Minor
Found in modules/auxiliary/scanner/http/rdp_web_login.py - 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

Function locate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def locate(src_file, dir='./src/'):
    for root, dirs, files in os.walk(dir):
        for name in files:
            if src_file == name:
                return root
Severity: Minor
Found in external/source/shellcode/windows/x86/build.py - 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

Function find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

Sprayer.prototype.find = function() {
    var k = 0;

    while(k < this.nrArrays - 1) {
        for(var i = 0; i < 0x55-1; i++){
Severity: Minor
Found in data/exploits/edb-35948/js/sprayer.js - 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

Function clean has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def clean(dir='./bin/'):
    for root, dirs, files in os.walk(dir):
        for name in files:
            if name[-4:] == '.bin':
                os.remove(os.path.join(root, name))
Severity: Minor
Found in external/source/shellcode/windows/x64/build.py - 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

Function locate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def locate(src_file, dir='./src/'):
    for root, dirs, files in os.walk(dir):
        for name in files:
            if src_file == name:
                return root
Severity: Minor
Found in external/source/shellcode/windows/x64/build.py - 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

Method aggregator_login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def aggregator_login
        if !((@host && !@host.empty?) && (@port && !@port.empty? && @port.to_i > 0))
          usage_connect
          return
        end
Severity: Minor
Found in plugins/aggregator.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

Method cmd_nessus_admin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_nessus_admin(*args)
        while (arg = args.shift)
          case arg
          when '-h', '--help'
            print_status('nessus_admin')
Severity: Minor
Found in plugins/nessus.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

Method cmd_nessus_report_hosts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_nessus_report_hosts(*args)
        search_term = nil
        scan_id = nil
        while (arg = args.shift)
          case arg
Severity: Minor
Found in plugins/nessus.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

Method cmd_openvas_task_pause has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_task_pause(*args)
        return unless openvas?

        if args?(args)
          begin
Severity: Minor
Found in plugins/openvas.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

Method cmd_openvas_report_download has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_report_download(*args)
        return unless openvas?

        if args?(args, 4)
          begin
Severity: Minor
Found in plugins/openvas.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

Method cmd_nessus_report_vulns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_nessus_report_vulns(*args)
        search_term = nil
        scan_id = nil
        while (arg = args.shift)
          case arg
Severity: Minor
Found in plugins/nessus.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

Method cmd_nessus_scan_pause_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_nessus_scan_pause_all(*args)
        scan_ids = Array.new
        if args[0] == '-h'
          print_status('nessus_scan_pause_all')
          print_status('Example:> nessus_scan_pause_all')
Severity: Minor
Found in plugins/nessus.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

Method cmd_openvas_target_create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_target_create(*args)
        return unless openvas?

        if args?(args, 3)
          begin
Severity: Minor
Found in plugins/openvas.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

Method cmd_openvas_debug has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_debug(*args)
        return unless openvas?

        if args?(args)
          begin
Severity: Minor
Found in plugins/openvas.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

Method cmd_openvas_task_resume_or_start has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_task_resume_or_start(*args)
        return unless openvas?

        if args?(args)
          begin
Severity: Minor
Found in plugins/openvas.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

Method collect_keystrokes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def collect_keystrokes(sid)
        return unless config[:keystrokes]

        sess = framework.sessions[sid]
        unless state[sid][:keyscan]
Severity: Minor
Found in plugins/beholder.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

Method cmd_aggregator_session_forward has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_aggregator_session_forward(*args)
        return if !aggregator_verify

        remote_id = nil
        case args.length
Severity: Minor
Found in plugins/aggregator.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

Method cmd_nessus_user_add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_nessus_user_add(*args)
        if args[0] == '-h'
          print_status('nessus_user_add <username> <password> <permissions> <type>')
          print_status('Permissions are 32, 64, and 128')
          print_status('Type can be either local or LDAP')
Severity: Minor
Found in plugins/nessus.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

Method cmd_openvas_target_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def cmd_openvas_target_delete(*args)
        return unless openvas?

        if args?(args)
          begin
Severity: Minor
Found in plugins/openvas.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