jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

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

func (m *DeploymentOperationProperties) validateResponse(formats strfmt.Registry) error {

    if swag.IsZero(m.Response) { // not required
        return nil
    }
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *ResourceGroup) validateProperties(formats strfmt.Registry) error {

    if swag.IsZero(m.Properties) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/resource_group.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *TagDetails) validateCount(formats strfmt.Registry) error {

    if swag.IsZero(m.Count) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/tag_details.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *DeploymentOperationProperties) validateRequest(formats strfmt.Registry) error {

    if swag.IsZero(m.Request) { // not required
        return nil
    }
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *DeploymentOperationProperties) validateTargetResource(formats strfmt.Registry) error {

    if swag.IsZero(m.TargetResource) { // not required
        return nil
    }
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *GenericResource) validatePlan(formats strfmt.Registry) error {

    if swag.IsZero(m.Plan) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/generic_resource.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

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

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

func (m *TagValue) validateCount(formats strfmt.Registry) error {

    if swag.IsZero(m.Count) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/tag_value.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69

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

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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

Severity: Major
Found in cloud/azure/compute/models/api_error_base.go and 4 other locations - About 1 hr to fix
cloud/azure/compute/models/sku.go on lines 1..34
cloud/azure/resource/models/basic_dependency.go on lines 1..34
cloud/azure/resource/models/generic_resource_filter.go on lines 1..34
cloud/azure/resource/models/target_resource.go on lines 1..34

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

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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

Severity: Major
Found in cloud/azure/resource/models/generic_resource_filter.go and 4 other locations - About 1 hr to fix
cloud/azure/compute/models/api_error_base.go on lines 1..34
cloud/azure/compute/models/sku.go on lines 1..34
cloud/azure/resource/models/basic_dependency.go on lines 1..34
cloud/azure/resource/models/target_resource.go on lines 1..34

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

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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

Severity: Major
Found in cloud/azure/compute/models/sku.go and 4 other locations - About 1 hr to fix
cloud/azure/compute/models/api_error_base.go on lines 1..34
cloud/azure/resource/models/basic_dependency.go on lines 1..34
cloud/azure/resource/models/generic_resource_filter.go on lines 1..34
cloud/azure/resource/models/target_resource.go on lines 1..34

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

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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

Severity: Major
Found in cloud/azure/resource/models/target_resource.go and 4 other locations - About 1 hr to fix
cloud/azure/compute/models/api_error_base.go on lines 1..34
cloud/azure/compute/models/sku.go on lines 1..34
cloud/azure/resource/models/basic_dependency.go on lines 1..34
cloud/azure/resource/models/generic_resource_filter.go on lines 1..34

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

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

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

Severity: Major
Found in cloud/azure/resource/models/basic_dependency.go and 4 other locations - About 1 hr to fix
cloud/azure/compute/models/api_error_base.go on lines 1..34
cloud/azure/compute/models/sku.go on lines 1..34
cloud/azure/resource/models/generic_resource_filter.go on lines 1..34
cloud/azure/resource/models/target_resource.go on lines 1..34

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

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

func TestCmdResultDelete(t *testing.T) {

    var err error
    files := []string{
        "roadie://result/instance1/stdout1.txt",
Severity: Minor
Found in command/result_test.go - About 1 hr to fix

    Function cmdInit has 53 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func cmdInit(m *Metadata) (err error) {
    
        if m.Config == nil {
            m.Config = new(config.Config)
        }
    Severity: Minor
    Found in command/init.go - About 1 hr to fix

      Method optDataPut.run has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
      Open

      func (o *optDataPut) run() (err error) {
      
          filenames, err := filepath.Glob(o.Filename)
          if err != nil {
              return
      Severity: Minor
      Found in command/data.go - About 1 hr 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

      Method PoolListParams.WriteToRequest has 11 return statements (exceeds 4 allowed).
      Open

      func (o *PoolListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
      
          r.SetTimeout(o.requestTimeout)
          var res []error
      
      
      Severity: Major
      Found in cloud/azure/batch/client/pools/pool_list_parameters.go - About 1 hr to fix

        Method PoolListPoolUsageMetricsParams.WriteToRequest has 11 return statements (exceeds 4 allowed).
        Open

        func (o *PoolListPoolUsageMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
        
            r.SetTimeout(o.requestTimeout)
            var res []error
        
        

          Method ComputeNodeUpdateUserParams.WriteToRequest has 11 return statements (exceeds 4 allowed).
          Open

          func (o *ComputeNodeUpdateUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
          
              r.SetTimeout(o.requestTimeout)
              var res []error
          
          

            Method JobListPreparationAndReleaseTaskStatusParams.WriteToRequest has 11 return statements (exceeds 4 allowed).
            Open

            func (o *JobListPreparationAndReleaseTaskStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
            
                r.SetTimeout(o.requestTimeout)
                var res []error
            
            

              Method ComputeNodeRebootParams.WriteToRequest has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
              Open

              func (o *ComputeNodeRebootParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
              
                  r.SetTimeout(o.requestTimeout)
                  var res []error
              
              

              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