evalphobia/aws-sdk-go-v2-wrapper

View on GitHub

Showing 1,082 of 1,082 total issues

Method PutObjectRequest.ToInput has 92 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (r PutObjectRequest) ToInput() *SDK.PutObjectInput {
    in := &SDK.PutObjectInput{}
    if r.Bucket != "" {
        in.Bucket = pointers.String(r.Bucket)
    }
Severity: Major
Found in s3/client_op_object_put.go - About 2 hrs to fix

    Athena has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

    func (svc *Athena) RawBatchGetNamedQuery(ctx context.Context, in *SDK.BatchGetNamedQueryInput) (*SDK.BatchGetNamedQueryResponse, error) {
        return svc.client.BatchGetNamedQueryRequest(in).Send(ctx)
    }
    Severity: Minor
    Found in athena/client__raw_api.go - About 2 hrs to fix

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

      func TestEnvEndpoint(t *testing.T) {
          is := is.NewRelaxed(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 10..41

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

      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) {
          is := is.NewRelaxed(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 43..74

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

      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 a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
      Open

      func (r CopyObjectRequest) ToInput() *SDK.CopyObjectInput {
          in := &SDK.CopyObjectInput{}
          if r.Bucket != "" {
              in.Bucket = pointers.String(r.Bucket)
          }
      Severity: Minor
      Found in s3/client_op_object_copy.go - About 2 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

      Method XSendRawEmailRequest.ToRequest has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
      Open

      func (r XSendRawEmailRequest) ToRequest() (SendRawEmailRequest, error) {
          req := SendRawEmailRequest{
              ConfigurationSetName: r.ConfigurationSetName,
              Destinations:         r.To,
              FromARN:              r.FromARN,
      Severity: Minor
      Found in ses/client_xapi_send_raw_email.go - About 2 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

      Function NewHeadObjectResult has 85 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func NewHeadObjectResult(output *SDK.HeadObjectResponse) *HeadObjectResult {
          r := &HeadObjectResult{}
          if output == nil {
              return r
          }
      Severity: Major
      Found in s3/client_op_object_head.go - About 2 hrs to fix

        Endpoints has 22 methods (exceeds 20 allowed). Consider refactoring.
        Open

        type Endpoints struct {
            Athena         string
            CloudwatchLogs string
            DynamoDB       string
            EC2            string
        Severity: Minor
        Found in config/endpoints.go - About 2 hrs to fix

          Method XConditions.Build has 82 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (x XConditions) Build() (expression.Expression, error) {
              b := expression.NewBuilder()
          
              if len(x.KeyConditions) != 0 {
                  kc, err := x.KeyConditions[0].KeyCondition()
          Severity: Major
          Found in dynamodb/xtype_condition.go - About 2 hrs to fix

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

            func (r MessageSystemAttributeValue) ToSDK() SDK.MessageSystemAttributeValue {
                o := SDK.MessageSystemAttributeValue{}
            
                if r.DataType != "" {
                    o.DataType = pointers.String(r.DataType)
            Severity: Major
            Found in sqs/type.go and 1 other location - About 2 hrs to fix
            sqs/type.go on lines 210..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 205.

            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 (r MessageAttributeValue) ToSDK() SDK.MessageAttributeValue {
                o := SDK.MessageAttributeValue{}
            
                if r.DataType != "" {
                    o.DataType = pointers.String(r.DataType)
            Severity: Major
            Found in sqs/type.go and 1 other location - About 2 hrs to fix
            sqs/type.go on lines 272..292

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

            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 SendEmailRequest.ToInput has 81 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (r SendEmailRequest) ToInput() *SDK.SendEmailInput {
                in := &SDK.SendEmailInput{}
                switch {
                case len(r.To) != 0,
                    len(r.Cc) != 0,
            Severity: Major
            Found in pinpointemail/client_op_send_email.go - About 2 hrs to fix

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

                  if len(x.Filters) != 0 {
                      filt, err := x.Filters[0].Condition()
                      if err != nil {
                          return expression.Expression{}, err
                      }
              Severity: Major
              Found in dynamodb/xtype_condition.go and 1 other location - About 2 hrs to fix
              dynamodb/xtype_condition.go on lines 52..78

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

              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

                  if len(x.Conditions) != 0 {
                      cond, err := x.Conditions[0].Condition()
                      if err != nil {
                          return expression.Expression{}, err
                      }
              Severity: Major
              Found in dynamodb/xtype_condition.go and 1 other location - About 2 hrs to fix
              dynamodb/xtype_condition.go on lines 80..106

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

              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 newSendMessageBatchResultEntry(o SDK.SendMessageBatchResultEntry) SendMessageBatchResultEntry {
                  result := SendMessageBatchResultEntry{}
              
                  if o.Id != nil {
                      result.ID = *o.Id
              Severity: Major
              Found in sqs/type.go and 1 other location - About 1 hr to fix
              pinpoint/type_endpoint.go on lines 295..316

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

              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 newEndpointLocation(o *SDK.EndpointLocation) EndpointLocation {
                  result := EndpointLocation{}
                  if o.City != nil {
                      result.City = *o.City
                  }
              Severity: Major
              Found in pinpoint/type_endpoint.go and 1 other location - About 1 hr to fix
              sqs/type.go on lines 318..342

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

              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 (r CampaignEmailMessage) ToSDK() *SDK.CampaignEmailMessage {
                  o := SDK.CampaignEmailMessage{}
              
                  if r.Body != "" {
                      o.Body = pointers.String(r.Body)
              Severity: Major
              Found in pinpoint/type_campaign.go and 2 other locations - About 1 hr to fix
              pinpoint/type_campaign.go on lines 213..229
              ses/type.go on lines 129..145

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

              func (r CampaignLimits) ToSDK() *SDK.CampaignLimits {
                  o := SDK.CampaignLimits{}
              
                  if r.Daily != 0 {
                      o.Daily = pointers.Long64(r.Daily)
              Severity: Major
              Found in pinpoint/type_campaign.go and 2 other locations - About 1 hr to fix
              pinpoint/type_campaign.go on lines 104..120
              ses/type.go on lines 129..145

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

              func (svc *S3) HeadObject(ctx context.Context, r HeadObjectRequest) (*HeadObjectResult, error) {
                  out, err := svc.RawHeadObject(ctx, r.ToInput())
                  if err == nil {
                      return NewHeadObjectResult(out), nil
                  }
              Severity: Major
              Found in s3/client_op_object_head.go and 1 other location - About 1 hr to fix
              s3/client_op_object_get.go on lines 17..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 185.

              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