rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

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

          def parse(template)
            main_parser = Metasploit::Framework::Obfuscation::CRandomizer::Utility.parse(template)
            modifier = Metasploit::Framework::Obfuscation::CRandomizer::Modifier.new(main_parser, fake_functions_collection, max_random_weight)
            main_parser.toplevel.statements.each do |s|
              case s.var.type
Severity: Minor
Found in lib/metasploit/framework/obfuscation/crandomizer/parser.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 get_login_state has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def get_login_state(username, password)
          # Prep the data needed for login
          sid       = get_last_sid
          protocol  = ssl ? 'https' : 'http'
          peer      = "#{host}:#{port}"
Severity: Minor
Found in lib/metasploit/framework/login_scanner/directadmin.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 build_cmd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def build_cmd(src)
          src_file = "#{self.file_name}.c"
          exe_file = "#{self.file_name}.exe"

          cmd = ''
Severity: Minor
Found in lib/metasploit/framework/compiler/mingw.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

Avoid too many return statements within this function.
Open

        return
Severity: Major
Found in modules/auxiliary/admin/http/grafana_auth_bypass.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return properties
    Severity: Major
    Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return user, password, VALID_LOGIN, r
      Severity: Major
      Found in modules/auxiliary/gather/office365userenum.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return True
        Severity: Major
        Found in modules/auxiliary/scanner/http/onion_omega2_login.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return
          Severity: Major
          Found in modules/auxiliary/admin/http/grafana_auth_bypass.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return
            Severity: Major
            Found in modules/auxiliary/dos/cisco/cisco_7937g_dos.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return None
              Severity: Major
              Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return "unknown"
                Severity: Major
                Found in modules/exploits/linux/smtp/haraka.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return
                  Severity: Major
                  Found in modules/auxiliary/admin/http/cisco_7937g_ssh_privesc.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return str(e)
                    Severity: Major
                    Found in modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return user, password, UNKNOWN, r
                      Severity: Major
                      Found in modules/auxiliary/gather/office365userenum.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return
                        Severity: Major
                        Found in modules/auxiliary/admin/http/grafana_auth_bypass.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return "detected"
                          Severity: Major
                          Found in modules/exploits/linux/smtp/haraka.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return "ConnectionResetError"
                            Severity: Major
                            Found in modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return ("Timeout waiting for alert")
                              Severity: Major
                              Found in modules/auxiliary/scanner/ssl/bleichenbacher_oracle.py - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                          return []
                                Severity: Major
                                Found in plugins/capture.rb - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return
                                  Severity: Major
                                  Found in plugins/alias.rb - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language