Hunterlong/AuthorizeCIM

View on GitHub
transaction_reporting.go

Summary

Maintainability
A
1 hr
Test Coverage

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

func UnSettledBatch() (*UnsettledTransactionListResponse, error) {
    new := GetUnsettledBatchTransactionListRequest{
        GetUnsettledTransactionList: GetUnsettledTransactionList{
            MerchantAuthentication: GetAuthentication(),
        },
Severity: Minor
Found in transaction_reporting.go and 1 other location - About 45 mins to fix
transaction_reporting.go on lines 101..115

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

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 GetMerchantDetails() (*MerchantDetailsResponse, error) {
    new := GetMerchantDetailsRequest{
        GetMerchantDetailsReq: GetMerchantDetailsReq{
            MerchantAuthentication: GetAuthentication(),
        },
Severity: Minor
Found in transaction_reporting.go and 1 other location - About 45 mins to fix
transaction_reporting.go on lines 39..53

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

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 type BatchListResponse should have comment or be unexported
Open

type BatchListResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type FullTransaction should have comment or be unexported
Open

type FullTransaction struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type UnsettledTransactionListResponse should have comment or be unexported
Open

type UnsettledTransactionListResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetMerchantDetailsRequest should have comment or be unexported
Open

type GetMerchantDetailsRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetSettledBatchList should have comment or be unexported
Open

type GetSettledBatchList struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported method BatchListResponse.List should have comment or be unexported
Open

func (r BatchListResponse) List() []BatchList {
Severity: Minor
Found in transaction_reporting.go by golint

exported method UnsettledTransactionListResponse.List should have comment or be unexported
Open

func (r UnsettledTransactionListResponse) List() []Transaction {
Severity: Minor
Found in transaction_reporting.go by golint

exported method PreviousTransaction.Info should have comment or be unexported
Open

func (tranx PreviousTransaction) Info() (*FullTransaction, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetSettledBatchListRequest should have comment or be unexported
Open

type GetSettledBatchListRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported function GetMerchantDetails should have comment or be unexported
Open

func GetMerchantDetails() (*MerchantDetailsResponse, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetBatchStatisticsRequest should have comment or be unexported
Open

type GetBatchStatisticsRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported method Range.SettledBatch should have comment or be unexported
Open

func (r Range) SettledBatch() (*BatchListResponse, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetTransactionList should have comment or be unexported
Open

type GetTransactionList struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetTransactionListResponse should have comment or be unexported
Open

type GetTransactionListResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetTransactionDetails should have comment or be unexported
Open

type GetTransactionDetails struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetUnsettledBatchTransactionListRequest should have comment or be unexported
Open

type GetUnsettledBatchTransactionListRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported method GetTransactionListResponse.Count should have comment or be unexported
Open

func (r *GetTransactionListResponse) Count() int {
Severity: Minor
Found in transaction_reporting.go by golint

exported type BatchList should have comment or be unexported
Open

type BatchList struct {
Severity: Minor
Found in transaction_reporting.go by golint

don't use MixedCaps in package name; AuthorizeCIM should be authorizecim
Open

package AuthorizeCIM
Severity: Minor
Found in transaction_reporting.go by golint

exported function UnSettledBatch should have comment or be unexported
Open

func UnSettledBatch() (*UnsettledTransactionListResponse, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetTransactionDetailsRequest should have comment or be unexported
Open

type GetTransactionDetailsRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type BatchStatisticsResponse should have comment or be unexported
Open

type BatchStatisticsResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type Range should have comment or be unexported
Open

type Range struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported method Range.Transactions should have comment or be unexported
Open

func (r Range) Transactions() (*GetTransactionListResponse, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type Transactions should have comment or be unexported
Open

type Transactions struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetUnsettledTransactionList should have comment or be unexported
Open

type GetUnsettledTransactionList struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type MerchantDetailsResponse should have comment or be unexported
Open

type MerchantDetailsResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported method GetTransactionListResponse.List should have comment or be unexported
Open

func (r *GetTransactionListResponse) List() []Transaction {
Severity: Minor
Found in transaction_reporting.go by golint

exported type Transaction should have comment or be unexported
Open

type Transaction struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type TransactionDetailsResponse should have comment or be unexported
Open

type TransactionDetailsResponse struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetTransactionListRequest should have comment or be unexported
Open

type GetTransactionListRequest struct {
Severity: Minor
Found in transaction_reporting.go by golint

struct field BatchId should be BatchID
Open

    BatchId string    `"omitempty"`
Severity: Minor
Found in transaction_reporting.go by golint

exported method Range.Statistics should have comment or be unexported
Open

func (r Range) Statistics() (*Statistics, error) {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetBatchStatistics should have comment or be unexported
Open

type GetBatchStatistics struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type Statistics should have comment or be unexported
Open

type Statistics struct {
Severity: Minor
Found in transaction_reporting.go by golint

exported type GetMerchantDetailsReq should have comment or be unexported
Open

type GetMerchantDetailsReq struct {
Severity: Minor
Found in transaction_reporting.go by golint

There are no issues that match your filters.

Category
Status