Showing 900 of 900 total issues

Method BaseStage.addServiceMountsVolumes has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (s *BaseStage) addServiceMountsVolumes(mountpointsByType map[string][]string, c Conveyor, cr container_backend.ContainerBackend, stageImage *StageImage, cleanupMountpoints bool) error {
Severity: Minor
Found in pkg/build/stage/base.go - About 35 mins to fix

    Method UserWithGitPatchStage.PrepareImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (s *UserWithGitPatchStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error {
    Severity: Minor
    Found in pkg/build/stage/user_with_git_patch.go - About 35 mins to fix

      Method DependenciesStage.PrepareImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (s *DependenciesStage) PrepareImage(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevBuiltImage, stageImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) error {
      Severity: Minor
      Found in pkg/build/stage/dependencies.go - About 35 mins to fix

        Method BaseStage.addCustomMountVolumes has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (s *BaseStage) addCustomMountVolumes(mountpointsByFrom map[string][]string, c Conveyor, cr container_backend.ContainerBackend, stageImage *StageImage, cleanupMountpoints bool) error {
        Severity: Minor
        Found in pkg/build/stage/base.go - About 35 mins to fix

          Method StapelDockerInstructionsStage.GetDependencies has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (s *StapelDockerInstructionsStage) GetDependencies(ctx context.Context, c Conveyor, cb container_backend.ContainerBackend, prevImage, prevBuiltImage *StageImage, buildContextArchive container_backend.BuildContextArchiver) (string, error) {
          Severity: Minor
          Found in pkg/build/stage/stapel_docker_instructions.go - About 35 mins to fix

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

            func initStages(ctx context.Context, image *Image, metaConfig *config.Meta, stapelImageConfig config.StapelImageInterface, opts CommonImageOptions) error {
            Severity: Minor
            Found in pkg/build/image/stapel.go - About 35 mins to fix

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

                  def __init__(self, in_a=None, in_b=None, out_a=None, out_b=None, out_ab=None):
              Severity: Minor
              Found in pkg/build/builder/ansible/werf/tee_popen.py - About 35 mins to fix

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

                    tmpl = tmpl.Funcs(map[string]interface{}{
                        "image":                   func() string { return "%[1]s" },
                        "image_slug":              func() string { return "%[2]s" },
                        "image_safe_slug":         func() string { return "%[3]s" },
                        "image_content_based_tag": func() string { return "%[4]s" },
                Severity: Minor
                Found in cmd/werf/export/export.go and 1 other location - About 35 mins to fix
                cmd/werf/common/conveyor_options.go on lines 124..129

                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

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

                    tmpl = tmpl.Funcs(map[string]interface{}{
                        "image":                   func() string { return "%[1]s" },
                        "image_slug":              func() string { return "%[2]s" },
                        "image_safe_slug":         func() string { return "%[3]s" },
                        "image_content_based_tag": func() string { return "%[4]s" },
                Severity: Minor
                Found in cmd/werf/common/conveyor_options.go and 1 other location - About 35 mins to fix
                cmd/werf/export/export.go on lines 298..303

                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

                                    if mount.From != "" {
                                        if dep := findStageByRef(mount.From, stages, stageByName); dep != nil {
                                            stage.AppendDependencyStage(dep)
                                            instr.SetDependencyByStageRef(mount.From, dep)
                                        } else {
                Severity: Minor
                Found in pkg/dockerfile/dockerfile_stage.go and 1 other location - About 35 mins to fix
                pkg/dockerfile/dockerfile_stage.go on lines 83..90

                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

                        if err := logboek.Context(ctx).Default().LogProcess("Deleting final stages").DoError(func() error {
                            finalStages, err := m.StorageManager.GetFinalStageDescriptionList(ctx)
                            if err != nil {
                                return err
                            }
                Severity: Minor
                Found in pkg/cleaning/purge.go and 1 other location - About 35 mins to fix
                pkg/cleaning/purge.go on lines 40..49

                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

                                if typedInstr.From != "" {
                                    if dep := findStageByRef(typedInstr.From, stages, stageByName); dep != nil {
                                        stage.AppendDependencyStage(dep)
                                        instr.SetDependencyByStageRef(typedInstr.From, dep)
                                    } else {
                Severity: Minor
                Found in pkg/dockerfile/dockerfile_stage.go and 1 other location - About 35 mins to fix
                pkg/dockerfile/dockerfile_stage.go on lines 95..102

                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

                    if err := logboek.Context(ctx).Default().LogProcess("Deleting stages").DoError(func() error {
                        stages, err := m.StorageManager.GetStageDescriptionListWithCache(ctx)
                        if err != nil {
                            return err
                        }
                Severity: Minor
                Found in pkg/cleaning/purge.go and 1 other location - About 35 mins to fix
                pkg/cleaning/purge.go on lines 86..95

                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

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

                func generateOverrides(container, secret string, extraAnnos, extraLabels map[string]string) ([]byte, error) {
                    codec := runtime.NewCodec(scheme.DefaultJSONEncoder(), scheme.Codecs.UniversalDeserializer())
                
                    podOverrides := &corev1.Pod{}
                    if err := runtime.DecodeInto(codec, []byte(cmdData.Overrides), podOverrides); err != nil {
                Severity: Major
                Found in cmd/werf/kube_run/kube_run.go - About 35 mins to fix

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

                  func newCmd(ctx context.Context, composeCmdName string, options *newCmdOptions) *cobra.Command {
                      var cmdData composeCmdData
                      var commonCmdData common.CmdData
                  
                      short := GetComposeShort(composeCmdName).Short
                  Severity: Major
                  Found in cmd/werf/compose/main.go - About 35 mins to fix

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

                    func getTelemetryProjectID(ctx context.Context) (string, error) {
                        var projectID string
                    
                        var workingDir, gitWorkTree string
                    
                    
                    Severity: Major
                    Found in cmd/werf/common/telemetry.go - About 35 mins to fix

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

                      func readEditedFile(filePath string, values bool, encoder *secret.YamlEncoder) ([]byte, []byte, error) {
                          var data, encodedData []byte
                      
                          exist, err := util.FileExists(filePath)
                          if err != nil {
                      Severity: Major
                      Found in cmd/werf/helm/secret/common/edit.go - About 35 mins to fix

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

                        func validateCopyFrom() error {
                            rawCopyFrom := getCopyFromRaw()
                        
                            for _, copyFrom := range rawCopyFrom {
                                parts := strings.Split(copyFrom, ":")
                        Severity: Major
                        Found in cmd/werf/kube_run/kube_run.go - About 35 mins to fix

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

                          func FollowGitHead(ctx context.Context, cmdData *CmdData, taskFunc func(ctx context.Context, iterGiterminismManager giterminism_manager.Interface) error) error {
                              var waitMessage string
                              if *cmdData.Dev {
                                  waitMessage = "Waiting for new changes ..."
                              } else {
                          Severity: Major
                          Found in cmd/werf/common/follow.go - About 35 mins to fix

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

                            func NewUpgradeCmd(actionConfig *action.Configuration, wc *chart_extender.WerfChartStub, namespace *string) *cobra.Command {
                                cmd, _ := helm_v3.NewUpgradeCmd(actionConfig, os.Stdout, helm_v3.UpgradeCmdOptions{
                                    StagesSplitter:              helm.NewStagesSplitter(),
                                    StagesExternalDepsGenerator: helm.NewStagesExternalDepsGenerator(&actionConfig.RESTClientGetter, namespace),
                                    ChainPostRenderer:           wc.ChainPostRenderer,
                            Severity: Major
                            Found in cmd/werf/helm/upgrade.go - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language