SimonBaeumer/goss

View on GitHub

Showing 157 of 157 total issues

Method GroupMap.UnmarshalYAML has 5 return statements (exceeds 4 allowed).
Open

func (ret *GroupMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
    // Validate configuration
    zero := Group{}
    whitelist, err := util.WhitelistAttrs(zero, util.YAML)
    if err != nil {
Severity: Major
Found in resource/resource_list.go - About 35 mins to fix

    Method InterfaceMap.UnmarshalYAML has 5 return statements (exceeds 4 allowed).
    Open

    func (ret *InterfaceMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
        // Validate configuration
        zero := Interface{}
        whitelist, err := util.WhitelistAttrs(zero, util.YAML)
        if err != nil {
    Severity: Major
    Found in resource/resource_list.go - About 35 mins to fix

      Method MatchingMap.UnmarshalYAML has 5 return statements (exceeds 4 allowed).
      Open

      func (ret *MatchingMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Matching{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/matching.go - About 35 mins to fix

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

        func (mr *MockAddrMockRecorder) Address() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Address", reflect.TypeOf((*MockAddr)(nil).Address))
        }
        Severity: Major
        Found in system/mock_system/system_addr_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockHTTPMockRecorder) HTTP() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HTTP", reflect.TypeOf((*MockHTTP)(nil).HTTP))
        }
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockHTTPMockRecorder) Body() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Body", reflect.TypeOf((*MockHTTP)(nil).Body))
        }
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockHTTPMockRecorder) Exists() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockHTTP)(nil).Exists))
        }
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockResourceMockRecorder) Exists() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockResource)(nil).Exists))
        }
        Severity: Major
        Found in system/mock_system/system_system_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockAddrMockRecorder) Reachable() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reachable", reflect.TypeOf((*MockAddr)(nil).Reachable))
        }
        Severity: Major
        Found in system/mock_system/system_addr_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockHTTPMockRecorder) Status() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Status", reflect.TypeOf((*MockHTTP)(nil).Status))
        }
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockAddrMockRecorder) Exists() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exists", reflect.TypeOf((*MockAddr)(nil).Exists))
        }
        Severity: Major
        Found in system/mock_system/system_addr_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_http_mock.go on lines 130..133
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (mr *MockHTTPMockRecorder) Headers() *gomock.Call {
            mr.mock.ctrl.T.Helper()
            return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Headers", reflect.TypeOf((*MockHTTP)(nil).Headers))
        }
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 8 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 44..47
        system/mock_system/system_addr_mock.go on lines 59..62
        system/mock_system/system_addr_mock.go on lines 74..77
        system/mock_system/system_http_mock.go on lines 46..49
        system/mock_system/system_http_mock.go on lines 61..64
        system/mock_system/system_http_mock.go on lines 76..79
        system/mock_system/system_http_mock.go on lines 91..94
        system/mock_system/system_system_mock.go on lines 45..48

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 102.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (m *MockHTTP) Exists() (bool, error) {
            m.ctrl.T.Helper()
            ret := m.ctrl.Call(m, "Exists")
            ret0, _ := ret[0].(bool)
            ret1, _ := ret[1].(error)
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 4 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 50..56
        system/mock_system/system_addr_mock.go on lines 65..71
        system/mock_system/system_http_mock.go on lines 52..58
        system/mock_system/system_system_mock.go on lines 36..42

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (m *MockAddr) Exists() (bool, error) {
            m.ctrl.T.Helper()
            ret := m.ctrl.Call(m, "Exists")
            ret0, _ := ret[0].(bool)
            ret1, _ := ret[1].(error)
        Severity: Major
        Found in system/mock_system/system_addr_mock.go and 4 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 65..71
        system/mock_system/system_http_mock.go on lines 52..58
        system/mock_system/system_http_mock.go on lines 82..88
        system/mock_system/system_system_mock.go on lines 36..42

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (m *MockHTTP) Status() (int, error) {
            m.ctrl.T.Helper()
            ret := m.ctrl.Call(m, "Status")
            ret0, _ := ret[0].(int)
            ret1, _ := ret[1].(error)
        Severity: Major
        Found in system/mock_system/system_http_mock.go and 4 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 50..56
        system/mock_system/system_addr_mock.go on lines 65..71
        system/mock_system/system_http_mock.go on lines 82..88
        system/mock_system/system_system_mock.go on lines 36..42

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (m *MockAddr) Reachable() (bool, error) {
            m.ctrl.T.Helper()
            ret := m.ctrl.Call(m, "Reachable")
            ret0, _ := ret[0].(bool)
            ret1, _ := ret[1].(error)
        Severity: Major
        Found in system/mock_system/system_addr_mock.go and 4 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 50..56
        system/mock_system/system_http_mock.go on lines 52..58
        system/mock_system/system_http_mock.go on lines 82..88
        system/mock_system/system_system_mock.go on lines 36..42

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        func (m *MockResource) Exists() (bool, error) {
            m.ctrl.T.Helper()
            ret := m.ctrl.Call(m, "Exists")
            ret0, _ := ret[0].(bool)
            ret1, _ := ret[1].(error)
        Severity: Major
        Found in system/mock_system/system_system_mock.go and 4 other locations - About 30 mins to fix
        system/mock_system/system_addr_mock.go on lines 50..56
        system/mock_system/system_addr_mock.go on lines 65..71
        system/mock_system/system_http_mock.go on lines 52..58
        system/mock_system/system_http_mock.go on lines 82..88

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language