evalphobia/aws-sdk-go-v2-wrapper

View on GitHub

Showing 41 of 1,082 total issues

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

      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

        Function NewGetObjectResult has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func NewGetObjectResult(output *SDK.GetObjectResponse) *GetObjectResult {
            r := &GetObjectResult{}
            if output == nil {
                return r
            }
        Severity: Minor
        Found in s3/client_op_object_get.go - About 1 hr 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 QueryRequest.ToInput has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func (r QueryRequest) ToInput() (*SDK.QueryInput, error) {
            in := &SDK.QueryInput{}
        
            if r.TableName != "" {
                in.TableName = pointers.String(r.TableName)
        Severity: Minor
        Found in dynamodb/client_op_item_query.go - About 1 hr 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 QueryRequest.ToInput has 71 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (r QueryRequest) ToInput() (*SDK.QueryInput, error) {
            in := &SDK.QueryInput{}
        
            if r.TableName != "" {
                in.TableName = pointers.String(r.TableName)
        Severity: Minor
        Found in dynamodb/client_op_item_query.go - About 1 hr to fix

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

          func (r SendEmailRequest) ToInput() *SDK.SendEmailInput {
              in := &SDK.SendEmailInput{}
              switch {
              case len(r.To) != 0,
                  len(r.Cc) != 0,
          Severity: Minor
          Found in pinpointemail/client_op_send_email.go - About 1 hr 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 newCampaignResponse has 68 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func newCampaignResponse(o *SDK.CampaignResponse) CampaignResponse {
              result := CampaignResponse{}
              if o == nil {
                  return result
              }
          Severity: Minor
          Found in pinpoint/type_campaign.go - About 1 hr to fix

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

            func (r PutObjectRequest) ToInput() *SDK.PutObjectInput {
                in := &SDK.PutObjectInput{}
                if r.Bucket != "" {
                    in.Bucket = pointers.String(r.Bucket)
                }
            Severity: Minor
            Found in s3/client_op_object_put.go - About 1 hr 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 a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
            Open

            func NewHeadObjectResult(output *SDK.HeadObjectResponse) *HeadObjectResult {
                r := &HeadObjectResult{}
                if output == nil {
                    return r
                }
            Severity: Minor
            Found in s3/client_op_object_head.go - About 1 hr 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 SendEmailRequest.ToInput has 57 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (r SendEmailRequest) ToInput() *SDK.SendEmailInput {
                in := &SDK.SendEmailInput{
                    Message: &SDK.Message{},
                }
            
            
            Severity: Minor
            Found in ses/client_op_send_email.go - About 1 hr to fix

              Method GetObjectRequest.ToInput has 57 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (r GetObjectRequest) ToInput() *SDK.GetObjectInput {
                  in := &SDK.GetObjectInput{}
                  if r.Bucket != "" {
                      in.Bucket = pointers.String(r.Bucket)
                  }
              Severity: Minor
              Found in s3/client_op_object_get.go - About 1 hr to fix

                Function newKeyMetadata has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func newKeyMetadata(o *SDK.KeyMetadata) KeyMetadata {
                    result := KeyMetadata{}
                    if o == nil {
                        return result
                    }
                Severity: Minor
                Found in kms/type.go - About 1 hr to fix

                  Method CreateTableRequest.ToInput has 53 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (r CreateTableRequest) ToInput() *SDK.CreateTableInput {
                      in := &SDK.CreateTableInput{}
                  
                      if r.TableName != "" {
                          in.TableName = pointers.String(r.TableName)
                  Severity: Minor
                  Found in dynamodb/client_op_table_create.go - About 1 hr 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 XSendRawEmailRequest.ToRequest has 10 return statements (exceeds 4 allowed).
                      Open

                      func (r XSendRawEmailRequest) ToRequest() (SendRawEmailRequest, error) {
                          req := SendRawEmailRequest{
                              ConfigurationSetName: r.ConfigurationSetName,
                              Destinations:         r.To,
                              FromARN:              r.FromARN,
                      Severity: Major
                      Found in ses/client_xapi_send_raw_email.go - About 1 hr to fix

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

                        func (r SendEmailRequest) ToInput() *SDK.SendEmailInput {
                            in := &SDK.SendEmailInput{
                                Message: &SDK.Message{},
                            }
                        
                        
                        Severity: Minor
                        Found in ses/client_op_send_email.go - About 45 mins 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 XConditions.Build has 7 return statements (exceeds 4 allowed).
                        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 45 mins to fix

                          Method SES.XSendBulkTemplatedEmailEachList has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func (svc *SES) XSendBulkTemplatedEmailEachList(ctx context.Context, template, from string, to []string, templateData []map[string]interface{}, tags []map[string]string) (*SendBulkTemplatedEmailResult, error) {
                          Severity: Minor
                          Found in ses/client_xapi_send_bulk_templated_email.go - About 35 mins 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
                              Severity
                              Category
                              Status
                              Source
                              Language