dotcloud/docker

View on GitHub
builder/dockerfile/dispatchers.go

Summary

Maintainability
B
4 hrs
Test Coverage

Function dispatchRun has 53 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func dispatchRun(ctx context.Context, d dispatchRequest, c *instructions.RunCommand) error {
    if err := image.CheckOS(d.state.operatingSystem); err != nil {
        return err
    }

Severity: Minor
Found in builder/dockerfile/dispatchers.go - About 1 hr to fix

    Function dispatchRun has 7 return statements (exceeds 4 allowed).
    Open

    func dispatchRun(ctx context.Context, d dispatchRequest, c *instructions.RunCommand) error {
        if err := image.CheckOS(d.state.operatingSystem); err != nil {
            return err
        }
    
    
    Severity: Major
    Found in builder/dockerfile/dispatchers.go - About 45 mins to fix

      Function initializeStage has 7 return statements (exceeds 4 allowed).
      Open

      func initializeStage(ctx context.Context, d dispatchRequest, cmd *instructions.Stage) error {
          err := d.builder.imageProber.Reset(ctx)
          if err != nil {
              return err
          }
      Severity: Major
      Found in builder/dockerfile/dispatchers.go - About 45 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if d.state.operatingSystem == "windows" &&
                d.state.runConfig.ArgsEscaped != argsEscaped &&
                ((len(runConfig.Cmd) == 1 && strings.ToLower(runConfig.Cmd[0]) != `c:\windows\system32\cmd.exe` && len(runConfig.Shell) == 0) || (len(runConfig.Cmd) > 1)) {
        Severity: Major
        Found in builder/dockerfile/dispatchers.go - About 40 mins to fix

          Function dispatchTriggeredOnBuild has 5 return statements (exceeds 4 allowed).
          Open

          func dispatchTriggeredOnBuild(ctx context.Context, d dispatchRequest, triggers []string) error {
              fmt.Fprintf(d.builder.Stdout, "# Executing %d build trigger", len(triggers))
              if len(triggers) > 1 {
                  fmt.Fprint(d.builder.Stdout, "s")
              }
          Severity: Major
          Found in builder/dockerfile/dispatchers.go - About 35 mins to fix

            Function dispatchWorkdir has 5 return statements (exceeds 4 allowed).
            Open

            func dispatchWorkdir(ctx context.Context, d dispatchRequest, c *instructions.WorkdirCommand) error {
                runConfig := d.state.runConfig
                var err error
                runConfig.WorkingDir, err = normalizeWorkdir(d.state.operatingSystem, runConfig.WorkingDir, c.Path)
                if err != nil {
            Severity: Major
            Found in builder/dockerfile/dispatchers.go - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status