jkawamoto/roadie

View on GitHub

Showing 602 of 2,161 total issues

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

func (m *PoolUsageMetrics) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateDataEgressGiB(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/pool_usage_metrics.go and 5 other locations - About 4 hrs to fix
cloud/azure/batch/models/cloud_job_schedule.go on lines 79..121
cloud/azure/batch/models/compute_node.go on lines 88..130
cloud/azure/compute/models/o_s_disk.go on lines 50..92
cloud/azure/compute/models/virtual_machine_properties.go on lines 52..94
cloud/azure/compute/models/virtual_machine_scale_set_vm_properties.go on lines 56..98

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

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

func (m *OSDisk) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateCaching(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/compute/models/o_s_disk.go and 5 other locations - About 4 hrs to fix
cloud/azure/batch/models/cloud_job_schedule.go on lines 79..121
cloud/azure/batch/models/compute_node.go on lines 88..130
cloud/azure/batch/models/pool_usage_metrics.go on lines 49..91
cloud/azure/compute/models/virtual_machine_properties.go on lines 52..94
cloud/azure/compute/models/virtual_machine_scale_set_vm_properties.go on lines 56..98

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

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

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

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

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

Refactorings

Further Reading

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

func cmdConfigRegionSet(m *Metadata, region string) (err error) {

    resource, err := m.ResourceManager()
    if err != nil {
        return
Severity: Major
Found in command/config.go and 1 other location - About 3 hrs to fix
command/config.go on lines 166..203

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

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

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

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

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

Refactorings

Further Reading

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

func cmdConfigMachineTypeSet(m *Metadata, machineType string) (err error) {

    resource, err := m.ResourceManager()
    if err != nil {
        return
Severity: Major
Found in command/config.go and 1 other location - About 3 hrs to fix
command/config.go on lines 313..351

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

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

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

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

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

Refactorings

Further Reading

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

func TestCmdConfigMachineTypeShow(t *testing.T) {

    var err error
    var output bytes.Buffer
    p := mock.NewProvider()
Severity: Major
Found in command/config_test.go and 1 other location - About 3 hrs to fix
command/config_test.go on lines 453..490

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

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

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

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

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

Refactorings

Further Reading

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

func TestCmdConfigRegionShow(t *testing.T) {

    var err error
    var output bytes.Buffer
    p := mock.NewProvider()
Severity: Major
Found in command/config_test.go and 1 other location - About 3 hrs to fix
command/config_test.go on lines 282..319

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

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

func (m *DataDisk) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateCaching(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/compute/models/data_disk.go and 3 other locations - About 3 hrs to fix
cloud/azure/batch/models/job_manager_task.go on lines 66..103
cloud/azure/compute/models/virtual_machine_scale_set_o_s_disk.go on lines 44..81
cloud/azure/resource/models/deployment_properties_extended.go on lines 62..99

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

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

func (m *DeploymentPropertiesExtended) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateDebugSetting(formats); err != nil {
        // prop
cloud/azure/batch/models/job_manager_task.go on lines 66..103
cloud/azure/compute/models/data_disk.go on lines 46..83
cloud/azure/compute/models/virtual_machine_scale_set_o_s_disk.go on lines 44..81

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

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

func (m *VirtualMachineScaleSetOSDisk) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateCaching(formats); err != nil {
        // prop
cloud/azure/batch/models/job_manager_task.go on lines 66..103
cloud/azure/compute/models/data_disk.go on lines 46..83
cloud/azure/resource/models/deployment_properties_extended.go on lines 62..99

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

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

func (m *JobManagerTask) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateApplicationPackageReferences(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/job_manager_task.go and 3 other locations - About 3 hrs to fix
cloud/azure/compute/models/data_disk.go on lines 46..83
cloud/azure/compute/models/virtual_machine_scale_set_o_s_disk.go on lines 44..81
cloud/azure/resource/models/deployment_properties_extended.go on lines 62..99

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

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

    for _, c := range cases {

        err = cmdResultDelete(m, c.instance, c.queries)
        if err != nil {
            t.Fatalf("cmdResultDelete returns an error: %v", err)
Severity: Major
Found in command/result_test.go and 1 other location - About 3 hrs to fix
command/helper_test.go on lines 224..251

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

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

    for _, c := range cases {

        err = cmdDelete(m, c.container, c.queries)
        if err != nil {
            t.Fatalf("cmdDelete returns an error: %v", err)
Severity: Major
Found in command/helper_test.go and 1 other location - About 3 hrs to fix
command/result_test.go on lines 238..265

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) ResourcesCreateOrUpdate(params *ResourcesCreateOrUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ResourcesCreateOrUpdateOK, *ResourcesCreateOrUpdateCreated, *ResourcesCreateOrUpdateAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewResourcesCreateOrUpdateParams()
    }
Severity: Major
Found in cloud/azure/resource/client/resources/resources_client.go and 8 other locations - About 3 hrs to fix
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) VirtualMachinesDelete(params *VirtualMachinesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualMachinesDeleteOK, *VirtualMachinesDeleteAccepted, *VirtualMachinesDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewVirtualMachinesDeleteParams()
    }
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) VirtualMachineScaleSetVmsDelete(params *VirtualMachineScaleSetVmsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualMachineScaleSetVmsDeleteOK, *VirtualMachineScaleSetVmsDeleteAccepted, *VirtualMachineScaleSetVmsDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewVirtualMachineScaleSetVmsDeleteParams()
    }
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) VirtualMachineScaleSetsDelete(params *VirtualMachineScaleSetsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualMachineScaleSetsDeleteOK, *VirtualMachineScaleSetsDeleteAccepted, *VirtualMachineScaleSetsDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewVirtualMachineScaleSetsDeleteParams()
    }
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) ResourcesDeleteByID(params *ResourcesDeleteByIDParams, authInfo runtime.ClientAuthInfoWriter) (*ResourcesDeleteByIDOK, *ResourcesDeleteByIDAccepted, *ResourcesDeleteByIDNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewResourcesDeleteByIDParams()
    }
Severity: Major
Found in cloud/azure/resource/client/resources/resources_client.go and 8 other locations - About 3 hrs to fix
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) ResourcesDelete(params *ResourcesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ResourcesDeleteOK, *ResourcesDeleteAccepted, *ResourcesDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewResourcesDeleteParams()
    }
Severity: Major
Found in cloud/azure/resource/client/resources/resources_client.go and 8 other locations - About 3 hrs to fix
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) VirtualMachineExtensionsDelete(params *VirtualMachineExtensionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualMachineExtensionsDeleteOK, *VirtualMachineExtensionsDeleteAccepted, *VirtualMachineExtensionsDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewVirtualMachineExtensionsDeleteParams()
    }
cloud/azure/compute/client/images/images_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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

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

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

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

Refactorings

Further Reading

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

func (a *Client) ImagesDelete(params *ImagesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ImagesDeleteOK, *ImagesDeleteAccepted, *ImagesDeleteNoContent, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewImagesDeleteParams()
    }
Severity: Major
Found in cloud/azure/compute/client/images/images_client.go and 8 other locations - About 3 hrs to fix
cloud/azure/compute/client/virtual_machine_extensions/virtual_machine_extensions_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_client.go on lines 63..95
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_client.go on lines 98..130
cloud/azure/compute/client/virtual_machines/virtual_machines_client.go on lines 168..200
cloud/azure/resource/client/resources/resources_client.go on lines 86..118
cloud/azure/resource/client/resources/resources_client.go on lines 123..155
cloud/azure/resource/client/resources/resources_client.go on lines 160..192
cloud/azure/resource/client/resources/resources_client.go on lines 197..229

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

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