Showing 344 of 344 total issues

Function SetupRunner has 191 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func SetupRunner(
    cfg *config.Config,
    appOptions *options.AppOptions,
    runOptions *options.RunOptions,
) (runner *Runner, err error) {
Severity: Major
Found in runner/setup.go - About 6 hrs to fix

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

    package config
    
    import (
        "encoding/json"
        "fmt"
    Severity: Major
    Found in config/remove_task.go and 1 other location - About 3 hrs to fix
    config/push_task.go on lines 1..44

    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 299.

    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

    package config
    
    import (
        "encoding/json"
        "fmt"
    Severity: Major
    Found in config/push_task.go and 1 other location - About 3 hrs to fix
    config/remove_task.go on lines 1..44

    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 299.

    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

    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

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

      package jsonconfig
      
      import (
          "encoding/json"
      
      
      Severity: Major
      Found in loader/jsonconfig/remove_task.go and 1 other location - About 2 hrs to fix
      loader/jsonconfig/push_task.go on lines 1..41

      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 242.

      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

      package jsonconfig
      
      import (
          "encoding/json"
      
      
      Severity: Major
      Found in loader/jsonconfig/push_task.go and 1 other location - About 2 hrs to fix
      loader/jsonconfig/remove_task.go on lines 1..41

      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 242.

      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 Runner.Run has 75 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (r *Runner) Run(plans []string) bool {
          r.logger.Info(
              nil,
              "Beginning run %s",
              r.runID,
      Severity: Minor
      Found in runner/runner.go - About 2 hrs to fix

        Method StageRunner.buildTaskRunnerFunc has 69 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (r *StageRunner) buildTaskRunnerFunc(
            stageTask *config.StageTask,
            index int,
            task config.Task,
            context *RunContext,
        Severity: Minor
        Found in runner/stage.go - About 1 hr to fix

          Method PlanRunner.Run has 63 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (r *PlanRunner) Run(
              context *RunContext,
              name string,
              prefix *logging.Prefix,
          ) bool {
          Severity: Minor
          Found in runner/plan.go - About 1 hr to fix

            Method Config.Translate has 61 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (c *Config) Translate(parent *config.Config) (*config.Config, error) {
                extends, err := util.UnmarshalStringList(c.Extends)
                if err != nil {
                    return nil, err
                }
            Severity: Minor
            Found in loader/jsonconfig/config.go - About 1 hr to fix

              Function LoadFile has 55 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func LoadFile(path string, override *config.Override) (*config.Config, error) {
                  overridePaths, err := getOverridePaths()
                  if err != nil {
                      return nil, fmt.Errorf(
                          "failed to determine override paths: %s",
              Severity: Minor
              Found in loader/loader.go - About 1 hr to fix

                Function NewRunner has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    ctx context.Context,
                    logger logging.Logger,
                    config *config.Config,
                    taskRunnerFactory TaskRunnerFactory,
                    scratch *scratch.ScratchSpace,
                Severity: Major
                Found in runner/runner.go - About 1 hr to fix

                  Function SetupRunner has 11 return statements (exceeds 4 allowed).
                  Open

                  func SetupRunner(
                      cfg *config.Config,
                      appOptions *options.AppOptions,
                      runOptions *options.RunOptions,
                  ) (runner *Runner, err error) {
                  Severity: Major
                  Found in runner/setup.go - About 1 hr to fix

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

                    func (t *Transferer) Import(patterns, blacklistPatterns []string) error {
                        blacklist, err := constructBlacklist(t.project, blacklistPatterns)
                        if err != nil {
                            return err
                        }
                    Severity: Major
                    Found in paths/transferer.go and 1 other location - About 1 hr to fix
                    paths/transferer.go on lines 49..58

                    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 131.

                    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 (t *Transferer) Export(patterns, blacklistPatterns []string) error {
                        blacklist, err := constructBlacklist(t.workspace, blacklistPatterns)
                        if err != nil {
                            return err
                        }
                    Severity: Major
                    Found in paths/transferer.go and 1 other location - About 1 hr to fix
                    paths/transferer.go on lines 38..47

                    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 131.

                    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 Config.Translate has 10 return statements (exceeds 4 allowed).
                    Open

                    func (c *Config) Translate(parent *config.Config) (*config.Config, error) {
                        extends, err := util.UnmarshalStringList(c.Extends)
                        if err != nil {
                            return nil, err
                        }
                    Severity: Major
                    Found in loader/jsonconfig/config.go - About 1 hr 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 NewStageRunner has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            ctx context.Context,
                            logger logging.Logger,
                            config *config.Config,
                            taskRunnerFactory TaskRunnerFactory,
                            plan *config.Plan,
                        Severity: Major
                        Found in runner/stage.go - About 1 hr to fix

                          Function LoadFile has 9 return statements (exceeds 4 allowed).
                          Open

                          func LoadFile(path string, override *config.Override) (*config.Config, error) {
                              overridePaths, err := getOverridePaths()
                              if err != nil {
                                  return nil, fmt.Errorf(
                                      "failed to determine override paths: %s",
                          Severity: Major
                          Found in loader/loader.go - About 55 mins 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
                              Severity
                              Category
                              Status
                              Source
                              Language