asteris-llc/converge

View on GitHub

Showing 292 of 572 total issues

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

        t.Run("scope", func(t *testing.T) {
            typeName := "scope"
            typeProps := map[string]interface{}{}
            m := &DbusMock{}
            m.On("ListUnits").Return([]dbus.UnitStatus{dbus.UnitStatus{Name: ("name." + typeName)}}, nil)
Severity: Major
Found in resource/systemd/unit/systemd_linux_test.go and 10 other locations - About 5 hrs to fix
resource/systemd/unit/systemd_linux_test.go on lines 177..199
resource/systemd/unit/systemd_linux_test.go on lines 200..222
resource/systemd/unit/systemd_linux_test.go on lines 223..245
resource/systemd/unit/systemd_linux_test.go on lines 246..268
resource/systemd/unit/systemd_linux_test.go on lines 269..291
resource/systemd/unit/systemd_linux_test.go on lines 292..314
resource/systemd/unit/systemd_linux_test.go on lines 315..337
resource/systemd/unit/systemd_linux_test.go on lines 338..360
resource/systemd/unit/systemd_linux_test.go on lines 361..383
resource/systemd/unit/systemd_linux_test.go on lines 384..406

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

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

        t.Run("socket", func(t *testing.T) {
            typeName := "socket"
            typeProps := map[string]interface{}{}
            m := &DbusMock{}
            m.On("ListUnits").Return([]dbus.UnitStatus{dbus.UnitStatus{Name: ("name." + typeName)}}, nil)
Severity: Major
Found in resource/systemd/unit/systemd_linux_test.go and 10 other locations - About 5 hrs to fix
resource/systemd/unit/systemd_linux_test.go on lines 200..222
resource/systemd/unit/systemd_linux_test.go on lines 223..245
resource/systemd/unit/systemd_linux_test.go on lines 246..268
resource/systemd/unit/systemd_linux_test.go on lines 269..291
resource/systemd/unit/systemd_linux_test.go on lines 292..314
resource/systemd/unit/systemd_linux_test.go on lines 315..337
resource/systemd/unit/systemd_linux_test.go on lines 338..360
resource/systemd/unit/systemd_linux_test.go on lines 361..383
resource/systemd/unit/systemd_linux_test.go on lines 384..406
resource/systemd/unit/systemd_linux_test.go on lines 407..429

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

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

        t.Run("path", func(t *testing.T) {
            typeName := "path"
            typeProps := map[string]interface{}{}
            m := &DbusMock{}
            m.On("ListUnits").Return([]dbus.UnitStatus{dbus.UnitStatus{Name: ("name." + typeName)}}, nil)
Severity: Major
Found in resource/systemd/unit/systemd_linux_test.go and 10 other locations - About 5 hrs to fix
resource/systemd/unit/systemd_linux_test.go on lines 177..199
resource/systemd/unit/systemd_linux_test.go on lines 200..222
resource/systemd/unit/systemd_linux_test.go on lines 223..245
resource/systemd/unit/systemd_linux_test.go on lines 246..268
resource/systemd/unit/systemd_linux_test.go on lines 269..291
resource/systemd/unit/systemd_linux_test.go on lines 292..314
resource/systemd/unit/systemd_linux_test.go on lines 338..360
resource/systemd/unit/systemd_linux_test.go on lines 361..383
resource/systemd/unit/systemd_linux_test.go on lines 384..406
resource/systemd/unit/systemd_linux_test.go on lines 407..429

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

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

        t.Run("swap", func(t *testing.T) {
            typeName := "swap"
            typeProps := map[string]interface{}{}
            m := &DbusMock{}
            m.On("ListUnits").Return([]dbus.UnitStatus{dbus.UnitStatus{Name: ("name." + typeName)}}, nil)
Severity: Major
Found in resource/systemd/unit/systemd_linux_test.go and 10 other locations - About 5 hrs to fix
resource/systemd/unit/systemd_linux_test.go on lines 177..199
resource/systemd/unit/systemd_linux_test.go on lines 200..222
resource/systemd/unit/systemd_linux_test.go on lines 223..245
resource/systemd/unit/systemd_linux_test.go on lines 246..268
resource/systemd/unit/systemd_linux_test.go on lines 292..314
resource/systemd/unit/systemd_linux_test.go on lines 315..337
resource/systemd/unit/systemd_linux_test.go on lines 338..360
resource/systemd/unit/systemd_linux_test.go on lines 361..383
resource/systemd/unit/systemd_linux_test.go on lines 384..406
resource/systemd/unit/systemd_linux_test.go on lines 407..429

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

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 TestParseSwitchConditionalWithDefault(t *testing.T) {
    var sampleDefault = `
switch "named-switch" {
    default {
        task.query "foo" {
Severity: Major
Found in parse/preprocessor/switch/switch_test.go and 1 other location - About 4 hrs to fix
parse/preprocessor/switch/switch_test.go on lines 175..204

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

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 TestParseSwitchConditionalWithCase(t *testing.T) {
    var sampleCase = `
switch "named-switch" {
    case "eq 1 0" "a" {
        task.query "foo" {
Severity: Major
Found in parse/preprocessor/switch/switch_test.go and 1 other location - About 4 hrs to fix
parse/preprocessor/switch/switch_test.go on lines 208..238

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

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("with gid", func(t *testing.T) {
            u := user.NewUser(new(user.System))
            u.Username = fakeUsername
            u.GID = existingGID
            status := resource.NewStatus()
Severity: Major
Found in resource/user/user_test.go and 3 other locations - About 4 hrs to fix
resource/user/user_test.go on lines 620..640
resource/user/user_test.go on lines 658..678
resource/user/user_test.go on lines 696..716

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

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("group exists-provide groupname", func(t *testing.T) {
            u := user.NewUser(new(user.System))
            u.Username = existingGroupName
            u.GroupName = existingGroupName
            status := resource.NewStatus()
Severity: Major
Found in resource/user/user_test.go and 3 other locations - About 4 hrs to fix
resource/user/user_test.go on lines 658..678
resource/user/user_test.go on lines 696..716
resource/user/user_test.go on lines 732..752

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

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("uid not found", func(t *testing.T) {
            u := user.NewUser(new(user.System))
            u.Username = fakeUsername
            u.UID = fakeUID
            status := resource.NewStatus()
Severity: Major
Found in resource/user/user_test.go and 3 other locations - About 4 hrs to fix
resource/user/user_test.go on lines 620..640
resource/user/user_test.go on lines 696..716
resource/user/user_test.go on lines 732..752

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

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("with groupname", func(t *testing.T) {
            u := user.NewUser(new(user.System))
            u.Username = fakeUsername
            u.GroupName = existingGroupName
            status := resource.NewStatus()
Severity: Major
Found in resource/user/user_test.go and 3 other locations - About 4 hrs to fix
resource/user/user_test.go on lines 620..640
resource/user/user_test.go on lines 658..678
resource/user/user_test.go on lines 732..752

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

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-group-change-and-user-unspecified", func(t *testing.T) {
        t.Parallel()

        o := (&owner.Owner{
            Destination: "foo",
Severity: Major
Found in resource/file/owner/owner_test.go and 3 other locations - About 4 hrs to fix
resource/file/owner/owner_test.go on lines 152..176
resource/file/owner/owner_test.go on lines 178..202
resource/file/owner/owner_test.go on lines 204..228

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

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-user-change-and-group-no-change", func(t *testing.T) {
        t.Parallel()

        o := (&owner.Owner{
            Destination: "foo",
Severity: Major
Found in resource/file/owner/owner_test.go and 3 other locations - About 4 hrs to fix
resource/file/owner/owner_test.go on lines 178..202
resource/file/owner/owner_test.go on lines 204..228
resource/file/owner/owner_test.go on lines 230..254

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

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-group-change-and-user-no-change", func(t *testing.T) {
        t.Parallel()

        o := (&owner.Owner{
            Destination: "foo",
Severity: Major
Found in resource/file/owner/owner_test.go and 3 other locations - About 4 hrs to fix
resource/file/owner/owner_test.go on lines 152..176
resource/file/owner/owner_test.go on lines 178..202
resource/file/owner/owner_test.go on lines 230..254

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

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-user-change-and-group-unspecified", func(t *testing.T) {
        t.Parallel()

        o := (&owner.Owner{
            Destination: "foo",
Severity: Major
Found in resource/file/owner/owner_test.go and 3 other locations - About 4 hrs to fix
resource/file/owner/owner_test.go on lines 152..176
resource/file/owner/owner_test.go on lines 204..228
resource/file/owner/owner_test.go on lines 230..254

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

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("dns change", func(t *testing.T) {
        c := &fakeAPIClient{
            FindContainerFunc: func(name string) (*dc.Container, error) {
                return &dc.Container{
                    Name:   name,
Severity: Major
Found in resource/docker/container/container_test.go and 1 other location - About 4 hrs to fix
resource/docker/container/container_test.go on lines 595..622

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

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("volumes from change", func(t *testing.T) {
        c := &fakeAPIClient{
            FindContainerFunc: func(name string) (*dc.Container, error) {
                return &dc.Container{
                    Name:   name,
Severity: Major
Found in resource/docker/container/container_test.go and 1 other location - About 4 hrs to fix
resource/docker/container/container_test.go on lines 495..525

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

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 modify-will not attempt add/modify", func(t *testing.T) {
                    grp := &user.Group{
                        Name: currName,
                        Gid:  fakeGid,
                    }
Severity: Major
Found in resource/group/group_test.go and 1 other location - About 3 hrs to fix
resource/group/group_test.go on lines 636..655

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

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 add-will not attempt add/modify", func(t *testing.T) {
                    grp := &user.Group{
                        Name: fakeName,
                        Gid:  fakeGid,
                    }
Severity: Major
Found in resource/group/group_test.go and 1 other location - About 3 hrs to fix
resource/group/group_test.go on lines 702..721

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

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("internal", func(t *testing.T) {
                nw := &network.Network{
                    Name:     nwName,
                    State:    network.StatePresent,
                    Internal: true,
Severity: Major
Found in resource/docker/network/network_test.go and 1 other location - About 3 hrs to fix
resource/docker/network/network_test.go on lines 338..359

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

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("ipv6", func(t *testing.T) {
                nw := &network.Network{
                    Name:  nwName,
                    State: network.StatePresent,
                    IPv6:  true,
Severity: Major
Found in resource/docker/network/network_test.go and 1 other location - About 3 hrs to fix
resource/docker/network/network_test.go on lines 315..336

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

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