jkawamoto/roadie

View on GitHub

Showing 602 of 2,161 total issues

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

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

    if swag.IsZero(m.Properties) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_validate_result.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/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 *DeploymentPropertiesExtended) validateParametersLink(formats strfmt.Registry) error {

    if swag.IsZero(m.ParametersLink) { // 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_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 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 *DeploymentProperties) validateParametersLink(formats strfmt.Registry) error {

    if swag.IsZero(m.ParametersLink) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_properties.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 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) validateSku(formats strfmt.Registry) error {

    if swag.IsZero(m.Sku) { // 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 130..147
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 2 locations. Consider refactoring.
Open

    t.Run("delete the last task", func(t *testing.T) {
        err = m.DeleteTask(ctx, indexedName(queueBase, 2), indexedName(task.Name, 2))
        if err != nil {
            t.Fatalf("DeleteTasks returns an error: %v", err)
        }
Severity: Major
Found in cloud/mock/queue_test.go and 1 other location - About 1 hr to fix
cloud/mock/queue_test.go on lines 727..737

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 *DeploymentProperties) validateDebugSetting(formats strfmt.Registry) error {

    if swag.IsZero(m.DebugSetting) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_properties.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 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) validateIdentity(formats strfmt.Registry) error {

    if swag.IsZero(m.Identity) { // 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 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 *DeploymentPropertiesExtended) validateDebugSetting(formats strfmt.Registry) error {

    if swag.IsZero(m.DebugSetting) { // 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_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 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 2 locations. Consider refactoring.
Open

    t.Run("delete the first task", func(t *testing.T) {
        err = m.DeleteTask(ctx, indexedName(queueBase, 5), indexedName(task.Name, 0))
        if err != nil {
            t.Fatalf("DeleteTasks returns an error: %v", err)
        }
Severity: Major
Found in cloud/mock/queue_test.go and 1 other location - About 1 hr to fix
cloud/mock/queue_test.go on lines 739..749

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

func (m *DeploymentProperties) validateTemplateLink(formats strfmt.Registry) error {

    if swag.IsZero(m.TemplateLink) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_properties.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_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) 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 *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 *DeploymentPropertiesExtended) validateTemplateLink(formats strfmt.Registry) error {

    if swag.IsZero(m.TemplateLink) { // 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_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_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 *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 *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 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/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

Severity
Category
Status
Source
Language