evalphobia/aws-sdk-go-v2-wrapper

View on GitHub
athena/type.go

Summary

Maintainability
A
40 mins
Test Coverage

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

func NewQueryExecutionContext(o *SDK.QueryExecutionContext) QueryExecutionContext {
    r := QueryExecutionContext{}
    if o == nil {
        return r
    }
Severity: Major
Found in athena/type.go and 6 other locations - About 40 mins to fix
pinpoint/type_campaign.go on lines 644..657
pinpoint/type_campaign.go on lines 764..777
pinpoint/type_segment.go on lines 311..324
pinpoint/type_template.go on lines 228..241
s3/type.go on lines 644..657
ses/type.go on lines 152..165

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

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

exported method ResultConfiguration.ToSDK should have comment or be unexported
Open

func (v ResultConfiguration) ToSDK() *SDK.ResultConfiguration {
Severity: Minor
Found in athena/type.go by golint

exported type Row should have comment or be unexported
Open

type Row struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewRow should have comment or be unexported
Open

func NewRow(o SDK.Row) Row {
Severity: Minor
Found in athena/type.go by golint

exported type ColumnInfo should have comment or be unexported
Open

type ColumnInfo struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewResultConfiguration should have comment or be unexported
Open

func NewResultConfiguration(o *SDK.ResultConfiguration) ResultConfiguration {
Severity: Minor
Found in athena/type.go by golint

exported function NewResultSet should have comment or be unexported
Open

func NewResultSet(o *SDK.ResultSet) ResultSet {
Severity: Minor
Found in athena/type.go by golint

exported function NewRowList should have comment or be unexported
Open

func NewRowList(list []SDK.Row) []Row {
Severity: Minor
Found in athena/type.go by golint

exported type QueryExecutionContext should have comment or be unexported
Open

type QueryExecutionContext struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewQueryExecutionContext should have comment or be unexported
Open

func NewQueryExecutionContext(o *SDK.QueryExecutionContext) QueryExecutionContext {
Severity: Minor
Found in athena/type.go by golint

exported method ResultSet.ToListString should have comment or be unexported
Open

func (r ResultSet) ToListString() [][]string {
Severity: Minor
Found in athena/type.go by golint

exported type ResultConfiguration should have comment or be unexported
Open

type ResultConfiguration struct {
Severity: Minor
Found in athena/type.go by golint

exported type ResultSet should have comment or be unexported
Open

type ResultSet struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewColumnInfo should have comment or be unexported
Open

func NewColumnInfo(o SDK.ColumnInfo) ColumnInfo {
Severity: Minor
Found in athena/type.go by golint

exported method QueryExecutionContext.ToSDK should have comment or be unexported
Open

func (v QueryExecutionContext) ToSDK() *SDK.QueryExecutionContext {
Severity: Minor
Found in athena/type.go by golint

exported type QueryExecutionStatus should have comment or be unexported
Open

type QueryExecutionStatus struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewColumnInfoListFromMetadata should have comment or be unexported
Open

func NewColumnInfoListFromMetadata(o *SDK.ResultSetMetadata) []ColumnInfo {
Severity: Minor
Found in athena/type.go by golint

exported type Datum should have comment or be unexported
Open

type Datum struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewDatumList should have comment or be unexported
Open

func NewDatumList(list []SDK.Datum) []Datum {
Severity: Minor
Found in athena/type.go by golint

exported type QueryExecutionStatistics should have comment or be unexported
Open

type QueryExecutionStatistics struct {
Severity: Minor
Found in athena/type.go by golint

exported function NewColumnInfoList should have comment or be unexported
Open

func NewColumnInfoList(list []SDK.ColumnInfo) []ColumnInfo {
Severity: Minor
Found in athena/type.go by golint

exported function NewDatum should have comment or be unexported
Open

func NewDatum(o SDK.Datum) Datum {
Severity: Minor
Found in athena/type.go by golint

exported function NewQueryExecutionStatus should have comment or be unexported
Open

func NewQueryExecutionStatus(o *SDK.QueryExecutionStatus) QueryExecutionStatus {
Severity: Minor
Found in athena/type.go by golint

exported function NewQueryExecutionStatistics should have comment or be unexported
Open

func NewQueryExecutionStatistics(o *SDK.QueryExecutionStatistics) QueryExecutionStatistics {
Severity: Minor
Found in athena/type.go by golint

exported method ResultSet.ToMapString should have comment or be unexported
Open

func (r ResultSet) ToMapString() []map[string]string {
Severity: Minor
Found in athena/type.go by golint

There are no issues that match your filters.

Category
Status