asteris-llc/converge

View on GitHub
resource/package/apt/package_manager_test.go

Summary

Maintainability
D
1 day
Test Coverage

Function TestAptInstallPackage has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func TestAptInstallPackage(t *testing.T) {
    t.Parallel()

    t.Run("when installed", func(t *testing.T) {
        pkg := "foo1"
Severity: Minor
Found in resource/package/apt/package_manager_test.go - About 1 hr to fix

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

        t.Run("when held", func(t *testing.T) {
            expected := "foo-0.1.2.3"
            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 3 other locations - About 55 mins to fix
    resource/package/apt/package_manager_test.go on lines 32..40
    resource/package/apt/package_manager_test.go on lines 60..68
    resource/package/apt/package_manager_test.go on lines 70..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 126.

    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("when removed", func(t *testing.T) {
            expected := ""
            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 3 other locations - About 55 mins to fix
    resource/package/apt/package_manager_test.go on lines 32..40
    resource/package/apt/package_manager_test.go on lines 50..58
    resource/package/apt/package_manager_test.go on lines 70..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 126.

    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("when uninstalled", func(t *testing.T) {
            expected := ""
            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 3 other locations - About 55 mins to fix
    resource/package/apt/package_manager_test.go on lines 32..40
    resource/package/apt/package_manager_test.go on lines 50..58
    resource/package/apt/package_manager_test.go on lines 60..68

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

    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("when installed", func(t *testing.T) {
            expected := "foo-0.1.2.3"
            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 3 other locations - About 55 mins to fix
    resource/package/apt/package_manager_test.go on lines 50..58
    resource/package/apt/package_manager_test.go on lines 60..68
    resource/package/apt/package_manager_test.go on lines 70..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 126.

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

        t.Run("when package never installed", func(t *testing.T) {
            pkg := "foo1"
            runner := newRunner("", makeExitError("", 1))
            a := &apt.Manager{Sys: runner}
            _, err := a.RemovePackage(pkg)
    Severity: Minor
    Found in resource/package/apt/package_manager_test.go and 2 other locations - About 40 mins to fix
    resource/package/apt/package_manager_test.go on lines 135..142
    resource/package/rpm/package_manager_test.go on lines 72..79

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

    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 installation error", func(t *testing.T) {
            pkg := "foo1"
            runner := newRunner("", makeExitError("", 1))
            a := &apt.Manager{Sys: runner}
            _, err := a.InstallPackage(pkg)
    Severity: Minor
    Found in resource/package/apt/package_manager_test.go and 2 other locations - About 40 mins to fix
    resource/package/apt/package_manager_test.go on lines 190..197
    resource/package/rpm/package_manager_test.go on lines 72..79

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

    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("when not installed", func(t *testing.T) {
            expected := ""
            a := &apt.Manager{Sys: newRunner("", makeExitError("", 1))}
            result, found := a.InstalledVersion("foo1")
            assert.False(t, found)
    Severity: Minor
    Found in resource/package/apt/package_manager_test.go and 1 other location - About 40 mins to fix
    resource/package/rpm/package_manager_test.go on lines 41..47

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    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

    There are no issues that match your filters.

    Category
    Status