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
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()
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,
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
}
- Read upRead up
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)
- Read upRead up
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)
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,
- Read upRead up
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
}
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)
}
- Read upRead up
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
}
- Read upRead up
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{},
}
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)
}
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
}
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)
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 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,
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{},
}
- Read upRead up
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()
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) {
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: