horizoncd/horizon

View on GitHub
pkg/application/gitrepo/gitrepo_applicationv2.go

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Showing 6 of 6 total issues

Method appGitopsRepo.CreateOrUpdateApplication has 108 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (g appGitopsRepo) CreateOrUpdateApplication(ctx context.Context,
application string, req CreateOrUpdateRequest) error {
const op = "gitlab repo: create or update application"
defer wlog.Start(ctx, op).StopPrint()
 
 
Severity: Major
Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 3 hrs to fix

    Method appGitopsRepo.CreateOrUpdateApplication has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (g appGitopsRepo) CreateOrUpdateApplication(ctx context.Context,
    application string, req CreateOrUpdateRequest) error {
    const op = "gitlab repo: create or update application"
    defer wlog.Start(ctx, op).StopPrint()
     
     
    Severity: Minor
    Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 2 hrs to fix

    Method appGitopsRepo.GetApplication has 56 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (g appGitopsRepo) GetApplication(ctx context.Context, application, environment string) (*GetResponse, error) {
    const op = "gitlab repo: get application"
    defer wlog.Start(ctx, op).StopPrint()
     
    // 1. get data from gitlab
    Severity: Minor
    Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 1 hr to fix

      Method appGitopsRepo.CreateOrUpdateApplication has 12 return statements (exceeds 4 allowed).
      Open

      func (g appGitopsRepo) CreateOrUpdateApplication(ctx context.Context,
      application string, req CreateOrUpdateRequest) error {
      const op = "gitlab repo: create or update application"
      defer wlog.Start(ctx, op).StopPrint()
       
       
      Severity: Major
      Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 1 hr to fix

        Method appGitopsRepo.GetApplication has 9 return statements (exceeds 4 allowed).
        Open

        func (g appGitopsRepo) GetApplication(ctx context.Context, application, environment string) (*GetResponse, error) {
        const op = "gitlab repo: get application"
        defer wlog.Start(ctx, op).StopPrint()
         
        // 1. get data from gitlab
        Severity: Major
        Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 55 mins to fix

          Method appGitopsRepo.GetApplication has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
          Open

          func (g appGitopsRepo) GetApplication(ctx context.Context, application, environment string) (*GetResponse, error) {
          const op = "gitlab repo: get application"
          defer wlog.Start(ctx, op).StopPrint()
           
          // 1. get data from gitlab
          Severity: Minor
          Found in pkg/application/gitrepo/gitrepo_applicationv2.go - About 35 mins to fix
          Category
          Status