horizoncd/horizon

View on GitHub
pkg/argocd/mock/mock.go

Summary

Maintainability
C
1 day
Test Coverage

Showing 4 of 4 total issues

Method ArgoServer.GetApplicationTree has 100 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (argoServer *ArgoServer) GetApplicationTree(w http.ResponseWriter, r *http.Request) {
if strings.Contains(r.URL.Path, "notfound") {
w.WriteHeader(http.StatusNotFound)
return
}
Severity: Major
Found in pkg/argocd/mock/mock.go - About 3 hrs to fix

    Method ArgoServer.ListResourceEvents has 73 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (argoServer *ArgoServer) ListResourceEvents(w http.ResponseWriter, r *http.Request) {
    d := []byte(`
    {
    "metadata": {
    "selfLink": "/api/v1/namespaces/test-guanggao/events",
    Severity: Minor
    Found in pkg/argocd/mock/mock.go - About 1 hr to fix

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

      func (argoServer *ArgoServer) DeployApplication(w http.ResponseWriter, r *http.Request) {
      const op = "argo mock server: deploy application"
       
      ctx := log.WithContext(context.Background(), "DeployApplication")
      defer wlog.Start(ctx, op).StopPrint()
      Severity: Major
      Found in pkg/argocd/mock/mock.go and 1 other location - About 1 hr to fix
      pkg/argocd/mock/mock.go on lines 434..450

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

      func (argoServer *ArgoServer) ResumeRollout(w http.ResponseWriter, r *http.Request) {
      const op = "argo mock server: resume rollout"
       
      ctx := log.WithContext(context.Background(), "ResumeRollout")
      defer wlog.Start(ctx, op).StopPrint()
      Severity: Major
      Found in pkg/argocd/mock/mock.go and 1 other location - About 1 hr to fix
      pkg/argocd/mock/mock.go on lines 176..192

      There are no issues that match your filters.

      Category
      Status