jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

Method ComputeService.createInstance has 86 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (s *ComputeService) createInstance(ctx context.Context, instanceName string, matadataItems []*compute.MetadataItems) (err error) {

    s.Logger.Println("Creating instance", instanceName)
    service, err := s.newService(ctx)
    if err != nil {
Severity: Major
Found in cloud/gcp/instance.go - About 2 hrs to fix

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

    func (o *FileGetFromTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        r.SetTimeout(o.requestTimeout)
        var res []error
    
    
    Severity: Minor
    Found in cloud/azure/batch/client/files/file_get_from_task_parameters.go - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

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

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

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

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    func (m *PoolUpdatePropertiesParameter) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateApplicationPackageReferences(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/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 *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 *StartTaskInformation) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateRetryCount(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/batch/models/start_task_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/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 *JobPreparationTaskExecutionInformation) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateRetryCount(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_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 *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 *JobPreparationTask) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateCommandLine(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/batch/models/job_preparation_task.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_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 *Usage) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateCurrentValue(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/compute/models/usage.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/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 *PoolPatchParameter) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateApplicationPackageReferences(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/batch/models/pool_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_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_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 *ImageDataDisk) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateCaching(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/compute/models/image_data_disk.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/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 *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 *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 18 locations. Consider refactoring.
    Open

    func (m *JobScheduleAddParameter) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateID(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/batch/models/job_schedule_add_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_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 *CertificateReference) Validate(formats strfmt.Registry) error {
        var res []error
    
        if err := m.validateStoreLocation(formats); err != nil {
            // prop
    Severity: Major
    Found in cloud/azure/batch/models/certificate_reference.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/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 *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

    Severity
    Category
    Status
    Source
    Language