runner/run_task.go

Summary

Maintainability
C
7 hrs
Test Coverage

File run_task.go has 570 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package runner

import (
    "context"
    "fmt"
Severity: Minor
Found in runner/run_task.go - About 3 hrs to fix

    Function NewRunTaskRunnerFactory has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        ctx context.Context,
        cfg *config.Config,
        runID string,
        scratch *scratch.ScratchSpace,
        containerLists *ContainerLists,
    Severity: Major
    Found in runner/run_task.go - About 1 hr to fix

      Function runTaskCommandBuilderFactory has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          runID string,
          config *config.Config,
          containerOptions *containerOptions,
          scratch *scratch.ScratchSpace,
          task *config.RunTask,
      Severity: Major
      Found in runner/run_task.go - About 50 mins to fix

        Method runTaskRunner.exportEnvironmentFile has 5 return statements (exceeds 4 allowed).
        Open

        func (r *runTaskRunner) exportEnvironmentFile(context *RunContext, path string) bool {
            workspace := r.scratch.Workspace()
        
            realPath, err := filepath.Abs(filepath.Join(workspace, path))
            if err != nil {
        Severity: Major
        Found in runner/run_task.go - About 35 mins to fix

          Method runTaskCommandBuilderState.addScriptOptions has 5 return statements (exceeds 4 allowed).
          Open

          func (s *runTaskCommandBuilderState) addScriptOptions(cb *command.Builder) error {
              if s.task.Script == "" {
                  return nil
              }
          
          
          Severity: Major
          Found in runner/run_task.go - About 35 mins to fix

            Method runTaskCommandBuilderState.addCommandOptions has 5 return statements (exceeds 4 allowed).
            Open

            func (s *runTaskCommandBuilderState) addCommandOptions(cb *command.Builder) error {
                if s.task.Script != "" {
                    return nil
                }
            
            
            Severity: Major
            Found in runner/run_task.go - About 35 mins to fix

              Method runTaskRunner.Run has 5 return statements (exceeds 4 allowed).
              Open

              func (r *runTaskRunner) Run(context *RunContext) bool {
                  r.logger.Info(
                      r.prefix,
                      "Beginning task",
                  )
              Severity: Major
              Found in runner/run_task.go - About 35 mins to fix

                exported const DefaultWorkspacePath should have comment (or a comment on this block) or be unexported
                Open

                    DefaultWorkspacePath = "/workspace"
                Severity: Minor
                Found in runner/run_task.go by golint

                exported function NewRunTaskRunnerFactory should have comment or be unexported
                Open

                func NewRunTaskRunnerFactory(
                Severity: Minor
                Found in runner/run_task.go by golint

                exported type RunTaskRunnerFactory should have comment or be unexported
                Open

                    RunTaskRunnerFactory func(
                Severity: Minor
                Found in runner/run_task.go by golint

                There are no issues that match your filters.

                Category
                Status