Similar blocks of code found in 4 locations. Consider refactoring. Open
const (
TableStatusCreating TableStatus = TableStatus(SDK.TableStatusCreating)
TableStatusUpdating TableStatus = TableStatus(SDK.TableStatusUpdating)
TableStatusDeleting TableStatus = TableStatus(SDK.TableStatusDeleting)
TableStatusActive TableStatus = TableStatus(SDK.TableStatusActive)
- 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 107.
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 ComparisonOperator.IsEq should have comment or be unexported Open
func (v ComparisonOperator) IsEq() bool {
- Exclude checks
exported method ComparisonOperator.IsIn should have comment or be unexported Open
func (v ComparisonOperator) IsIn() bool {
- Exclude checks
exported method ComparisonOperator.IsBetween should have comment or be unexported Open
func (v ComparisonOperator) IsBetween() bool {
- Exclude checks
exported method ComparisonOperator.IsBeginsWith should have comment or be unexported Open
func (v ComparisonOperator) IsBeginsWith() bool {
- Exclude checks
exported method ConditionalOperator.IsAnd should have comment or be unexported Open
func (v ConditionalOperator) IsAnd() bool {
- Exclude checks
exported method IndexStatus.IsActive should have comment or be unexported Open
func (v IndexStatus) IsActive() bool {
- Exclude checks
exported const ProjectionTypeAll should have comment (or a comment on this block) or be unexported Open
ProjectionTypeAll ProjectionType = ProjectionType(SDK.ProjectionTypeAll)
- Exclude checks
exported type ReplicaStatus should have comment or be unexported Open
type ReplicaStatus string
- Exclude checks
exported const ReturnConsumedCapacityIndexes should have comment (or a comment on this block) or be unexported Open
ReturnConsumedCapacityIndexes ReturnConsumedCapacity = ReturnConsumedCapacity(SDK.ReturnConsumedCapacityIndexes)
- Exclude checks
exported method Select.IsCount should have comment or be unexported Open
func (v Select) IsCount() bool {
- Exclude checks
exported method SSEStatus.IsUpdating should have comment or be unexported Open
func (v SSEStatus) IsUpdating() bool {
- Exclude checks
exported method ProjectionType.IsKeysOnly should have comment or be unexported Open
func (v ProjectionType) IsKeysOnly() bool {
- Exclude checks
exported method ProjectionType.IsInclude should have comment or be unexported Open
func (v ProjectionType) IsInclude() bool {
- Exclude checks
exported type ReturnItemCollectionMetrics should have comment or be unexported Open
type ReturnItemCollectionMetrics string
- Exclude checks
exported method ConditionalOperator.IsOr should have comment or be unexported Open
func (v ConditionalOperator) IsOr() bool {
- Exclude checks
exported type StreamViewType should have comment or be unexported Open
type StreamViewType string
- Exclude checks
exported type ProjectionType should have comment or be unexported Open
type ProjectionType string
- Exclude checks
exported method ReturnValue.IsUpdatedOld should have comment or be unexported Open
func (v ReturnValue) IsUpdatedOld() bool {
- Exclude checks
exported type SSEType should have comment or be unexported Open
type SSEType string
- Exclude checks
exported const BillingModeProvisioned should have comment (or a comment on this block) or be unexported Open
BillingModeProvisioned BillingMode = BillingMode(SDK.BillingModeProvisioned)
- Exclude checks
exported method ComparisonOperator.IsLt should have comment or be unexported Open
func (v ComparisonOperator) IsLt() bool {
- Exclude checks
exported method ComparisonOperator.IsNotNull should have comment or be unexported Open
func (v ComparisonOperator) IsNotNull() bool {
- Exclude checks
exported method KeyType.IsHash should have comment or be unexported Open
func (v KeyType) IsHash() bool {
- Exclude checks
exported const ScalarAttributeTypeS should have comment (or a comment on this block) or be unexported Open
ScalarAttributeTypeS ScalarAttributeType = ScalarAttributeType(SDK.ScalarAttributeTypeS)
- Exclude checks
exported method ComparisonOperator.IsContains should have comment or be unexported Open
func (v ComparisonOperator) IsContains() bool {
- Exclude checks
exported method ComparisonOperator.IsNotContains should have comment or be unexported Open
func (v ComparisonOperator) IsNotContains() bool {
- Exclude checks
exported type IndexStatus should have comment or be unexported Open
type IndexStatus string
- Exclude checks
exported method IndexStatus.IsDeleting should have comment or be unexported Open
func (v IndexStatus) IsDeleting() bool {
- Exclude checks
exported const KeyTypeHash should have comment (or a comment on this block) or be unexported Open
KeyTypeHash KeyType = KeyType(SDK.KeyTypeHash)
- Exclude checks
exported method ReturnValue.IsNone should have comment or be unexported Open
func (v ReturnValue) IsNone() bool {
- Exclude checks
exported method Select.IsAllProjectedAttributes should have comment or be unexported Open
func (v Select) IsAllProjectedAttributes() bool {
- Exclude checks
exported method SSEStatus.IsEnabled should have comment or be unexported Open
func (v SSEStatus) IsEnabled() bool {
- Exclude checks
exported method ProjectionType.IsAll should have comment or be unexported Open
func (v ProjectionType) IsAll() bool {
- Exclude checks
exported method ReturnItemCollectionMetrics.IsSize should have comment or be unexported Open
func (v ReturnItemCollectionMetrics) IsSize() bool {
- Exclude checks
exported type SSEStatus should have comment or be unexported Open
type SSEStatus string
- Exclude checks
exported method SSEType.IsAes256 should have comment or be unexported Open
func (v SSEType) IsAes256() bool {
- Exclude checks
exported type ReturnValue should have comment or be unexported Open
type ReturnValue string
- Exclude checks
exported method ScalarAttributeType.IsN should have comment or be unexported Open
func (v ScalarAttributeType) IsN() bool {
- Exclude checks
exported method BillingMode.IsProvisioned should have comment or be unexported Open
func (v BillingMode) IsProvisioned() bool {
- Exclude checks
exported const ComparisonOperatorEq should have comment (or a comment on this block) or be unexported Open
ComparisonOperatorEq ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorEq)
- Exclude checks
exported method ComparisonOperator.IsGe should have comment or be unexported Open
func (v ComparisonOperator) IsGe() bool {
- Exclude checks
exported method ComparisonOperator.IsGt should have comment or be unexported Open
func (v ComparisonOperator) IsGt() bool {
- Exclude checks
exported type ConditionalOperator should have comment or be unexported Open
type ConditionalOperator string
- Exclude checks
exported const IndexStatusCreating should have comment (or a comment on this block) or be unexported Open
IndexStatusCreating IndexStatus = IndexStatus(SDK.IndexStatusCreating)
- Exclude checks
exported method ReturnConsumedCapacity.IsTotal should have comment or be unexported Open
func (v ReturnConsumedCapacity) IsTotal() bool {
- Exclude checks
exported const ReturnValueNone should have comment (or a comment on this block) or be unexported Open
ReturnValueNone ReturnValue = ReturnValue(SDK.ReturnValueNone)
- Exclude checks
exported const SelectAllAttributes should have comment (or a comment on this block) or be unexported Open
SelectAllAttributes Select = Select(SDK.SelectAllAttributes)
- Exclude checks
exported method BillingMode.IsPayPerRequest should have comment or be unexported Open
func (v BillingMode) IsPayPerRequest() bool {
- Exclude checks
exported method ComparisonOperator.IsLe should have comment or be unexported Open
func (v ComparisonOperator) IsLe() bool {
- Exclude checks
exported const SSEStatusEnabling should have comment (or a comment on this block) or be unexported Open
SSEStatusEnabling SSEStatus = SSEStatus(SDK.SSEStatusEnabling)
- Exclude checks
exported method SSEStatus.IsEnabling should have comment or be unexported Open
func (v SSEStatus) IsEnabling() bool {
- Exclude checks
exported method ComparisonOperator.IsNull should have comment or be unexported Open
func (v ComparisonOperator) IsNull() bool {
- Exclude checks
exported method IndexStatus.IsCreating should have comment or be unexported Open
func (v IndexStatus) IsCreating() bool {
- Exclude checks
exported type KeyType should have comment or be unexported Open
type KeyType string
- Exclude checks
exported method KeyType.IsRange should have comment or be unexported Open
func (v KeyType) IsRange() bool {
- Exclude checks
exported method ReturnValue.IsAllNew should have comment or be unexported Open
func (v ReturnValue) IsAllNew() bool {
- Exclude checks
exported method Select.IsAllAttributes should have comment or be unexported Open
func (v Select) IsAllAttributes() bool {
- Exclude checks
exported const SSETypeAes256 should have comment (or a comment on this block) or be unexported Open
SSETypeAes256 SSEType = SSEType(SDK.SSETypeAes256)
- Exclude checks
exported method IndexStatus.IsUpdating should have comment or be unexported Open
func (v IndexStatus) IsUpdating() bool {
- Exclude checks
exported type Select should have comment or be unexported Open
type Select string
- Exclude checks
comment on exported const ComparisonOperatorAttrExists should be of the form "ComparisonOperatorAttrExists ..." Open
// for expression condition
- Exclude checks
exported const ReplicaStatusCreating should have comment (or a comment on this block) or be unexported Open
ReplicaStatusCreating ReplicaStatus = ReplicaStatus(SDK.ReplicaStatusCreating)
- Exclude checks
exported const ReturnItemCollectionMetricsSize should have comment (or a comment on this block) or be unexported Open
ReturnItemCollectionMetricsSize ReturnItemCollectionMetrics = ReturnItemCollectionMetrics(SDK.ReturnItemCollectionMetricsSize)
- Exclude checks
exported method ReturnItemCollectionMetrics.IsNone should have comment or be unexported Open
func (v ReturnItemCollectionMetrics) IsNone() bool {
- Exclude checks
exported const ConditionalOperatorAnd should have comment (or a comment on this block) or be unexported Open
ConditionalOperatorAnd ConditionalOperator = ConditionalOperator(SDK.ConditionalOperatorAnd)
- Exclude checks
exported method SSEType.IsKms should have comment or be unexported Open
func (v SSEType) IsKms() bool {
- Exclude checks
exported type ComparisonOperator should have comment or be unexported Open
type ComparisonOperator string
- Exclude checks
exported type ReturnConsumedCapacity should have comment or be unexported Open
type ReturnConsumedCapacity string
- Exclude checks
exported method ReturnConsumedCapacity.IsNone should have comment or be unexported Open
func (v ReturnConsumedCapacity) IsNone() bool {
- Exclude checks
exported type ScalarAttributeType should have comment or be unexported Open
type ScalarAttributeType string
- Exclude checks
exported method ScalarAttributeType.IsS should have comment or be unexported Open
func (v ScalarAttributeType) IsS() bool {
- Exclude checks
exported method SSEStatus.IsDisabling should have comment or be unexported Open
func (v SSEStatus) IsDisabling() bool {
- Exclude checks
exported method SSEStatus.IsDisabled should have comment or be unexported Open
func (v SSEStatus) IsDisabled() bool {
- Exclude checks
exported type BillingMode should have comment or be unexported Open
type BillingMode string
- Exclude checks
exported method ComparisonOperator.IsNe should have comment or be unexported Open
func (v ComparisonOperator) IsNe() bool {
- Exclude checks
exported method ReturnConsumedCapacity.IsIndexes should have comment or be unexported Open
func (v ReturnConsumedCapacity) IsIndexes() bool {
- Exclude checks
exported method ReturnValue.IsAllOld should have comment or be unexported Open
func (v ReturnValue) IsAllOld() bool {
- Exclude checks
exported method ReturnValue.IsUpdatedNew should have comment or be unexported Open
func (v ReturnValue) IsUpdatedNew() bool {
- Exclude checks
exported method ScalarAttributeType.IsB should have comment or be unexported Open
func (v ScalarAttributeType) IsB() bool {
- Exclude checks
exported method Select.IsSpecificAttributes should have comment or be unexported Open
func (v Select) IsSpecificAttributes() bool {
- Exclude checks
exported method TableStatus.IsInaccessibleEncryptionCredentials should have comment or be unexported Open
func (v TableStatus) IsInaccessibleEncryptionCredentials() bool {
- Exclude checks
exported method TableStatus.IsDeleting should have comment or be unexported Open
func (v TableStatus) IsDeleting() bool {
- Exclude checks
exported method StreamViewType.IsKeysOnly should have comment or be unexported Open
func (v StreamViewType) IsKeysOnly() bool {
- Exclude checks
exported method TableStatus.IsActive should have comment or be unexported Open
func (v TableStatus) IsActive() bool {
- Exclude checks
exported method StreamViewType.IsNewAndOldImages should have comment or be unexported Open
func (v StreamViewType) IsNewAndOldImages() bool {
- Exclude checks
exported method StreamViewType.IsNewImage should have comment or be unexported Open
func (v StreamViewType) IsNewImage() bool {
- Exclude checks
exported method StreamViewType.IsOldImage should have comment or be unexported Open
func (v StreamViewType) IsOldImage() bool {
- Exclude checks
exported method TableStatus.IsUpdating should have comment or be unexported Open
func (v TableStatus) IsUpdating() bool {
- Exclude checks
exported const TableStatusCreating should have comment (or a comment on this block) or be unexported Open
TableStatusCreating TableStatus = TableStatus(SDK.TableStatusCreating)
- Exclude checks
exported method TableStatus.IsCreating should have comment or be unexported Open
func (v TableStatus) IsCreating() bool {
- Exclude checks
exported method TableStatus.IsArchived should have comment or be unexported Open
func (v TableStatus) IsArchived() bool {
- Exclude checks
exported method TableStatus.IsArchiving should have comment or be unexported Open
func (v TableStatus) IsArchiving() bool {
- Exclude checks
exported const StreamViewTypeNewImage should have comment (or a comment on this block) or be unexported Open
StreamViewTypeNewImage StreamViewType = StreamViewType(SDK.StreamViewTypeNewImage)
- Exclude checks
exported type TableStatus should have comment or be unexported Open
type TableStatus string
- Exclude checks