Hunterlong/AuthorizeCIM

View on GitHub
payment_transactions.go

Summary

Maintainability
A
1 hr
Test Coverage

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

func SendTransactionRequest(input TransactionRequest) (*TransactionResponse, error) {
    action := CreatePayment{
        CreateTransactionRequest: CreateTransactionRequest{
            MerchantAuthentication: GetAuthentication(),
            TransactionRequest:     input,
Severity: Major
Found in payment_transactions.go and 1 other location - About 1 hr to fix
recurring_billing.go on lines 132..150

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

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

type LineItems struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type Duty should have comment or be unexported
Open

type Duty struct {
Severity: Minor
Found in payment_transactions.go by golint

struct field RefTransId should be RefTransID
Open

    RefTransId string     `json:"refTransId,omitempty"`
Severity: Minor
Found in payment_transactions.go by golint

struct field RefId should be RefID
Open

    RefId  string `json:"refTransId,omitempty"`
Severity: Minor
Found in payment_transactions.go by golint

exported type TransactionResponse should have comment or be unexported
Open

type TransactionResponse struct {
Severity: Minor
Found in payment_transactions.go by golint

exported method NewTransaction.Charge should have comment or be unexported
Open

func (tranx NewTransaction) Charge() (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported function GetHostedPaymentPage should have comment or be unexported
Open

func GetHostedPaymentPage() {
Severity: Minor
Found in payment_transactions.go by golint

exported type PreviousTransaction should have comment or be unexported
Open

type PreviousTransaction struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type UserField should have comment or be unexported
Open

type UserField struct {
Severity: Minor
Found in payment_transactions.go by golint

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

func (tranx PreviousTransaction) Void() (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported function ChargeTokenCard should have comment or be unexported
Open

func ChargeTokenCard() {
Severity: Minor
Found in payment_transactions.go by golint

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

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

struct field InvoiceId should be InvoiceID
Open

    InvoiceId  string     `json:"invoiceId,omitempty"`
Severity: Minor
Found in payment_transactions.go by golint

exported type Payment should have comment or be unexported
Open

type Payment struct {
Severity: Minor
Found in payment_transactions.go by golint

exported function SendTransactionRequest should have comment or be unexported
Open

func SendTransactionRequest(input TransactionRequest) (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported type Setting should have comment or be unexported
Open

type Setting struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type Tax should have comment or be unexported
Open

type Tax struct {
Severity: Minor
Found in payment_transactions.go by golint

exported method NewTransaction.AuthOnly should have comment or be unexported
Open

func (tranx NewTransaction) AuthOnly() (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

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

func (tranx PreviousTransaction) Capture() (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported type LineItem should have comment or be unexported
Open

type LineItem struct {
Severity: Minor
Found in payment_transactions.go by golint

exported function GetAccessPaymentPage should have comment or be unexported
Open

func GetAccessPaymentPage() {
Severity: Minor
Found in payment_transactions.go by golint

exported type MerchantAuthentication should have comment or be unexported
Open

type MerchantAuthentication struct {
Severity: Minor
Found in payment_transactions.go by golint

exported function UpdateSplitTenderGround should have comment or be unexported
Open

func UpdateSplitTenderGround() {
Severity: Minor
Found in payment_transactions.go by golint

exported function DebitBankAccount should have comment or be unexported
Open

func DebitBankAccount() {
Severity: Minor
Found in payment_transactions.go by golint

exported function CreditBankAccount should have comment or be unexported
Open

func CreditBankAccount() {
Severity: Minor
Found in payment_transactions.go by golint

exported type TransactionMessages should have comment or be unexported
Open

type TransactionMessages struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type CreateTransactionRequest should have comment or be unexported
Open

type CreateTransactionRequest struct {
Severity: Minor
Found in payment_transactions.go by golint

exported function CreditAcceptPaymentTransaction should have comment or be unexported
Open

func CreditAcceptPaymentTransaction() {
Severity: Minor
Found in payment_transactions.go by golint

exported type TransactionSettings should have comment or be unexported
Open

type TransactionSettings struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type UserFields should have comment or be unexported
Open

type UserFields struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type Customer should have comment or be unexported
Open

type Customer struct {
Severity: Minor
Found in payment_transactions.go by golint

exported method NewTransaction.Refund should have comment or be unexported
Open

func (tranx NewTransaction) Refund() (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported type CreditCard should have comment or be unexported
Open

type CreditCard struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type NewTransaction should have comment or be unexported
Open

type NewTransaction struct {
Severity: Minor
Found in payment_transactions.go by golint

exported method NewTransaction.ChargeProfile should have comment or be unexported
Open

func (tranx NewTransaction) ChargeProfile(profile Customer) (*TransactionResponse, error) {
Severity: Minor
Found in payment_transactions.go by golint

exported type TranxResponse should have comment or be unexported
Open

type TranxResponse struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type Message should have comment or be unexported
Open

type Message struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type CreatePayment should have comment or be unexported
Open

type CreatePayment struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type Shipping should have comment or be unexported
Open

type Shipping struct {
Severity: Minor
Found in payment_transactions.go by golint

struct field RefTransId should be RefTransID
Open

    RefTransId      string     `json:"refTransId,omitempty"`
Severity: Minor
Found in payment_transactions.go by golint

exported type Address should have comment or be unexported
Open

type Address struct {
Severity: Minor
Found in payment_transactions.go by golint

exported type TransactionRequest should have comment or be unexported
Open

type TransactionRequest struct {
Severity: Minor
Found in payment_transactions.go by golint

There are no issues that match your filters.

Category
Status