asteris-llc/converge

View on GitHub

Showing 615 of 615 total issues

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

func simpleCheckSuccess(t *testing.T, lvm lowlevel.LVM, group string, name string, size *lowlevel.LvmSize) (resource.TaskStatus, resource.Task) {
Severity: Minor
Found in resource/lvm/lv/lv_test.go - About 35 mins to fix

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

    func simpleApplyFailure(t *testing.T, lvm lowlevel.LVM, group string, name string, size *lowlevel.LvmSize) resource.TaskStatus {
    Severity: Minor
    Found in resource/lvm/lv/lv_test.go - About 35 mins to fix

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

      func testDrawNodesCustomPrinter(t *testing.T, h *human.Printer, id string, in Printable, out string) {
      Severity: Minor
      Found in prettyprinters/human/human_test.go - About 35 mins to fix

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

            t.Run("when-name-null", func(t *testing.T) {
                p := &rpm.Preparer{Name: "", State: "present"}
                _, err := p.Prepare(context.Background(), fakerenderer.New())
                require.Error(t, err)
                assert.EqualError(t, err, "package name cannot be empty")
        Severity: Minor
        Found in resource/package/rpm/preparer_test.go and 2 other locations - About 35 mins to fix
        resource/package/apt/preparer_test.go on lines 67..72
        resource/package/rpm/preparer_test.go on lines 72..77

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

        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 3 locations. Consider refactoring.
        Open

        func TestNodeGetStringSliceBadItem(t *testing.T) {
            t.Parallel()
        
            node, err := fromString(`module x y { a = [ 1 ] }`)
            require.NoError(t, err)
        Severity: Minor
        Found in parse/node_test.go and 2 other locations - About 35 mins to fix
        parse/node_test.go on lines 305..320
        parse/node_test.go on lines 333..348

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

        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 3 locations. Consider refactoring.
        Open

        func TestNodeGetStringBad(t *testing.T) {
            t.Parallel()
        
            node, err := fromString(`module x y { a = 1 }`)
            require.NoError(t, err)
        Severity: Minor
        Found in parse/node_test.go and 2 other locations - About 35 mins to fix
        parse/node_test.go on lines 333..348
        parse/node_test.go on lines 350..365

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

        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 3 locations. Consider refactoring.
        Open

        func TestNodeGetStringSliceBad(t *testing.T) {
            t.Parallel()
        
            node, err := fromString(`module x y { a = 1 }`)
            require.NoError(t, err)
        Severity: Minor
        Found in parse/node_test.go and 2 other locations - About 35 mins to fix
        parse/node_test.go on lines 305..320
        parse/node_test.go on lines 350..365

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

        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 3 locations. Consider refactoring.
        Open

            t.Run("when-name-space", func(t *testing.T) {
                p := &apt.Preparer{Name: " ", State: "present"}
                _, err := p.Prepare(context.Background(), fakerenderer.New())
                require.Error(t, err)
                assert.EqualError(t, err, "package name cannot be empty")
        Severity: Minor
        Found in resource/package/apt/preparer_test.go and 2 other locations - About 35 mins to fix
        resource/package/rpm/preparer_test.go on lines 65..70
        resource/package/rpm/preparer_test.go on lines 72..77

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

        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 3 locations. Consider refactoring.
        Open

            t.Run("when-name-space", func(t *testing.T) {
                p := &rpm.Preparer{Name: " ", State: "present"}
                _, err := p.Prepare(context.Background(), fakerenderer.New())
                require.Error(t, err)
                assert.EqualError(t, err, "package name cannot be empty")
        Severity: Minor
        Found in resource/package/rpm/preparer_test.go and 2 other locations - About 35 mins to fix
        resource/package/apt/preparer_test.go on lines 67..72
        resource/package/rpm/preparer_test.go on lines 65..70

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

        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

                t.Run("alpha", func(t *testing.T) {
                    t.Parallel()
                    _, err := fromString(`test "abc" { value = 7 }`)
                    assert.NoError(t, err)
                    _, err = fromString(`test "もしもし" { }`)
        Severity: Minor
        Found in parse/node_test.go and 1 other location - About 35 mins to fix
        parse/node_test.go on lines 122..130

        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

                t.Run("numbers", func(t *testing.T) {
                    t.Parallel()
                    _, err := fromString(`test "abc123" { value = 7 }`)
                    assert.NoError(t, err)
                    _, err = fromString(`test "abc123xyz" { value = 7 }`)
        Severity: Minor
        Found in parse/node_test.go and 1 other location - About 35 mins to fix
        parse/node_test.go on lines 113..121

        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 pipelineGen.prepareNode has 5 return statements (exceeds 4 allowed).
        Open

        func (p pipelineGen) prepareNode(ctx context.Context, idi interface{}) (interface{}, error) {
            var metadataErr error
        
            res, ok := idi.(resource.Resource)
            if !ok {
        Severity: Major
        Found in render/render.go - About 35 mins to fix

          Method Formatter.init has 5 return statements (exceeds 4 allowed).
          Open

          func (f *Formatter) init() {
              isColorTerminal := logrus.IsTerminal(os.Stderr) && (runtime.GOOS != "windows")
              f.fancy = (!f.DisableColors && isColorTerminal)
          
              f.replacer = strings.NewReplacer(
          Severity: Major
          Found in helpers/logging/formatter.go - About 35 mins to fix

            Method pipelineGen.DependencyCheck has 5 return statements (exceeds 4 allowed).
            Open

            func (g *pipelineGen) DependencyCheck(ctx context.Context, taskI interface{}) (interface{}, error) {
                task, ok := taskI.(taskWrapper)
                if !ok {
                    return nil, errors.New("input node is not a task wrapper")
                }
            Severity: Major
            Found in plan/pipeline.go - About 35 mins to fix

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

              func newExportedField(input interface{}, index int) (*ExportedField, bool) {
                  if nil == input {
                      return nil, false
                  }
              
              
              Severity: Major
              Found in resource/field_extractor.go - About 35 mins to fix

                Method Preparer.convertTime has 5 return statements (exceeds 4 allowed).
                Open

                func (p *Preparer) convertTime(typ reflect.Type, r Renderer, name string, val interface{}, base int) (reflect.Value, error) {
                    if val == nil {
                        return reflect.Zero(typ), nil
                    }
                
                
                Severity: Major
                Found in resource/preparer.go - About 35 mins to fix

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

                  func AssertDiff(t *testing.T, diffs map[string]resource.Diff, name, original, current string) bool {
                      var ok bool
                  
                      if ok = assert.NotEmpty(t, diffs); !ok {
                          return false
                  Severity: Major
                  Found in helpers/comparison/diff.go - About 35 mins to fix

                    Method Unarchive.readWrite has 5 return statements (exceeds 4 allowed).
                    Open

                    func (u *Unarchive) readWrite(file string) error {
                        fileName := strings.TrimPrefix(file, u.fetchDir.Name())
                    
                        fStat, err := os.Stat(file)
                        if err != nil {
                    Severity: Major
                    Found in resource/unarchive/unarchive.go - About 35 mins to fix

                      Method Container.compareLinks has 5 return statements (exceeds 4 allowed).
                      Open

                      func (c *Container) compareLinks(container *dc.Container) (actual, expected string) {
                          normalizeLink := func(link string) string {
                              // internally links are stored as "/linkedcontainername:/containername/alias"
                              parts := strings.Split(link, ":")
                              if len(parts) == 1 {
                      Severity: Major
                      Found in resource/docker/container/container.go - About 35 mins to fix

                        Method executor.HealthCheck has 5 return statements (exceeds 4 allowed).
                        Open

                        func (e *executor) HealthCheck(in *pb.LoadRequest, stream pb.Executor_HealthCheckServer) error {
                            logger, ctx := setIDLogger(stream.Context())
                            logger = logger.WithField("function", "executor.Plan")
                        
                            loaded, err := in.Load(ctx)
                        Severity: Major
                        Found in rpc/executor.go - About 35 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language