evalphobia/aws-sdk-go-v2-wrapper

View on GitHub
ssm/type.go

Summary

Maintainability
A
1 hr
Test Coverage

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

func newParameterInlinePolicy(o *SDK.ParameterInlinePolicy) ParameterInlinePolicy {
    result := ParameterInlinePolicy{}
    if o == nil {
        return result
    }
Severity: Major
Found in ssm/type.go and 4 other locations - About 1 hr to fix
dynamodb/type.go on lines 18..34
dynamodb/type.go on lines 361..377
pinpoint/type_template.go on lines 94..111
s3/type.go on lines 450..466

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

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

func (r Tag) ToSDK() SDK.Tag {
    o := SDK.Tag{}

    if r.Key != "" {
        o.Key = pointers.String(r.Key)
Severity: Major
Found in ssm/type.go and 9 other locations - About 40 mins to fix
dynamodb/type.go on lines 1133..1143
pinpoint/type_segment.go on lines 326..336
pinpointemail/type.go on lines 14..24
pinpointemail/type.go on lines 26..36
s3/type.go on lines 574..584
s3/type.go on lines 659..669
s3/type.go on lines 704..714
ses/type.go on lines 87..97
sqs/type.go on lines 100..110

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

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

exported type ParameterHistory should have comment or be unexported
Open

type ParameterHistory struct {
Severity: Minor
Found in ssm/type.go by golint

exported type Tag should have comment or be unexported
Open

type Tag struct {
Severity: Minor
Found in ssm/type.go by golint

exported type ParameterInlinePolicy should have comment or be unexported
Open

type ParameterInlinePolicy struct {
Severity: Minor
Found in ssm/type.go by golint

exported method ParameterStringFilter.ToSDK should have comment or be unexported
Open

func (v ParameterStringFilter) ToSDK() SDK.ParameterStringFilter {
Severity: Minor
Found in ssm/type.go by golint

exported type Parameter should have comment or be unexported
Open

type Parameter struct {
Severity: Minor
Found in ssm/type.go by golint

exported method Tag.ToSDK should have comment or be unexported
Open

func (r Tag) ToSDK() SDK.Tag {
Severity: Minor
Found in ssm/type.go by golint

exported type ParameterMetadata should have comment or be unexported
Open

type ParameterMetadata struct {
Severity: Minor
Found in ssm/type.go by golint

exported type ParameterStringFilter should have comment or be unexported
Open

type ParameterStringFilter struct {
Severity: Minor
Found in ssm/type.go by golint

There are no issues that match your filters.

Category
Status