rapid7/metasploit-framework

View on GitHub
plugins/sqlmap.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Method cmd_sqlmap_save_data has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def cmd_sqlmap_save_data(*args)
        unless args.length == 1
          print_error('Usage:')
          print_error('\tsqlmap_save_data <taskid>')
          return
Severity: Minor
Found in plugins/sqlmap.rb - About 1 hr to fix

    Method cmd_sqlmap_get_data has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def cmd_sqlmap_get_data(*args)
            unless args.length == 1
              print_error('Usage:')
              print_error('\tsqlmap_get_data <taskid>')
              return
    Severity: Minor
    Found in plugins/sqlmap.rb - About 1 hr to fix

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

            def cmd_sqlmap_save_data(*args)
              unless args.length == 1
                print_error('Usage:')
                print_error('\tsqlmap_save_data <taskid>')
                return
      Severity: Minor
      Found in plugins/sqlmap.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 cmd_sqlmap_get_option has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_sqlmap_get_option(*args)
              @hid_tasks ||= {}
              @tasks ||= {}
      
              unless args.length == 2
      Severity: Minor
      Found in plugins/sqlmap.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 cmd_sqlmap_set_option has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_sqlmap_set_option(*args)
              unless args.length == 3
                print_error('Usage:')
                print_error('\tsqlmap_set_option <taskid> <option_name> <option_value>')
                return
      Severity: Minor
      Found in plugins/sqlmap.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

      Method cmd_sqlmap_get_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_sqlmap_get_data(*args)
              unless args.length == 1
                print_error('Usage:')
                print_error('\tsqlmap_get_data <taskid>')
                return
      Severity: Minor
      Found in plugins/sqlmap.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

      Method cmd_sqlmap_start_task has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_sqlmap_start_task(*args)
              if args.empty?
                print_error('Usage:')
                print_error('\tsqlmap_start_task <taskid> [<url>]')
                return
      Severity: Minor
      Found in plugins/sqlmap.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

      Method cmd_sqlmap_new_task has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def cmd_sqlmap_new_task
              @hid_tasks ||= {}
              @tasks ||= {}
      
              unless @manager
      Severity: Minor
      Found in plugins/sqlmap.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