SimonBaeumer/goss

View on GitHub

Showing 157 of 157 total issues

Function ValidateValue has 80 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func ValidateValue(res ResourceRead, property string, expectedValue interface{}, actual interface{}, skip bool) TestResult {
    format.TruncatedDiff = false
    id := res.ID()
    title := res.GetTitle()
    meta := res.GetMeta()
Severity: Major
Found in resource/validate.go - About 2 hrs to fix

    Method Add.AddResource has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
    Open

    func (a *Add) AddResource(fileName string, gossConfig GossConfig, resourceName, key string, config util.Config) error {
        // Need to figure out a good way to refactor this
        switch resourceName {
        case "addr":
            res, err := gossConfig.Addrs.AppendSysResource(key, a.Sys, config)
    Severity: Minor
    Found in add.go - About 2 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 15 locations. Consider refactoring.
    Open

    func (r PortMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Port, system.Port, bool) {
        sysres := sys.NewPort(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewPort(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r InterfaceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Interface, system.Interface, bool) {
        sysres := sys.NewInterface(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewInterface(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r HTTPMap) AppendSysResourceIfExists(sr string, sys *system.System) (*HTTP, system.HTTP, bool) {
        sysres := sys.NewHTTP(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewHTTP(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r ResourceTypeMap) AppendSysResourceIfExists(sr string, sys *system.System) (*ResourceType, system.ResourceType, bool) {
        sysres := sys.NewResourceType(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewResourceType(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list_genny.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465

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

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

    func (r AddrMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Addr, system.Addr, bool) {
        sysres := sys.NewAddr(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewAddr(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r GossfileMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Gossfile, system.Gossfile, bool) {
        sysres := sys.NewGossfile(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewGossfile(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r GroupMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Group, system.Group, bool) {
        sysres := sys.NewGroup(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewGroup(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r ServiceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Service, system.Service, bool) {
        sysres := sys.NewService(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewService(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r KernelParamMap) AppendSysResourceIfExists(sr string, sys *system.System) (*KernelParam, system.KernelParam, bool) {
        sysres := sys.NewKernelParam(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewKernelParam(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r ProcessMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Process, system.Process, bool) {
        sysres := sys.NewProcess(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewProcess(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r CommandMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Command, system.Command, bool) {
        sysres := sys.NewCommand(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewCommand(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r MountMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Mount, system.Mount, bool) {
        sysres := sys.NewMount(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewMount(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r DNSMap) AppendSysResourceIfExists(sr string, sys *system.System) (*DNS, system.DNS, bool) {
        sysres := sys.NewDNS(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewDNS(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r FileMap) AppendSysResourceIfExists(sr string, sys *system.System) (*File, system.File, bool) {
        sysres := sys.NewFile(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewFile(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1038..1051
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

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

    func (r UserMap) AppendSysResourceIfExists(sr string, sys *system.System) (*User, system.User, bool) {
        sysres := sys.NewUser(sr, sys, util.Config{})
        // FIXME: Do we want to be silent about errors?
        res, _ := NewUser(sysres, util.Config{})
        if e, _ := sysres.Exists(); e != true {
    Severity: Major
    Found in resource/resource_list.go and 14 other locations - About 2 hrs to fix
    resource/resource_list.go on lines 38..51
    resource/resource_list.go on lines 138..151
    resource/resource_list.go on lines 238..251
    resource/resource_list.go on lines 338..351
    resource/resource_list.go on lines 438..451
    resource/resource_list.go on lines 538..551
    resource/resource_list.go on lines 738..751
    resource/resource_list.go on lines 838..851
    resource/resource_list.go on lines 938..951
    resource/resource_list.go on lines 1138..1151
    resource/resource_list.go on lines 1238..1251
    resource/resource_list.go on lines 1338..1351
    resource/resource_list.go on lines 1452..1465
    resource/resource_list_genny.go on lines 38..51

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

    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 LookupAAAA(host string, server string, c *dns.Client, m *dns.Msg) (addrs []string, err error) {
        m.SetQuestion(dns.Fqdn(host), dns.TypeAAAA)
        r, _, err := c.Exchange(m, net.JoinHostPort(server, "53"))
        if err != nil {
            return nil, err
    Severity: Major
    Found in system/dns.go and 1 other location - About 1 hr to fix
    system/dns.go on lines 194..208

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

    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 LookupA(host string, server string, c *dns.Client, m *dns.Msg) (addrs []string, err error) {
        m.SetQuestion(dns.Fqdn(host), dns.TypeA)
        r, _, err := c.Exchange(m, net.JoinHostPort(server, "53"))
        if err != nil {
            return nil, err
    Severity: Major
    Found in system/dns.go and 1 other location - About 1 hr to fix
    system/dns.go on lines 211..225

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

    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 createValidateCommand has 70 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func createValidateCommand(app *cli.App) cli.Command {
        startTime := time.Now()
    
        return cli.Command{
            Name:    "validate",
    Severity: Minor
    Found in cmd/goss/goss.go - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language