Showing 348 of 348 total issues

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

    ctx context.Context,
    config *config.Config,
    taskRunnerFactory TaskRunnerFactory,
    logger logging.Logger,
    env []string,
Severity: Minor
Found in runner/plan.go - About 35 mins to fix

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

        runID string,
        containerName string,
        scratch *scratch.ScratchSpace,
        containerLists *ContainerLists,
        logger logging.Logger,
    Severity: Minor
    Found in runner/ssh_agent.go - About 35 mins to fix

      Method Copier.copy has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          src string,
          dest string,
          blacklist map[string]struct{},
          info os.FileInfo,
          recursive bool,
      Severity: Minor
      Found in paths/copier.go - About 35 mins to fix

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

            runID string,
            projectDir string,
            scratchRoot string,
            cleanup *Cleanup,
            keepWorkspace bool,
        Severity: Minor
        Found in runner/setup.go - About 35 mins to fix

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

              runID string,
              identities []string,
              scratch *scratch.ScratchSpace,
              containerLists *ContainerLists,
              logger logging.Logger,
          Severity: Minor
          Found in runner/ssh_agent.go - About 35 mins to fix

            Method StageRunner.buildTaskRunnerFunc has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                stageTask *config.StageTask,
                index int,
                task config.Task,
                context *RunContext,
                ambiguous bool,
            Severity: Minor
            Found in runner/stage.go - About 35 mins to fix

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

                  ctx context.Context,
                  logger logging.Logger,
                  prefix *logging.Prefix,
                  format string,
                  args ...interface{},
              Severity: Minor
              Found in runner/setup.go - About 35 mins to fix

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

                    ctx context.Context,
                    logger logging.Logger,
                    env environment.Environment,
                    registry *config.ECRRegistry,
                    runner command.Runner,
                Severity: Minor
                Found in registry/ecr.go - About 35 mins to fix

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

                      verbose bool,
                      colorize bool,
                      clock glock.Clock,
                      outStream io.Writer,
                      errStream io.Writer,
                  Severity: Minor
                  Found in logging/processor.go - About 35 mins to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func NewRemoveTaskRunnerFactory(
                        ctx context.Context,
                        logger logging.Logger,
                    ) RemoveTaskRunnerFactory {
                        return func(
                    Severity: Minor
                    Found in runner/remove_task.go and 1 other location - About 35 mins to fix
                    runner/push_task.go on lines 19..36

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 106.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    func NewPushTaskRunnerFactory(
                        ctx context.Context,
                        logger logging.Logger,
                    ) PushTaskRunnerFactory {
                        return func(
                    Severity: Minor
                    Found in runner/push_task.go and 1 other location - About 35 mins to fix
                    runner/remove_task.go on lines 19..36

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 106.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

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

                      func validateConfig(path string, data []byte) error {
                          if err := schema.Validate("schema/config.yaml", data); err != nil {
                              return fmt.Errorf("failed to validate config %s: %s", path, err.Error())
                          }
                      
                      
                      Severity: Major
                      Found in loader/loader.go - About 35 mins to fix

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

                        func runMain() error {
                            app := kingpin.New("ij", "IJ is a build tool using Docker containers.").Version(consts.Version)
                            clean := app.Command("clean", "Remove exported files.")
                            _ = app.Command("login", "Login to docker registries.")
                            _ = app.Command("logout", "Logout of docker registries.")
                        Severity: Major
                        Found in main.go - About 35 mins to fix

                          Method ScratchSpace.MakeLogFiles has 5 return statements (exceeds 4 allowed).
                          Open

                          func (s *ScratchSpace) MakeLogFiles(prefix string) (*os.File, *os.File, error) {
                              outpath, err := buildPath(filepath.Join(s.runpath, LogsDir, prefix+OutLogSuffix))
                              if err != nil {
                                  return nil, nil, err
                              }
                          Severity: Major
                          Found in scratch/scratch.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

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

                              func getGCRPassword(
                                  env environment.Environment,
                                  registry *config.GCRRegistry,
                              ) (string, error) {
                                  key, err := env.ExpandString(registry.Key)
                              Severity: Major
                              Found in registry/gcr.go - About 35 mins to fix

                                Method Loader.Load has 5 return statements (exceeds 4 allowed).
                                Open

                                func (l *Loader) Load(path string) (*config.Config, error) {
                                    path = l.normalizePath(path, "")
                                
                                    if err := l.readConfigs(path); err != nil {
                                        return nil, err
                                Severity: Major
                                Found in loader/loader.go - About 35 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

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

                                    func translateRegistry(data json.RawMessage) (config.Registry, error) {
                                        typeHint := &RegistryTypeHint{Type: "server"}
                                    
                                        if err := json.Unmarshal(data, typeHint); err != nil {
                                            return nil, err
                                    Severity: Major
                                    Found in loader/jsonconfig/registry.go - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language