evalphobia/aws-sdk-go-wrapper

View on GitHub

Showing 174 of 174 total issues

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

package dynamodb

import (
    "strconv"
    "time"
Severity: Minor
Found in dynamodb/type.go - About 6 hrs to fix

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

    func TestAddObject(t *testing.T) {
        assert := assert.New(t)
        createBucket(testPutBucketName)
        f := openFile(t)
        defer f.Close() // nolint:gosec
    Severity: Major
    Found in s3/bucket_test.go and 2 other locations - About 4 hrs to fix
    s3/bucket_test.go on lines 63..90
    s3/bucket_test.go on lines 92..119

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

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

    func TestAddSecretObject(t *testing.T) {
        assert := assert.New(t)
        createBucket(testPutBucketName)
        f := openFile(t)
        defer f.Close() // nolint:gosec
    Severity: Major
    Found in s3/bucket_test.go and 2 other locations - About 4 hrs to fix
    s3/bucket_test.go on lines 34..61
    s3/bucket_test.go on lines 92..119

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

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

    func TestAddPrivateObject(t *testing.T) {
        assert := assert.New(t)
        createBucket(testPutBucketName)
        f := openFile(t)
        defer f.Close() // nolint:gosec
    Severity: Major
    Found in s3/bucket_test.go and 2 other locations - About 4 hrs to fix
    s3/bucket_test.go on lines 34..61
    s3/bucket_test.go on lines 63..90

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

    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

    Method CopyObjectRequest.ToInput has 117 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (r CopyObjectRequest) ToInput() *SDK.CopyObjectInput {
        in := &SDK.CopyObjectInput{}
    
        if r.SrcBucket != "" && r.SrcPath != "" {
            in.SetCopySource(fmt.Sprintf("/%s/%s", r.SrcBucket, r.SrcPath))
    Severity: Major
    Found in s3/request_type.go - About 3 hrs to fix

      ConditionList has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type ConditionList struct {
          keyAttributes map[string]string
          conditions    map[string]*Condition
          filters       map[string]*Condition
      
      
      Severity: Minor
      Found in dynamodb/condition.go - About 3 hrs to fix

        TableDesign has 30 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type TableDesign struct {
            // for create table
            name          string
            readCapacity  int64
            writeCapacity int64
        Severity: Minor
        Found in dynamodb/table_design.go - About 3 hrs to fix

          Method CopyObjectRequest.ToInput has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
          Open

          func (r CopyObjectRequest) ToInput() *SDK.CopyObjectInput {
              in := &SDK.CopyObjectInput{}
          
              if r.SrcBucket != "" && r.SrcPath != "" {
                  in.SetCopySource(fmt.Sprintf("/%s/%s", r.SrcBucket, r.SrcPath))
          Severity: Minor
          Found in s3/request_type.go - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Rekognition has 28 methods (exceeds 20 allowed). Consider refactoring.
          Open

          func (svc *Rekognition) DetectFacesFromLocalFile(filepath string) (*FaceDetailResponse, error) {
              byt, err := ioutil.ReadFile(filepath)
              if err != nil {
                  return nil, err
              }
          Severity: Minor
          Found in rekognition/client_api.go - About 3 hrs to fix

            IAM has 28 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type IAM struct {
                client *SDK.IAM
            
                logger log.Logger
            }
            Severity: Minor
            Found in iam/client.go - About 3 hrs to fix

              SNS has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type SNS struct {
                  client *SDK.SNS
              
                  logger       log.Logger
                  prefix       string
              Severity: Minor
              Found in sns/client.go - About 2 hrs to fix

                Queue has 25 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type Queue struct {
                    service *SQS
                
                    name           string
                    nameWithPrefix string
                Severity: Minor
                Found in sqs/queue.go - About 2 hrs to fix

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

                  func TestCopyTo(t *testing.T) {
                      a := assert.New(t)
                      createBucket(testPutBucketName)
                      createBucket(testCopyBucketName)
                      testPutObject(t)
                  Severity: Major
                  Found in s3/bucket_test.go and 1 other location - About 2 hrs to fix
                  s3/bucket_test.go on lines 277..303

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

                  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 TestCopyFrom(t *testing.T) {
                      a := assert.New(t)
                      createBucket(testPutBucketName)
                      createBucket(testCopyBucketName)
                      testPutObject(t)
                  Severity: Major
                  Found in s3/bucket_test.go and 1 other location - About 2 hrs to fix
                  s3/bucket_test.go on lines 305..331

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

                  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

                  package kms
                  
                  import (
                      "testing"
                  
                  
                  Severity: Major
                  Found in kms/client_test.go and 4 other locations - About 2 hrs to fix
                  cloudtrail/client_test.go on lines 1..34
                  cloudwatch/client_test.go on lines 1..34
                  pinpointemail/client_test.go on lines 1..34
                  rekognition/client_test.go on lines 1..34

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

                  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

                  package pinpointemail
                  
                  import (
                      "testing"
                  
                  
                  Severity: Major
                  Found in pinpointemail/client_test.go and 4 other locations - About 2 hrs to fix
                  cloudtrail/client_test.go on lines 1..34
                  cloudwatch/client_test.go on lines 1..34
                  kms/client_test.go on lines 1..34
                  rekognition/client_test.go on lines 1..34

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

                  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

                  package rekognition
                  
                  import (
                      "testing"
                  
                  
                  Severity: Major
                  Found in rekognition/client_test.go and 4 other locations - About 2 hrs to fix
                  cloudtrail/client_test.go on lines 1..34
                  cloudwatch/client_test.go on lines 1..34
                  kms/client_test.go on lines 1..34
                  pinpointemail/client_test.go on lines 1..34

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

                  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 TestEnvRegion(t *testing.T) {
                      assert := assert.New(t)
                  
                      tests := []struct {
                          isSuccess bool
                  Severity: Major
                  Found in config/env_test.go and 1 other location - About 2 hrs to fix
                  config/env_test.go on lines 45..77

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

                  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

                  package cloudtrail
                  
                  import (
                      "testing"
                  
                  
                  Severity: Major
                  Found in cloudtrail/client_test.go and 4 other locations - About 2 hrs to fix
                  cloudwatch/client_test.go on lines 1..34
                  kms/client_test.go on lines 1..34
                  pinpointemail/client_test.go on lines 1..34
                  rekognition/client_test.go on lines 1..34

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

                  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

                  package cloudwatch
                  
                  import (
                      "testing"
                  
                  
                  Severity: Major
                  Found in cloudwatch/client_test.go and 4 other locations - About 2 hrs to fix
                  cloudtrail/client_test.go on lines 1..34
                  kms/client_test.go on lines 1..34
                  pinpointemail/client_test.go on lines 1..34
                  rekognition/client_test.go on lines 1..34

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language