portainer/portainer

View on GitHub
api/git/update/update.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function UpdateGitObject has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func UpdateGitObject(gitService portainer.GitService, objId string, gitConfig *gittypes.RepoConfig, forceUpdate, enableVersionFolder bool, projectPath string) (bool, string, error) {
    if gitConfig == nil {
        return false, "", nil
    }

Severity: Minor
Found in api/git/update/update.go - About 1 hr to fix

    Function UpdateGitObject has 6 return statements (exceeds 4 allowed).
    Open

    func UpdateGitObject(gitService portainer.GitService, objId string, gitConfig *gittypes.RepoConfig, forceUpdate, enableVersionFolder bool, projectPath string) (bool, string, error) {
        if gitConfig == nil {
            return false, "", nil
        }
    
    
    Severity: Major
    Found in api/git/update/update.go - About 40 mins to fix

      Function UpdateGitObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func UpdateGitObject(gitService portainer.GitService, objId string, gitConfig *gittypes.RepoConfig, forceUpdate, enableVersionFolder bool, projectPath string) (bool, string, error) {
      Severity: Minor
      Found in api/git/update/update.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status