rapid7/metasploit-framework

View on GitHub
modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Method setup_popchain has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def setup_popchain(random_param)
    print_status("Trying to login through the REST API...")

    user = datastore['USERNAME']
    pass = datastore['PASSWORD']
Severity: Minor
Found in modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb - About 1 hr to fix

    Method setup_popchain has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def setup_popchain(random_param)
        print_status("Trying to login through the REST API...")
    
        user = datastore['USERNAME']
        pass = datastore['PASSWORD']
    Severity: Minor
    Found in modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb - About 1 hr 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 do_login has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def do_login
        print_status("Retrieving the CSRF token for login...")
    
        res = send_request_cgi({
          'method'    => 'GET',
    Severity: Minor
    Found in modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb - About 1 hr 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 initialize has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def initialize(info = {})
        super(update_info(info,
          'Name'           => 'Tuleap 9.6 Second-Order PHP Object Injection',
          'Description'    => %q{
            This module exploits a Second-Order PHP Object Injection vulnerability in Tuleap <= 9.6 which
    Severity: Minor
    Found in modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb - About 1 hr to fix

      Method do_login has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def do_login
          print_status("Retrieving the CSRF token for login...")
      
          res = send_request_cgi({
            'method'    => 'GET',
      Severity: Minor
      Found in modules/exploits/unix/webapp/tuleap_rest_unserialize_exec.rb - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status