asteris-llc/converge

View on GitHub

Showing 572 of 572 total issues

Function newPropertiesFromMap has 224 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func newPropertiesFromMap(m map[string]interface{}) *Properties {
    s := &Properties{}

    if val, ok := m["ActiveEnterTimestamp"]; ok {
        s.ActiveEnterTimestamp = val.(uint64)
Severity: Major
Found in resource/systemd/unit/systemd_properties.go - About 7 hrs to fix

    Function TestCopyToFinalDest has 213 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestCopyToFinalDest(t *testing.T) {
        t.Parallel()
    
        t.Run("no duplicates", func(t *testing.T) {
            destDir, err := ioutil.TempDir("", "destDir_unarchive")
    Severity: Major
    Found in resource/unarchive/unarchive_test.go - About 7 hrs to fix

      Function TestPreparer has 212 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestPreparer(t *testing.T) {
          t.Parallel()
      
          var (
              fr       = fakerenderer.FakeRenderer{}
      Severity: Major
      Found in resource/unarchive/preparer_test.go - About 7 hrs to fix

        Function TestCheck has 202 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestCheck(t *testing.T) {
            t.Parallel()
            t.Run("send-signal", func(t *testing.T) {
                r := &Resource{
                    State:        "running",
        Severity: Major
        Found in resource/systemd/unit/resource_test.go - About 7 hrs to fix

          Function TestPreparer has 195 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestPreparer(t *testing.T) {
              t.Parallel()
          
              var (
                  fr       = fakerenderer.FakeRenderer{}
          Severity: Major
          Found in resource/file/fetch/preparer_test.go - About 6 hrs to fix

            Function TestDiffFile has 188 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func TestDiffFile(t *testing.T) {
                t.Parallel()
            
                t.Run("fetch new file", func(t *testing.T) {
                    t.Run("with checksum", func(t *testing.T) {
            Severity: Major
            Found in resource/file/fetch/fetch_test.go - About 6 hrs to fix

              File resource_test.go has 688 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // Copyright © 2016 Asteris, LLC
              //
              // Licensed under the Apache License, Version 2.0 (the "License");
              // you may not use this file except in compliance with the License.
              // You may obtain a copy of the License at
              Severity: Minor
              Found in resource/systemd/unit/resource_test.go - About 6 hrs to fix

                Function dependencyWalk has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
                Open

                func dependencyWalk(rctx context.Context, g *Graph, cb WalkFunc) error {
                    // the basic idea of this implementation is that we want to defer schedule
                    // children of any given node until after that node's non-child dependencies
                    // are satisfied. We're going to have a couple major components of this.
                    // First, a scheduler/latch to make sure we don't schedule work more than
                Severity: Minor
                Found in graph/graph.go - About 5 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                        t.Run("when-false-false-true", func(t *testing.T) {
                            t.Run("first-branch", func(t *testing.T) {
                                branch := "root/switch3/case1"
                                for _, res := range resources {
                                    id := graph.ID(branch, res)
                Severity: Major
                Found in graph/node/conditional/conditional_test.go and 2 other locations - About 5 hrs to fix
                graph/node/conditional/conditional_test.go on lines 227..261
                graph/node/conditional/conditional_test.go on lines 262..296

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

                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-false-true-true", func(t *testing.T) {
                            t.Run("first-branch", func(t *testing.T) {
                                branch := "root/switch2/case1"
                                for _, res := range resources {
                                    id := graph.ID(branch, res)
                Severity: Major
                Found in graph/node/conditional/conditional_test.go and 2 other locations - About 5 hrs to fix
                graph/node/conditional/conditional_test.go on lines 227..261
                graph/node/conditional/conditional_test.go on lines 297..331

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

                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-true-true-true", func(t *testing.T) {
                            t.Run("first-branch", func(t *testing.T) {
                                branch := "root/switch1/case1"
                                for _, res := range resources {
                                    id := graph.ID(branch, res)
                Severity: Major
                Found in graph/node/conditional/conditional_test.go and 2 other locations - About 5 hrs to fix
                graph/node/conditional/conditional_test.go on lines 262..296
                graph/node/conditional/conditional_test.go on lines 297..331

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

                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

                Function TestOwnershipDiff has 159 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func TestOwnershipDiff(t *testing.T) {
                    users := []*user.User{
                        fakeUser("1", "1", "user-1"),
                        fakeUser("2", "2", "user-2"),
                        fakeUser("3", "3", "user-3"),
                Severity: Major
                Found in resource/file/owner/ownership_test.go - About 5 hrs to fix

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

                          t.Run("device", func(t *testing.T) {
                              typeName := "device"
                              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 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("snapshot", func(t *testing.T) {
                              typeName := "snapshot"
                              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 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("mount", func(t *testing.T) {
                              typeName := "mount"
                              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 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("timer", func(t *testing.T) {
                              typeName := "timer"
                              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 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 11 locations. Consider refactoring.
                  Open

                          t.Run("target", func(t *testing.T) {
                              typeName := "target"
                              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 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("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

                  Severity
                  Category
                  Status
                  Source
                  Language