server/pkg/tasks_manager/task.go
Function switchTaskToCompletedInStorage
has 8 return statements (exceeds 4 allowed). Open
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)
}
Function switchTaskToRunningInStorage
has 6 return statements (exceeds 4 allowed). Open
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)
Function switchTaskToCompletedInStorage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func switchTaskToCompletedInStorage(ctx context.Context, storage logical.Storage, status taskStatus, uuid string, opts switchTaskToCompletedInStorageOptions) error {