rapid7/metasploit-framework

View on GitHub
modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Netlogon Weak Cryptographic Authentication',
Severity: Minor
Found in modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.rb - About 1 hr to fix

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

      def check
        bind_to_netlogon_service
    
        status = nil
        2000.times do
    Severity: Minor
    Found in modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.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 action_restore_password has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def action_restore_password
        fail_with(Failure::BadConfig, 'The RESTORE action requires the PASSWORD option to be set') if datastore['PASSWORD'].blank?
        fail_with(Failure::BadConfig, 'The PASSWORD option must be in hex') if /^([0-9a-fA-F]{2})+$/ !~ datastore['PASSWORD']
        password = [datastore['PASSWORD']].pack('H*')
    
    
    Severity: Minor
    Found in modules/auxiliary/admin/dcerpc/cve_2020_1472_zerologon.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

    There are no issues that match your filters.

    Category
    Status