horizoncd/horizon

View on GitHub
pkg/admission/webhook.go

Summary

Maintainability
B
4 hrs
Test Coverage
D
61%

Showing 4 of 4 total issues

Function Validating has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
Open

func Validating(ctx context.Context, request *Request) error {
if len(validatingWebhooks) < 1 {
return nil
}
ctx, cancelFunc := context.WithCancel(ctx)
Severity: Minor
Found in pkg/admission/webhook.go - About 1 hr to fix

Function Validating has 54 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Validating(ctx context.Context, request *Request) error {
if len(validatingWebhooks) < 1 {
return nil
}
ctx, cancelFunc := context.WithCancel(ctx)
Severity: Minor
Found in pkg/admission/webhook.go - About 1 hr to fix

    Function Validating has 9 return statements (exceeds 4 allowed).
    Open

    func Validating(ctx context.Context, request *Request) error {
    if len(validatingWebhooks) < 1 {
    return nil
    }
    ctx, cancelFunc := context.WithCancel(ctx)
    Severity: Major
    Found in pkg/admission/webhook.go - About 55 mins to fix

      Function jsonPatch has 5 return statements (exceeds 4 allowed).
      Open

      func jsonPatch(obj interface{}, patchJSON []byte) (interface{}, error) {
      objJSON, err := json.Marshal(obj)
      if err != nil {
      return nil, err
      }
      Severity: Major
      Found in pkg/admission/webhook.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status