rapid7/metasploit-framework

View on GitHub
modules/auxiliary/dos/http/wordpress_long_password_dos.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Method run has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def run
    if wordpress_and_online?
      if validate_user
        print_status("Checking if user \"#{username}\" exists...")
        unless user_exists(username)
Severity: Minor
Found in modules/auxiliary/dos/http/wordpress_long_password_dos.rb - About 2 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

Method run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run
    if wordpress_and_online?
      if validate_user
        print_status("Checking if user \"#{username}\" exists...")
        unless user_exists(username)
Severity: Minor
Found in modules/auxiliary/dos/http/wordpress_long_password_dos.rb - About 1 hr to fix

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

      def initialize(info = {})
        super(update_info(
          info,
          'Name'            => 'WordPress Long Password DoS',
          'Description'     => %q{WordPress before 3.7.5, 3.8.x before 3.8.5, 3.9.x before 3.9.3, and 4.x
    Severity: Minor
    Found in modules/auxiliary/dos/http/wordpress_long_password_dos.rb - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status