jkawamoto/roadie

View on GitHub

Showing 602 of 2,161 total issues

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

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

    if err := m.validateCaching(formats); err != nil {
        // prop
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateCertificateFormat(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/certificate_add_parameter.go and 17 other locations - About 2 hrs to fix
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateDebugSetting(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/resource/models/deployment_properties.go and 17 other locations - About 2 hrs to fix
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58

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

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

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

    if err := m.validateNodeInfo(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/subtask_information.go and 17 other locations - About 2 hrs to fix
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateConstraints(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/job_update_parameter.go and 17 other locations - About 2 hrs to fix
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateConstraints(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/job_patch_parameter.go and 17 other locations - About 2 hrs to fix
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateApplicationGatewayBackendAddressPools(formats); err != nil {
        // prop
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_vm_profile.go on lines 31..58
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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

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

    if err := m.validateExtensionProfile(formats); err != nil {
        // prop
cloud/azure/batch/models/certificate_add_parameter.go on lines 42..69
cloud/azure/batch/models/certificate_reference.go on lines 46..73
cloud/azure/batch/models/exit_conditions.go on lines 33..60
cloud/azure/batch/models/job_patch_parameter.go on lines 47..74
cloud/azure/batch/models/job_preparation_task.go on lines 55..82
cloud/azure/batch/models/job_preparation_task_execution_information.go on lines 62..89
cloud/azure/batch/models/job_schedule_add_parameter.go on lines 44..71
cloud/azure/batch/models/job_update_parameter.go on lines 48..75
cloud/azure/batch/models/pool_patch_parameter.go on lines 39..66
cloud/azure/batch/models/pool_update_properties_parameter.go on lines 43..70
cloud/azure/batch/models/start_task_information.go on lines 58..85
cloud/azure/batch/models/subtask_information.go on lines 60..87
cloud/azure/compute/models/image_data_disk.go on lines 41..68
cloud/azure/compute/models/usage.go on lines 37..64
cloud/azure/compute/models/virtual_machine_scale_set_data_disk.go on lines 40..67
cloud/azure/compute/models/virtual_machine_scale_set_ip_configuration_properties.go on lines 33..60
cloud/azure/resource/models/deployment_properties.go on lines 41..68

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

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 {

        tmp, err := ioutil.TempDir("", "")
        if err != nil {
            t.Fatalf("TempDir returns an error: %v", err)
Severity: Major
Found in command/helper_test.go and 1 other location - About 2 hrs to fix
command/result_test.go on lines 173..198

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

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 {

        tmp, err := ioutil.TempDir("", "TestCmdResultGet")
        if err != nil {
            t.Fatalf("TempDir returns an error: %v", err)
Severity: Major
Found in command/result_test.go and 1 other location - About 2 hrs to fix
command/helper_test.go on lines 157..182

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

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 (s *BatchService) GetJobInfo(ctx context.Context, job string) (info *models.CloudJob, err error) {

    s.Logger.Println("Retrieving information of job", job)
    res, err := s.client.Jobs.JobGet(
        jobs.NewJobGetParamsWithContext(ctx).
Severity: Major
Found in cloud/azure/batch.go and 1 other location - About 1 hr to fix
cloud/azure/batch.go on lines 326..343

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 183.

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

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

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

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

Refactorings

Further Reading

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

func (s *BatchService) GetPoolInfo(ctx context.Context, name string) (info *models.CloudPool, err error) {

    s.Logger.Println("Retrieving information of pool", name)
    res, err := s.client.Pools.PoolGet(
        pools.NewPoolGetParamsWithContext(ctx).
Severity: Major
Found in cloud/azure/batch.go and 1 other location - About 1 hr to fix
cloud/azure/batch.go on lines 650..667

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 183.

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

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

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

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

Refactorings

Further Reading

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

    t.Run("source option", func(t *testing.T) {
        s := testScript
        opt := SourceOpt{
            Source: "somefile",
        }
Severity: Major
Found in command/helper_test.go and 1 other location - About 1 hr to fix
command/helper_test.go on lines 408..425

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

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("local option", func(t *testing.T) {
        s := testScript
        opt := SourceOpt{
            Local: "util",
        }
Severity: Major
Found in command/helper_test.go and 1 other location - About 1 hr to fix
command/helper_test.go on lines 427..444

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

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 3 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/sku.go and 2 other locations - About 1 hr to fix
cloud/azure/batch/models/compute_node_information.go on lines 1..43
cloud/azure/compute/models/virtual_machine_size.go on lines 1..43

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

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 3 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/virtual_machine_size.go and 2 other locations - About 1 hr to fix
cloud/azure/batch/models/compute_node_information.go on lines 1..43
cloud/azure/resource/models/sku.go on lines 1..43

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

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 3 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/batch/models/compute_node_information.go and 2 other locations - About 1 hr to fix
cloud/azure/compute/models/virtual_machine_size.go on lines 1..43
cloud/azure/resource/models/sku.go on lines 1..43

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

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

func TestStorageManager(t *testing.T) {

    ctx := context.Background()
    p := NewProvider()
    m, err := p.StorageManager(ctx)
Severity: Major
Found in cloud/mock/provider_test.go and 4 other locations - About 1 hr to fix
cloud/mock/provider_test.go on lines 29..50
cloud/mock/provider_test.go on lines 52..73
cloud/mock/provider_test.go on lines 98..119
cloud/mock/provider_test.go on lines 121..142

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

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

func TestLogManager(t *testing.T) {

    ctx := context.Background()
    p := NewProvider()
    m, err := p.LogManager(ctx)
Severity: Major
Found in cloud/mock/provider_test.go and 4 other locations - About 1 hr to fix
cloud/mock/provider_test.go on lines 29..50
cloud/mock/provider_test.go on lines 52..73
cloud/mock/provider_test.go on lines 75..96
cloud/mock/provider_test.go on lines 121..142

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

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

func TestResouceManager(t *testing.T) {

    ctx := context.Background()
    p := NewProvider()
    m, err := p.ResourceManager(ctx)
Severity: Major
Found in cloud/mock/provider_test.go and 4 other locations - About 1 hr to fix
cloud/mock/provider_test.go on lines 29..50
cloud/mock/provider_test.go on lines 52..73
cloud/mock/provider_test.go on lines 75..96
cloud/mock/provider_test.go on lines 98..119

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

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