evalphobia/aws-sdk-go-v2-wrapper

View on GitHub
dynamodb/type.go

Summary

Maintainability
D
2 days
Test Coverage

File type.go has 1027 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package dynamodb

import (
    "fmt"
    "strconv"
Severity: Major
Found in dynamodb/type.go - About 1 day to fix

    Method AttributeValue.ToSDK has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (r AttributeValue) ToSDK() SDK.AttributeValue {
        o := SDK.AttributeValue{}
    
        switch {
        case len(r.Binary) != 0:
    Severity: Minor
    Found in dynamodb/type.go - About 1 hr to fix

      Method AttributeValue.GetValue has 5 return statements (exceeds 4 allowed).
      Open

      func (r AttributeValue) GetValue() interface{} {
          switch {
          case len(r.Binary) != 0:
              return r.Binary
          case len(r.BinarySet) != 0:
      Severity: Major
      Found in dynamodb/type.go - About 35 mins to fix

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

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

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

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

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

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

        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 dynamodb/type.go and 9 other locations - About 40 mins to fix
        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
        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

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

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

        exported type Projection should have comment or be unexported
        Open

        type Projection struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type StreamSpecification should have comment or be unexported
        Open

        type StreamSpecification struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported type ItemCollectionMetrics should have comment or be unexported
        Open

        type ItemCollectionMetrics struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type SSESpecification should have comment or be unexported
        Open

        type SSESpecification struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type KeysAndAttributes should have comment or be unexported
        Open

        type KeysAndAttributes struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type KeySchemaElement should have comment or be unexported
        Open

        type KeySchemaElement struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type AttributeValue should have comment or be unexported
        Open

        type AttributeValue struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type Tag should have comment or be unexported
        Open

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

        exported type AttributeDefinition should have comment or be unexported
        Open

        type AttributeDefinition struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported type ReplicaDescription should have comment or be unexported
        Open

        type ReplicaDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type BillingModeSummary should have comment or be unexported
        Open

        type BillingModeSummary struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type Capacity should have comment or be unexported
        Open

        type Capacity struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

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

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

        exported type SSEDescription should have comment or be unexported
        Open

        type SSEDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        comment on exported type GlobalSecondaryIndexDescription should be of the form "GlobalSecondaryIndexDescription ..." (with optional leading article)
        Open

        // Represents the properties of a global secondary index.
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type LocalSecondaryIndex should have comment or be unexported
        Open

        type LocalSecondaryIndex struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported method AttributeValue.GetValue should have comment or be unexported
        Open

        func (r AttributeValue) GetValue() interface{} {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type ReplicaGlobalSecondaryIndexDescription should have comment or be unexported
        Open

        type ReplicaGlobalSecondaryIndexDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type TableDescription should have comment or be unexported
        Open

        type TableDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

        func (r ExpectedAttributeValue) ToSDK() SDK.ExpectedAttributeValue {
        Severity: Minor
        Found in dynamodb/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 dynamodb/type.go by golint

        exported type ConsumedCapacity should have comment or be unexported
        Open

        type ConsumedCapacity struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type ProvisionedThroughput should have comment or be unexported
        Open

        type ProvisionedThroughput struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported type ProvisionedThroughputDescription should have comment or be unexported
        Open

        type ProvisionedThroughputDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type RestoreSummary should have comment or be unexported
        Open

        type RestoreSummary struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type ArchivalSummary should have comment or be unexported
        Open

        type ArchivalSummary struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type Condition should have comment or be unexported
        Open

        type Condition struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type ExpectedAttributeValue should have comment or be unexported
        Open

        type ExpectedAttributeValue struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

        exported type LocalSecondaryIndexDescription should have comment or be unexported
        Open

        type LocalSecondaryIndexDescription struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported type GlobalSecondaryIndex should have comment or be unexported
        Open

        type GlobalSecondaryIndex struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

        exported type WriteRequest should have comment or be unexported
        Open

        type WriteRequest struct {
        Severity: Minor
        Found in dynamodb/type.go by golint

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

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

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

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

        There are no issues that match your filters.

        Category
        Status