jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

Similar blocks of code found in 10 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/subscriptions/models/location_list_result.go and 9 other locations - About 4 hrs to fix
cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..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 321.

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 10 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

cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 10 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

cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 10 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

cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 10 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/win_r_m_configuration.go and 9 other locations - About 4 hrs to fix
cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 10 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/cloud_task_list_subtasks_result.go and 9 other locations - About 4 hrs to fix
cloud/azure/batch/models/task_add_collection_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 10 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/task_add_collection_result.go and 9 other locations - About 4 hrs to fix
cloud/azure/batch/models/cloud_task_list_subtasks_result.go on lines 1..58
cloud/azure/compute/models/availability_set_list_result.go on lines 1..58
cloud/azure/compute/models/network_profile.go on lines 1..58
cloud/azure/compute/models/ssh_configuration.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_extension_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_scale_set_network_profile.go on lines 1..58
cloud/azure/compute/models/virtual_machine_size_list_result.go on lines 1..58
cloud/azure/compute/models/win_r_m_configuration.go on lines 1..58
cloud/azure/subscriptions/models/location_list_result.go on lines 1..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 321.

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 *CloudJobSchedule) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateExecutionInfo(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/cloud_job_schedule.go and 5 other locations - About 4 hrs to fix
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/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 *VirtualMachineProperties) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateAvailabilitySet(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/compute/models/virtual_machine_properties.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/o_s_disk.go on lines 50..92
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 *ComputeNode) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateCertificateReferences(formats); err != nil {
        // prop
Severity: Major
Found in cloud/azure/batch/models/compute_node.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/pool_usage_metrics.go on lines 49..91
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 *VirtualMachineScaleSetVMProperties) Validate(formats strfmt.Registry) error {
    var res []error

    if err := m.validateAvailabilitySet(formats); err != nil {
        // prop
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/o_s_disk.go on lines 50..92
cloud/azure/compute/models/virtual_machine_properties.go on lines 52..94

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 *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

Method mockStorageAccountServer.ServeHTTP has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
Open

func (m *mockStorageAccountServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {

    paths := strings.Split(strings.TrimPrefix(req.URL.Path, "/"), "/")
    if len(paths) < 2 {
        res.WriteHeader(http.StatusBadRequest)
Severity: Minor
Found in cloud/azure/storage_test.go - About 4 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

Function TestPrintDirList has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
Open

func TestPrintDirList(t *testing.T) {

    var err error
    var output bytes.Buffer
    files := []string{
Severity: Minor
Found in command/table_test.go - About 3 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

TaskGetParams has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

type TaskGetParams struct {

    /*NrDollarExpand
      An OData $expand clause.

Severity: Minor
Found in cloud/azure/batch/client/tasks/task_get_parameters.go - About 3 hrs to fix

    File commands.go has 573 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    //
    // commands.go
    //
    // Copyright (c) 2016-2017 Junpei Kawamoto
    //
    Severity: Minor
    Found in commands.go - About 3 hrs to fix

      Function TestCmdInit has 117 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestCmdInit(t *testing.T) {
      
          var err error
          var output bytes.Buffer
          m := testMetadata(&output, nil)
      Severity: Major
      Found in command/init_test.go - About 3 hrs to fix

        Method BatchService.CreateJob has 117 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (s *BatchService) CreateJob(ctx context.Context, name string) (err error) {
        
            // 1. Check metadata, if error returns, it means no app exists, then upload.
            // 2. If version metadata is old or snapshot, upload new version.
            // 3. otherwise create url and use it.
        Severity: Major
        Found in cloud/azure/batch.go - About 3 hrs to fix

          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

          Severity
          Category
          Status
          Source
          Language