rapid7/metasploit-framework

View on GitHub
modules/auxiliary/fuzzers/ftp/client_ftp.rb

Summary

Maintainability
F
4 days
Test Coverage

Method on_client_data has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def on_client_data(c)
    # get the client data
    data = c.get_once
    return if not data
    # split data into command and arguments
Severity: Major
Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 6 hrs to fix

    Method on_client_data has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      def on_client_data(c)
        # get the client data
        data = c.get_once
        return if not data
        # split data into command and arguments
    Severity: Minor
    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 4 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 client_ftp.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class MetasploitModule < Msf::Auxiliary
      include Exploit::Remote::TcpServer
    
      def initialize()
        super(
    Severity: Minor
    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 4 hrs to fix

      Method send_response has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def send_response(c,arg,cmd,code,msg)
          if arg.length > 40
            showarg = arg[0,40] + "..."
          else
            showarg = arg
      Severity: Minor
      Found in modules/auxiliary/fuzzers/ftp/client_ftp.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 send_response has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def send_response(c,arg,cmd,code,msg)
          if arg.length > 40
            showarg = arg[0,40] + "..."
          else
            showarg = arg
      Severity: Minor
      Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 1 hr to fix

        Method fuzz_this_cmd has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def fuzz_this_cmd(cmd)
            @fuzzcommands = datastore['FUZZCMDS'].split(",")
            fuzzme = 0
            @fuzzcommands.each do |thiscmd|
              if ((cmd.upcase == thiscmd.upcase) || (thiscmd=="*")) && (fuzzme==0)
        Severity: Minor
        Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 45 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 send_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def send_response(c,arg,cmd,code,msg)
        Severity: Minor
        Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

                return
          Severity: Major
          Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return
            Severity: Major
            Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return
              Severity: Major
              Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return
                Severity: Major
                Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return
                  Severity: Major
                  Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return
                    Severity: Major
                    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return
                      Severity: Major
                      Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return
                        Severity: Major
                        Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                return
                          Severity: Major
                          Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                  return
                            Severity: Major
                            Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                    return
                              Severity: Major
                              Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                      return
                                Severity: Major
                                Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                        return
                                  Severity: Major
                                  Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                          return
                                    Severity: Major
                                    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                            return
                                      Severity: Major
                                      Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                              return
                                        Severity: Major
                                        Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                return
                                          Severity: Major
                                          Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                  return
                                            Severity: Major
                                            Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                    return
                                              Severity: Major
                                              Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        return
                                                Severity: Major
                                                Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                        return
                                                  Severity: Major
                                                  Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                          return
                                                    Severity: Major
                                                    Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                            return
                                                      Severity: Major
                                                      Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                              return
                                                        Severity: Major
                                                        Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                return
                                                          Severity: Major
                                                          Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                  return
                                                            Severity: Major
                                                            Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                  return
                                                              Severity: Major
                                                              Found in modules/auxiliary/fuzzers/ftp/client_ftp.rb - About 30 mins to fix

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status