horizoncd/horizon

View on GitHub
pkg/cluster/registry/harbor/v2/registry_harbor.go

Summary

Maintainability
C
1 day
Test Coverage
C
78%

Showing 4 of 4 total issues

Method Registry.sendHTTPRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (h *Registry) sendHTTPRequest(ctx context.Context, method string,
url string, body io.Reader, retry bool, operation string) (*http.Response, error) {
Severity: Minor
Found in pkg/cluster/registry/harbor/v2/registry_harbor.go - About 45 mins to fix

    Method Registry.sendHTTPRequest has 6 return statements (exceeds 4 allowed).
    Open

    func (h *Registry) sendHTTPRequest(ctx context.Context, method string,
    url string, body io.Reader, retry bool, operation string) (*http.Response, error) {
    begin := time.Now()
    var rsp *http.Response
    var err error
    Severity: Major
    Found in pkg/cluster/registry/harbor/v2/registry_harbor.go - About 40 mins to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      func (h *Registry) sendHTTPRequest(ctx context.Context, method string,
      url string, body io.Reader, retry bool, operation string) (*http.Response, error) {
      begin := time.Now()
      var rsp *http.Response
      var err error
      Severity: Major
      Found in pkg/cluster/registry/harbor/v2/registry_harbor.go and 1 other location - About 6 hrs to fix
      pkg/cluster/registry/harbor/v1/registry_harbor.go on lines 115..150

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      func NewHarborRegistry(config *registry.Config) (registry.Registry, error) {
      transport := http.Transport{
      TLSClientConfig: &tls.Config{
      InsecureSkipVerify: config.InsecureSkipVerify,
      },
      Severity: Major
      Found in pkg/cluster/registry/harbor/v2/registry_harbor.go and 1 other location - About 2 hrs to fix
      pkg/cluster/registry/harbor/v1/registry_harbor.go on lines 64..92
      Category
      Status