SimonBaeumer/goss

View on GitHub

Showing 157 of 157 total issues

Method Add.AddResource has 110 lines of code (exceeds 50 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: Major
Found in add.go - About 3 hrs to fix

    Function matcherToGomegaMatcher has 99 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func matcherToGomegaMatcher(matcher interface{}) (types.GomegaMatcher, error) {
        switch x := matcher.(type) {
        case string, int, bool, float64:
            return gomega.Equal(x), nil
        case []interface{}:
    Severity: Major
    Found in resource/gomega.go - About 2 hrs to fix

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

      func (ret *DNSMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := DNS{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *KernelParamMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := KernelParam{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

      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 17 locations. Consider refactoring.
      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 and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *AddrMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Addr{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *CommandMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Command{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *PackageMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Package{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *ProcessMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Process{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *GossfileMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Gossfile{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

      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 17 locations. Consider refactoring.
      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 and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *HTTPMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := HTTP{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list_genny.go on lines 90..117

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

      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 17 locations. Consider refactoring.
      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 and 16 other locations - About 2 hrs to fix
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *PortMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Port{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *FileMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := File{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *ResourceTypeMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := ResourceType{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list_genny.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531

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

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

      func (ret *ServiceMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Service{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *UserMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := User{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1290..1317
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

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

      func (ret *MountMap) UnmarshalYAML(unmarshal func(v interface{}) error) error {
          // Validate configuration
          zero := Mount{}
          whitelist, err := util.WhitelistAttrs(zero, util.YAML)
          if err != nil {
      Severity: Major
      Found in resource/resource_list.go and 16 other locations - About 2 hrs to fix
      resource/matching.go on lines 80..107
      resource/resource_list.go on lines 90..117
      resource/resource_list.go on lines 190..217
      resource/resource_list.go on lines 290..317
      resource/resource_list.go on lines 390..417
      resource/resource_list.go on lines 490..517
      resource/resource_list.go on lines 590..617
      resource/resource_list.go on lines 690..717
      resource/resource_list.go on lines 790..817
      resource/resource_list.go on lines 890..917
      resource/resource_list.go on lines 990..1017
      resource/resource_list.go on lines 1090..1117
      resource/resource_list.go on lines 1190..1217
      resource/resource_list.go on lines 1390..1417
      resource/resource_list.go on lines 1504..1531
      resource/resource_list_genny.go on lines 90..117

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

      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 matcherToGomegaMatcher has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
      Open

      func matcherToGomegaMatcher(matcher interface{}) (types.GomegaMatcher, error) {
          switch x := matcher.(type) {
          case string, int, bool, float64:
              return gomega.Equal(x), nil
          case []interface{}:
      Severity: Minor
      Found in resource/gomega.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

      Severity
      Category
      Status
      Source
      Language