evalphobia/aws-sdk-go-v2-wrapper

View on GitHub
ses/type.go

Summary

Maintainability
B
5 hrs
Test Coverage

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

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

    if r.TemplateName != "" {
        o.TemplateName = pointers.String(r.TemplateName)
Severity: Major
Found in ses/type.go and 2 other locations - About 1 hr to fix
pinpoint/type_campaign.go on lines 104..120
pinpoint/type_campaign.go on lines 213..229

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

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

func newTemplate(o *SDK.Template) Template {
    result := Template{}
    if o == nil {
        return result
    }
Severity: Major
Found in ses/type.go and 3 other locations - About 1 hr to fix
dynamodb/type.go on lines 942..961
pinpoint/type_campaign.go on lines 83..102
pinpoint/type_campaign.go on lines 192..211

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

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 MessageTag) ToSDK() SDK.MessageTag {
    o := SDK.MessageTag{}

    if r.Name != "" {
        o.Name = pointers.String(r.Name)
Severity: Major
Found in ses/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
sqs/type.go on lines 100..110
ssm/type.go on lines 220..230

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

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

func newBulkEmailDestinationStatus(o SDK.BulkEmailDestinationStatus) BulkEmailDestinationStatus {
    result := BulkEmailDestinationStatus{}

    if o.Error != nil {
        result.Error = *o.Error
Severity: Minor
Found in ses/type.go and 1 other location - About 40 mins to fix
s3/type.go on lines 734..745

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

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

func newTemplateMetadata(o *SDK.TemplateMetadata) TemplateMetadata {
    result := TemplateMetadata{}
    if o == nil {
        return result
    }
Severity: Major
Found in ses/type.go and 6 other locations - About 40 mins to fix
athena/type.go on lines 111..124
pinpoint/type_campaign.go on lines 644..657
pinpoint/type_campaign.go on lines 764..777
pinpoint/type_segment.go on lines 311..324
pinpoint/type_template.go on lines 228..241
s3/type.go on lines 644..657

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

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 Destination should have comment or be unexported
Open

type Destination struct {
Severity: Minor
Found in ses/type.go by golint

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

func (r Template) ToSDK() *SDK.Template {
Severity: Minor
Found in ses/type.go by golint

exported type BulkEmailDestinationStatus should have comment or be unexported
Open

type BulkEmailDestinationStatus struct {
Severity: Minor
Found in ses/type.go by golint

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

func (r Destination) ToSDK() *SDK.Destination {
Severity: Minor
Found in ses/type.go by golint

exported type Template should have comment or be unexported
Open

type Template struct {
Severity: Minor
Found in ses/type.go by golint

exported type MessageTag should have comment or be unexported
Open

type MessageTag struct {
Severity: Minor
Found in ses/type.go by golint

exported type TemplateMetadata should have comment or be unexported
Open

type TemplateMetadata struct {
Severity: Minor
Found in ses/type.go by golint

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

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

exported type BulkEmailDestination should have comment or be unexported
Open

type BulkEmailDestination struct {
Severity: Minor
Found in ses/type.go by golint

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

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

There are no issues that match your filters.

Category
Status