asteris-llc/converge

View on GitHub

Showing 292 of 615 total issues

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

        t.Run("short form", func(t *testing.T) {
            val := "2003-01-02"
            expected, err := time.ParseInLocation(shortForm, val, zone)
            require.NoError(t, err)
            target := newWithField(t, "time", val)
Severity: Minor
Found in resource/preparer_test.go and 1 other location - About 35 mins to fix
resource/preparer_test.go on lines 158..164

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

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("long form", func(t *testing.T) {
            val := "2003-01-02T01:02:03"
            expected, err := time.ParseInLocation(longForm, val, zone)
            require.NoError(t, err)
            target := newWithField(t, "time", val)
Severity: Minor
Found in resource/preparer_test.go and 1 other location - About 35 mins to fix
resource/preparer_test.go on lines 150..156

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

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

    t.Run("normal", func(t *testing.T) {
        defer logging.HideLogs(t)()
        e := lowlevel.MakeOsExec()
        out, err := e.Read("/bin/sh", []string{"-c", "echo foo"})
        assert.NoError(t, err)
Severity: Major
Found in resource/lvm/lowlevel/exec_test.go and 3 other locations - About 30 mins to fix
resource/lvm/lowlevel/exec_test.go on lines 68..74
resource/lvm/lowlevel/exec_test.go on lines 79..85
resource/lvm/lowlevel/exec_test.go on lines 87..93

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

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

    t.Run("non-zero code", func(t *testing.T) {
        defer logging.HideLogs(t)()
        e := lowlevel.MakeOsExec()
        rc, err := e.RunWithExitCode("/bin/sh", []string{"-c", "exit 42"})
        assert.NoError(t, err)
Severity: Major
Found in resource/lvm/lowlevel/exec_test.go and 3 other locations - About 30 mins to fix
resource/lvm/lowlevel/exec_test.go on lines 48..54
resource/lvm/lowlevel/exec_test.go on lines 68..74
resource/lvm/lowlevel/exec_test.go on lines 79..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 102.

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

    t.Run("multiline", func(t *testing.T) {
        defer logging.HideLogs(t)()
        e := lowlevel.MakeOsExec()
        out, err := e.Read("/bin/sh", []string{"-c", "echo foo && echo bar"})
        assert.NoError(t, err)
Severity: Major
Found in resource/lvm/lowlevel/exec_test.go and 3 other locations - About 30 mins to fix
resource/lvm/lowlevel/exec_test.go on lines 48..54
resource/lvm/lowlevel/exec_test.go on lines 79..85
resource/lvm/lowlevel/exec_test.go on lines 87..93

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

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

    t.Run("zero code", func(t *testing.T) {
        defer logging.HideLogs(t)()
        e := lowlevel.MakeOsExec()
        rc, err := e.RunWithExitCode("/bin/sh", []string{"-c", "true"})
        assert.NoError(t, err)
Severity: Major
Found in resource/lvm/lowlevel/exec_test.go and 3 other locations - About 30 mins to fix
resource/lvm/lowlevel/exec_test.go on lines 48..54
resource/lvm/lowlevel/exec_test.go on lines 68..74
resource/lvm/lowlevel/exec_test.go on lines 87..93

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

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("no error", func(t *testing.T) {
            defer logging.HideLogs(t)()
            ran = false

            _, err := g.Transform(
Severity: Minor
Found in graph/notifier_test.go and 1 other location - About 30 mins to fix
graph/notifier_test.go on lines 80..91

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

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("error", func(t *testing.T) {
            defer logging.HideLogs(t)()
            ran = false

            _, err := g.Transform(
Severity: Minor
Found in graph/notifier_test.go and 1 other location - About 30 mins to fix
graph/notifier_test.go on lines 67..78

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

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

                t.Run("md5", func(t *testing.T) {
                    hashType = string(fetch.HashMD5)
                    prep.HashType = &hashType

                    _, err := prep.Prepare(context.Background(), &fr)
Severity: Major
Found in resource/file/fetch/preparer_test.go and 3 other locations - About 30 mins to fix
resource/file/fetch/preparer_test.go on lines 249..255
resource/file/fetch/preparer_test.go on lines 257..263
resource/file/fetch/preparer_test.go on lines 265..271

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

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

                t.Run("sha256", func(t *testing.T) {
                    hashType = string(fetch.HashSHA256)
                    prep.HashType = &hashType

                    _, err := prep.Prepare(context.Background(), &fr)
Severity: Major
Found in resource/file/fetch/preparer_test.go and 3 other locations - About 30 mins to fix
resource/file/fetch/preparer_test.go on lines 241..247
resource/file/fetch/preparer_test.go on lines 249..255
resource/file/fetch/preparer_test.go on lines 265..271

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

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

                t.Run("sha1", func(t *testing.T) {
                    hashType = string(fetch.HashSHA1)
                    prep.HashType = &hashType

                    _, err := prep.Prepare(context.Background(), &fr)
Severity: Major
Found in resource/file/fetch/preparer_test.go and 3 other locations - About 30 mins to fix
resource/file/fetch/preparer_test.go on lines 241..247
resource/file/fetch/preparer_test.go on lines 257..263
resource/file/fetch/preparer_test.go on lines 265..271

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

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

                t.Run("sha512", func(t *testing.T) {
                    hashType = string(fetch.HashSHA512)
                    prep.HashType = &hashType

                    _, err := prep.Prepare(context.Background(), &fr)
Severity: Major
Found in resource/file/fetch/preparer_test.go and 3 other locations - About 30 mins to fix
resource/file/fetch/preparer_test.go on lines 241..247
resource/file/fetch/preparer_test.go on lines 249..255
resource/file/fetch/preparer_test.go on lines 257..263

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

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