server/pkg/tasks_manager/task.go

Summary

Maintainability
A
2 hrs
Test Coverage
C
74%

Function switchTaskToCompletedInStorage has 8 return statements (exceeds 4 allowed).
Open

func switchTaskToCompletedInStorage(ctx context.Context, storage logical.Storage, status taskStatus, uuid string, opts switchTaskToCompletedInStorageOptions) error {
    // validate new status
    if !isCompletedTaskStatus(status) {
        return fmt.Errorf("runtime error: task in completed state cannot be with status %q", status)
    }
Severity: Major
Found in server/pkg/tasks_manager/task.go - About 50 mins to fix

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

    func switchTaskToRunningInStorage(ctx context.Context, storage logical.Storage, uuid string) error {
        // get previous task state from storage
        var prevTask *Task
        {
            t, err := getTaskFromStorage(ctx, storage, taskStateQueued, uuid)
    Severity: Major
    Found in server/pkg/tasks_manager/task.go - About 40 mins to fix

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

      func switchTaskToCompletedInStorage(ctx context.Context, storage logical.Storage, status taskStatus, uuid string, opts switchTaskToCompletedInStorageOptions) error {
      Severity: Minor
      Found in server/pkg/tasks_manager/task.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status