jkawamoto/roadie

View on GitHub

Showing 602 of 2,161 total issues

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

func TestQueueManager(t *testing.T) {

    ctx := context.Background()
    p := NewProvider()
    m, err := p.QueueManager(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 75..96
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 TestInstanceManager(t *testing.T) {

    ctx := context.Background()
    p := NewProvider()
    m, err := p.InstanceManager(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 52..73
cloud/mock/provider_test.go on lines 75..96
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 2 locations. Consider refactoring.
Open

        if c.quiet {

            files := make(map[string]struct{})
            scanner := bufio.NewScanner(&output)
            for scanner.Scan() {
Severity: Major
Found in command/table_test.go and 1 other location - About 1 hr to fix
command/table_test.go on lines 72..123

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

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

        if c.quiet {

            files := make(map[string]struct{})
            scanner := bufio.NewScanner(&output)
            for scanner.Scan() {
Severity: Major
Found in command/table_test.go and 1 other location - About 1 hr to fix
command/table_test.go on lines 172..212

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

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 CmdConfigRegionSet(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/config.go and 5 other locations - About 1 hr to fix
command/config.go on lines 51..69
command/config.go on lines 145..162
command/queue.go on lines 309..326
command/queue.go on lines 385..403
command/queue.go on lines 417..434

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

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 CmdQueueStop(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/queue.go and 5 other locations - About 1 hr to fix
command/config.go on lines 51..69
command/config.go on lines 145..162
command/config.go on lines 292..309
command/queue.go on lines 309..326
command/queue.go on lines 417..434

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

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 CmdQueueInstanceList(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/queue.go and 5 other locations - About 1 hr to fix
command/config.go on lines 51..69
command/config.go on lines 145..162
command/config.go on lines 292..309
command/queue.go on lines 385..403
command/queue.go on lines 417..434

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

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 CmdConfigProjectSet(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/config.go and 5 other locations - About 1 hr to fix
command/config.go on lines 145..162
command/config.go on lines 292..309
command/queue.go on lines 309..326
command/queue.go on lines 385..403
command/queue.go on lines 417..434

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

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 CmdQueueRestart(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/queue.go and 5 other locations - About 1 hr to fix
command/config.go on lines 51..69
command/config.go on lines 145..162
command/config.go on lines 292..309
command/queue.go on lines 309..326
command/queue.go on lines 385..403

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

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 CmdConfigMachineTypeSet(c *cli.Context) (err error) {

    if c.NArg() != 1 {
        fmt.Printf("expected 1 argument. (%d given)\n", c.NArg())
        return cli.ShowSubcommandHelp(c)
Severity: Major
Found in command/config.go and 5 other locations - About 1 hr to fix
command/config.go on lines 51..69
command/config.go on lines 292..309
command/queue.go on lines 309..326
command/queue.go on lines 385..403
command/queue.go on lines 417..434

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

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

            if c.url {
                urls := make(map[string]string)
                for _, line := range res[1:] {
                    items := strings.Split(line, "\t")
                    urls[strings.TrimSpace(items[0])] = strings.TrimSpace(items[len(items)-1])
Severity: Major
Found in command/table_test.go and 1 other location - About 1 hr to fix
command/table_test.go on lines 199..210

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

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

            if c.url {
                urls := make(map[string]string)
                for _, line := range res[1:] {
                    items := strings.Split(line, "\t")
                    urls[strings.TrimSpace(items[0])] = strings.TrimSpace(items[len(items)-1])
Severity: Major
Found in command/table_test.go and 1 other location - About 1 hr to fix
command/table_test.go on lines 110..121

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

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

Identical blocks of code found in 2 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/plan.go and 1 other location - About 1 hr to fix
cloud/azure/resource/models/plan.go on lines 1..37

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

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

Identical blocks of code found in 2 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/plan.go and 1 other location - About 1 hr to fix
cloud/azure/compute/models/plan.go on lines 1..37

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

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 (m *InstanceManager) AvailableRegions(ctx context.Context) (regions []cloud.Region, err error) {

    m.Logger.Println("Retrieving available regions")
    regions, err = Locations(ctx, &m.Config.Token, m.Config.SubscriptionID)
    if err != nil {
Severity: Major
Found in cloud/azure/instance.go and 1 other location - About 1 hr to fix
cloud/azure/compute.go on lines 76..85

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

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 *ComputeService) AvailableRegions(ctx context.Context) (regions []cloud.Region, err error) {
    s.Logger.Println("Retrieving available regions")
    regions, err = Locations(ctx, &s.Config.Token, s.Config.SubscriptionID)
    if err != nil {
        s.Logger.Println("Cannot retrieve available regions")
Severity: Major
Found in cloud/azure/compute.go and 1 other location - About 1 hr to fix
cloud/azure/instance.go on lines 112..123

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

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

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

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

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

Refactorings

Further Reading

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

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

    if swag.IsZero(m.Properties) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_extended.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

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

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

    if swag.IsZero(m.Error) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_validate_result.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

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

func (m *ResourceGroupExportResult) validateError(formats strfmt.Registry) error {

    if swag.IsZero(m.Error) { // not required
        return nil
    }
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation.go on lines 44..61
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

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

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

    if swag.IsZero(m.Properties) { // not required
        return nil
    }
Severity: Major
Found in cloud/azure/resource/models/deployment_operation.go and 19 other locations - About 1 hr to fix
cloud/azure/resource/models/deployment_extended.go on lines 58..75
cloud/azure/resource/models/deployment_operation_properties.go on lines 75..92
cloud/azure/resource/models/deployment_operation_properties.go on lines 94..111
cloud/azure/resource/models/deployment_operation_properties.go on lines 113..130
cloud/azure/resource/models/deployment_properties.go on lines 70..87
cloud/azure/resource/models/deployment_properties.go on lines 130..147
cloud/azure/resource/models/deployment_properties.go on lines 149..166
cloud/azure/resource/models/deployment_properties_extended.go on lines 101..118
cloud/azure/resource/models/deployment_properties_extended.go on lines 188..205
cloud/azure/resource/models/deployment_properties_extended.go on lines 234..251
cloud/azure/resource/models/deployment_validate_result.go on lines 44..61
cloud/azure/resource/models/deployment_validate_result.go on lines 63..80
cloud/azure/resource/models/generic_resource.go on lines 98..115
cloud/azure/resource/models/generic_resource.go on lines 130..147
cloud/azure/resource/models/generic_resource.go on lines 149..166
cloud/azure/resource/models/resource_group.go on lines 68..85
cloud/azure/resource/models/resource_group_export_result.go on lines 39..56
cloud/azure/resource/models/tag_details.go on lines 52..69
cloud/azure/resource/models/tag_value.go on lines 42..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 139.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language