bjerkio/crayon-api-go

View on GitHub

Showing 450 of 602 total issues

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

func (m *ActivityLogItem) validateChangedDate(formats strfmt.Registry) error {

    if swag.IsZero(m.ChangedDate) { // not required
        return nil
    }
Severity: Major
Found in models/activity_log_item.go and 56 other locations - About 30 mins to fix
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *GroupedBillingStatement) validateStartDate(formats strfmt.Registry) error {

    if swag.IsZero(m.StartDate) { // not required
        return nil
    }
Severity: Major
Found in models/grouped_billing_statement.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *ResourceGroupUsageCostRequest) validateFrom(formats strfmt.Registry) error {

    if swag.IsZero(m.From) { // not required
        return nil
    }
Severity: Major
Found in models/resource_group_usage_cost_request.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *ProductVariant) validateAddDate(formats strfmt.Registry) error {

    if swag.IsZero(m.AddDate) { // not required
        return nil
    }
Severity: Major
Found in models/product_variant.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *AgreementProductFilter) validateSearchDate(formats strfmt.Registry) error {

    if swag.IsZero(m.SearchDate) { // not required
        return nil
    }
Severity: Major
Found in models/agreement_product_filter.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *SubscriptionUsageCostRequest) validateFrom(formats strfmt.Registry) error {

    if swag.IsZero(m.From) { // not required
        return nil
    }
Severity: Major
Found in models/subscription_usage_cost_request.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *SubscriptionDetailed) validateEffectiveStartDate(formats strfmt.Registry) error {

    if swag.IsZero(m.EffectiveStartDate) { // not required
        return nil
    }
Severity: Major
Found in models/subscription_detailed.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *SubscriptionDetailed) validateCreationDate(formats strfmt.Registry) error {

    if swag.IsZero(m.CreationDate) { // not required
        return nil
    }
Severity: Major
Found in models/subscription_detailed.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 340..351
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

func (m *Asset) validatePurchaseDate(formats strfmt.Registry) error {

    if swag.IsZero(m.PurchaseDate) { // not required
        return nil
    }
Severity: Major
Found in models/asset.go and 56 other locations - About 30 mins to fix
models/activity_log_item.go on lines 116..127
models/agreement.go on lines 184..195
models/agreement.go on lines 251..262
models/agreement_filter.go on lines 146..157
models/agreement_filter.go on lines 159..170
models/agreement_filter.go on lines 172..183
models/agreement_product_filter.go on lines 177..188
models/asset.go on lines 283..294
models/asset.go on lines 296..307
models/asset.go on lines 309..320
models/asset.go on lines 466..477
models/billing_statement.go on lines 84..95
models/billing_statement.go on lines 188..199
models/blog_item.go on lines 54..65
models/category_usage_cost_request.go on lines 59..70
models/category_usage_cost_request.go on lines 72..83
models/client.go on lines 146..157
models/customer_tenant_agreement.go on lines 110..121
models/facebook_order.go on lines 97..108
models/google_order.go on lines 121..132
models/grouped_billing_statement.go on lines 87..98
models/grouped_billing_statement.go on lines 191..202
models/grouping.go on lines 76..87
models/grouping.go on lines 107..118
models/organization_access.go on lines 178..189
models/product_container.go on lines 305..316
models/product_container.go on lines 397..408
models/product_container.go on lines 489..500
models/product_container.go on lines 502..513
models/product_container.go on lines 638..649
models/product_container_comment.go on lines 76..87
models/product_container_comment.go on lines 171..182
models/product_variant.go on lines 174..185
models/product_variant.go on lines 187..198
models/reseller_sales_price.go on lines 71..82
models/resource_group_usage_cost_request.go on lines 59..70
models/resource_group_usage_cost_request.go on lines 72..83
models/secret.go on lines 59..70
models/secret.go on lines 72..83
models/service_account_agreement.go on lines 104..115
models/subcategory_usage_cost_request.go on lines 62..73
models/subcategory_usage_cost_request.go on lines 75..86
models/subscription.go on lines 236..247
models/subscription.go on lines 267..278
models/subscription.go on lines 453..464
models/subscription_add_on.go on lines 98..109
models/subscription_detailed.go on lines 265..276
models/subscription_detailed.go on lines 278..289
models/subscription_detailed.go on lines 309..320
models/subscription_detailed.go on lines 322..333
models/subscription_detailed.go on lines 526..537
models/subscription_tags.go on lines 65..76
models/subscription_tags.go on lines 78..89
models/subscription_usage_cost_request.go on lines 56..67
models/subscription_usage_cost_request.go on lines 69..80
models/user.go on lines 72..83

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

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

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

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

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

Refactorings

Further Reading

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

const (

    // SubscriptionBillingCycleUnknown captures enum value "Unknown"
    SubscriptionBillingCycleUnknown string = "Unknown"

Severity: Minor
Found in models/subscription.go and 2 other locations - About 30 mins to fix
models/subscription_conversion.go on lines 68..96
models/subscription_detailed.go on lines 213..241

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

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