asteris-llc/converge

View on GitHub

Showing 292 of 615 total issues

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

func getResult(t *testing.T, src *graph.Graph, key string) *apply.Result {
    meta, ok := src.Get(key)
    require.True(t, ok, "%q was not present in the graph", key)

    result, ok := meta.Value().(*apply.Result)
Severity: Minor
Found in apply/apply_test.go and 1 other location - About 55 mins to fix
plan/plan_test.go on lines 95..103

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

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 getResult(t *testing.T, src *graph.Graph, key string) *plan.Result {
    meta, ok := src.Get(key)
    require.True(t, ok, "%q was not present in the graph", key)

    result, ok := meta.Value().(*plan.Result)
Severity: Minor
Found in plan/plan_test.go and 1 other location - About 55 mins to fix
apply/apply_test.go on lines 128..136

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

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 (g *Graph) DownEdges(id string) (out []dag.Edge) {
    g.innerLock.RLock()
    defer g.innerLock.RUnlock()

    for _, edge := range g.inner.Edges() {
Severity: Minor
Found in graph/graph.go and 1 other location - About 55 mins to fix
graph/graph.go on lines 209..220

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

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 (g *Graph) UpEdges(id string) (out []dag.Edge) {
    g.innerLock.RLock()
    defer g.innerLock.RUnlock()

    for _, edge := range g.inner.Edges() {
Severity: Minor
Found in graph/graph.go and 1 other location - About 55 mins to fix
graph/graph.go on lines 223..234

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

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

    t.Run("when uninstalled", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgUninstalled)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when held", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgHold)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when removed", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgRemoved)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178

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

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

    t.Run("when installed", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgInstalled)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when uninstalled", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgUninstalled)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when removed", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgRemoved)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when held", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgHold)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 150..158
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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

    t.Run("when installed", func(t *testing.T) {
        pkg := "foo1"
        out := fmt.Sprintf("foo,%s,0.1.2.3", apt.PkgInstalled)
        runner := newRunner(out, nil)
        a := &apt.Manager{Sys: runner}
Severity: Major
Found in resource/package/apt/package_manager_test.go and 7 other locations - About 50 mins to fix
resource/package/apt/package_manager_test.go on lines 87..95
resource/package/apt/package_manager_test.go on lines 105..113
resource/package/apt/package_manager_test.go on lines 115..123
resource/package/apt/package_manager_test.go on lines 125..133
resource/package/apt/package_manager_test.go on lines 160..168
resource/package/apt/package_manager_test.go on lines 170..178
resource/package/apt/package_manager_test.go on lines 180..188

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

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("device remove", func(t *testing.T) {
        lvm, _ := testhelpers.MakeFakeLvmNonEmpty()
        status, _ := simpleCheckSuccess(t, lvm, "vg1", []string{"/dev/sdc1"}, true, false)
        assert.True(t, status.HasChanges())
        comparison.AssertDiff(t, status.Diffs(), "/dev/sdd1", "<group vg1>", "<removed>")
Severity: Minor
Found in resource/lvm/vg/vg_test.go and 1 other location - About 50 mins to fix
resource/lvm/vg/vg_test.go on lines 89..97

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

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("device force remove", func(t *testing.T) {
        lvm, _ := testhelpers.MakeFakeLvmNonEmpty()
        status, _ := simpleCheckSuccess(t, lvm, "vg1", []string{"/dev/sdc1"}, true, true)
        assert.True(t, status.HasChanges())
        comparison.AssertDiff(t, status.Diffs(), "/dev/sdd1", "<group vg1>", "<destructed>")
Severity: Minor
Found in resource/lvm/vg/vg_test.go and 1 other location - About 50 mins to fix
resource/lvm/vg/vg_test.go on lines 79..87

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

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 LoadFromString(name, src string) (*graph.Graph, error) {
    if !strings.HasSuffix(name, ".hcl") {
        name = name + ".hcl"
    }
    tmpdir, err := ioutil.TempDir("", "converge-testing")
Severity: Minor
Found in helpers/testing/hclutils/hclutils.go and 1 other location - About 50 mins to fix
helpers/testing/hclutils/hclutils.go on lines 31..43

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

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("TestVertexSplitWhenNoMatchReturnsRest", func(t *testing.T) {
        s := "x.y.z"
        g := graph.New()
        g.Add(node.New("a.b.c", "a.b.c"))
        pfx, rest, found := preprocessor.VertexSplit(g, s)
Severity: Minor
Found in render/preprocessor/preprocessor_test.go and 1 other location - About 50 mins to fix
render/preprocessor/preprocessor_test.go on lines 49..57

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

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("TestVertexSplitWhenExactMatchReturnsPrefix", func(t *testing.T) {
        s := "a.b.c"
        g := graph.New()
        g.Add(node.New("a.b.c", "a.b.c"))
        pfx, rest, found := preprocessor.VertexSplit(g, s)
Severity: Minor
Found in render/preprocessor/preprocessor_test.go and 1 other location - About 50 mins to fix
render/preprocessor/preprocessor_test.go on lines 59..67

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

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 LoadAndParseFromString(name, src string) (*graph.Graph, error) {
    if !strings.HasSuffix(name, ".hcl") {
        name = name + ".hcl"
    }
    tmpdir, err := ioutil.TempDir("", "converge-testing")
Severity: Minor
Found in helpers/testing/hclutils/hclutils.go and 1 other location - About 50 mins to fix
helpers/testing/hclutils/hclutils.go on lines 15..27

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

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("retry task success", func(t *testing.T) {
        r := &wait.Retrier{
            Interval: 100 * time.Millisecond,
            MaxRetry: 3,
        }
Severity: Minor
Found in resource/wait/retrier_test.go and 1 other location - About 50 mins to fix
resource/wait/retrier_test.go on lines 77..85

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

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("retry task failure", func(t *testing.T) {
        r := &wait.Retrier{
            Interval: 100 * time.Millisecond,
            MaxRetry: 3,
        }
Severity: Minor
Found in resource/wait/retrier_test.go and 1 other location - About 50 mins to fix
resource/wait/retrier_test.go on lines 87..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 121.

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

Severity
Category
Status
Source
Language