cyberark/secretless-broker

View on GitHub
internal/plugin/connectors/tcp/mysql/authentication_handshake.go

Summary

Maintainability
B
6 hrs
Test Coverage
B
85%

Method AuthenticationHandshake.handleBackendAuthResponse has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.
Open

func (h *AuthenticationHandshake) handleBackendAuthResponse() {
    if h.err != nil {
        return
    }

Severity: Minor
Found in internal/plugin/connectors/tcp/mysql/authentication_handshake.go - About 3 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 AuthenticationHandshake.handleBackendAuthResponse has 87 lines of code (exceeds 70 allowed). Consider refactoring.
Open

func (h *AuthenticationHandshake) handleBackendAuthResponse() {
    if h.err != nil {
        return
    }

Severity: Major
Found in internal/plugin/connectors/tcp/mysql/authentication_handshake.go - About 1 hr to fix

    Method AuthenticationHandshake.handleBackendAuthResponse has 17 return statements (exceeds 7 allowed).
    Open

    func (h *AuthenticationHandshake) handleBackendAuthResponse() {
        if h.err != nil {
            return
        }
    
    
    Severity: Major
    Found in internal/plugin/connectors/tcp/mysql/authentication_handshake.go - About 1 hr to fix

      TODO found
      Open

          // TODO: add tests cases for client secure connection

      TODO found
      Open

          //TODO: after kumbi's work these 2 should be combined

      TODO found
      Open

          // TODO: update this after kumbi's work

      TODO found
      Open

          // TODO: We should probably be carrying out a comprehensive unpacking, so that

      TODO found
      Open

          // TODO: explore weird heisenbug when this is toggled off:  ERROR: 1043 (08S01): Bad handshake

      TODO found
      Open

          // TODO: client requesting SSL results in ERROR 2026 (HY000): SSL connection error: protocol version mismatch

      TODO found
      Open

          // TODO: Note currently just repeating this logic. Will change after kumbi integration

      TODO found
      Open

          // TODO: after kumbi's done, change below to method calls

      TODO found
      Open

          // TODO: add tests cases for authentication plugins support

      TODO found
      Open

          // TODO: push all packing code into the `WriteXXX` methods

      TODO found
      Open

          // TODO: change this to method call on clientHandshakeResponse when Kumbi's work done

      There are no issues that match your filters.

      Category
      Status