rapid7/metasploit-framework

View on GitHub
modules/auxiliary/scanner/lotus/lotus_domino_hashes.rb

Summary

Maintainability
C
1 day
Test Coverage

Method dump_hashes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  def dump_hashes(view_id, cookie, uri)
    begin
      res = send_request_raw({
        'method'  => 'GET',
        'uri'     => "#{uri}\/$defaultview/#{view_id}?OpenDocument",
Severity: Minor
Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.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 run_host has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def run_host(ip)
    user = datastore['NOTES_USER']
    pass = datastore['NOTES_PASS']
    @uri = normalize_uri(datastore['URI'])

Severity: Minor
Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.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 run_host has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run_host(ip)
    user = datastore['NOTES_USER']
    pass = datastore['NOTES_PASS']
    @uri = normalize_uri(datastore['URI'])

Severity: Minor
Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.rb - About 1 hr to fix

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

      def do_login(user = nil, pass = nil)
        post_data = "username=#{Rex::Text.uri_encode(user.to_s)}&password=#{Rex::Text.uri_encode(pass.to_s)}&RedirectTo=%2Fnames.nsf"
    
        begin
    
    
    Severity: Minor
    Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.rb - About 1 hr to fix

      Method dump_hashes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def dump_hashes(view_id, cookie, uri)
          begin
            res = send_request_raw({
              'method'  => 'GET',
              'uri'     => "#{uri}\/$defaultview/#{view_id}?OpenDocument",
      Severity: Minor
      Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.rb - About 1 hr to fix

        Method do_login has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def do_login(user = nil, pass = nil)
            post_data = "username=#{Rex::Text.uri_encode(user.to_s)}&password=#{Rex::Text.uri_encode(pass.to_s)}&RedirectTo=%2Fnames.nsf"
        
            begin
        
        
        Severity: Minor
        Found in modules/auxiliary/scanner/lotus/lotus_domino_hashes.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

        There are no issues that match your filters.

        Category
        Status