File type.go
has 1027 lines of code (exceeds 500 allowed). Consider refactoring. Open
package dynamodb
import (
"fmt"
"strconv"
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:
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:
Similar blocks of code found in 4 locations. Consider refactoring. Open
func newRestoreSummary(o *SDK.RestoreSummary) RestoreSummary {
result := RestoreSummary{}
if o == nil {
return result
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
func newArchivalSummary(o *SDK.ArchivalSummary) ArchivalSummary {
result := ArchivalSummary{}
if o == nil {
return result
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 5 locations. Consider refactoring. Open
func newCapacity(o *SDK.Capacity) Capacity {
result := Capacity{}
if o == nil {
return result
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
exported method LocalSecondaryIndex.ToSDK should have comment or be unexported Open
func (r LocalSecondaryIndex) ToSDK() SDK.LocalSecondaryIndex {
- Exclude checks
exported type Projection should have comment or be unexported Open
type Projection struct {
- Exclude checks
exported type StreamSpecification should have comment or be unexported Open
type StreamSpecification struct {
- Exclude checks
exported method GlobalSecondaryIndex.ToSDK should have comment or be unexported Open
func (r GlobalSecondaryIndex) ToSDK() SDK.GlobalSecondaryIndex {
- Exclude checks
exported type ItemCollectionMetrics should have comment or be unexported Open
type ItemCollectionMetrics struct {
- Exclude checks
exported type SSESpecification should have comment or be unexported Open
type SSESpecification struct {
- Exclude checks
exported type KeysAndAttributes should have comment or be unexported Open
type KeysAndAttributes struct {
- Exclude checks
exported type KeySchemaElement should have comment or be unexported Open
type KeySchemaElement struct {
- Exclude checks
exported type AttributeValue should have comment or be unexported Open
type AttributeValue struct {
- Exclude checks
exported type Tag should have comment or be unexported Open
type Tag struct {
- Exclude checks
exported type AttributeDefinition should have comment or be unexported Open
type AttributeDefinition struct {
- Exclude checks
exported method KeySchemaElement.ToSDK should have comment or be unexported Open
func (r KeySchemaElement) ToSDK() SDK.KeySchemaElement {
- Exclude checks
exported type ReplicaDescription should have comment or be unexported Open
type ReplicaDescription struct {
- Exclude checks
exported type BillingModeSummary should have comment or be unexported Open
type BillingModeSummary struct {
- Exclude checks
exported type Capacity should have comment or be unexported Open
type Capacity struct {
- Exclude checks
exported method KeysAndAttributes.ToSDK should have comment or be unexported Open
func (r KeysAndAttributes) ToSDK() SDK.KeysAndAttributes {
- Exclude checks
exported method Projection.ToSDK should have comment or be unexported Open
func (r Projection) ToSDK() SDK.Projection {
- Exclude checks
exported type SSEDescription should have comment or be unexported Open
type SSEDescription struct {
- Exclude checks
exported method AttributeValue.ToSDK should have comment or be unexported Open
func (r AttributeValue) ToSDK() SDK.AttributeValue {
- Exclude checks
comment on exported type GlobalSecondaryIndexDescription should be of the form "GlobalSecondaryIndexDescription ..." (with optional leading article) Open
// Represents the properties of a global secondary index.
- Exclude checks
exported type LocalSecondaryIndex should have comment or be unexported Open
type LocalSecondaryIndex struct {
- Exclude checks
exported method ProvisionedThroughput.ToSDK should have comment or be unexported Open
func (r ProvisionedThroughput) ToSDK() SDK.ProvisionedThroughput {
- Exclude checks
exported method AttributeValue.GetValue should have comment or be unexported Open
func (r AttributeValue) GetValue() interface{} {
- Exclude checks
exported type ReplicaGlobalSecondaryIndexDescription should have comment or be unexported Open
type ReplicaGlobalSecondaryIndexDescription struct {
- Exclude checks
exported type TableDescription should have comment or be unexported Open
type TableDescription struct {
- Exclude checks
exported method ExpectedAttributeValue.ToSDK should have comment or be unexported Open
func (r ExpectedAttributeValue) ToSDK() SDK.ExpectedAttributeValue {
- Exclude checks
exported method Tag.ToSDK should have comment or be unexported Open
func (r Tag) ToSDK() SDK.Tag {
- Exclude checks
exported type ConsumedCapacity should have comment or be unexported Open
type ConsumedCapacity struct {
- Exclude checks
exported type ProvisionedThroughput should have comment or be unexported Open
type ProvisionedThroughput struct {
- Exclude checks
exported method AttributeDefinition.ToSDK should have comment or be unexported Open
func (r AttributeDefinition) ToSDK() SDK.AttributeDefinition {
- Exclude checks
exported type ProvisionedThroughputDescription should have comment or be unexported Open
type ProvisionedThroughputDescription struct {
- Exclude checks
exported type RestoreSummary should have comment or be unexported Open
type RestoreSummary struct {
- Exclude checks
exported type ArchivalSummary should have comment or be unexported Open
type ArchivalSummary struct {
- Exclude checks
exported type Condition should have comment or be unexported Open
type Condition struct {
- Exclude checks
exported type ExpectedAttributeValue should have comment or be unexported Open
type ExpectedAttributeValue struct {
- Exclude checks
exported type LocalSecondaryIndexDescription should have comment or be unexported Open
type LocalSecondaryIndexDescription struct {
- Exclude checks
exported method Condition.ToSDK should have comment or be unexported Open
func (r Condition) ToSDK() SDK.Condition {
- Exclude checks
exported type GlobalSecondaryIndex should have comment or be unexported Open
type GlobalSecondaryIndex struct {
- Exclude checks
exported method StreamSpecification.ToSDK should have comment or be unexported Open
func (r StreamSpecification) ToSDK() SDK.StreamSpecification {
- Exclude checks
exported type WriteRequest should have comment or be unexported Open
type WriteRequest struct {
- Exclude checks
exported method WriteRequest.ToSDK should have comment or be unexported Open
func (r WriteRequest) ToSDK() SDK.WriteRequest {
- Exclude checks
exported method SSESpecification.ToSDK should have comment or be unexported Open
func (r SSESpecification) ToSDK() SDK.SSESpecification {
- Exclude checks