Hunterlong/AuthorizeCIM

View on GitHub
recurring_billing.go

Summary

Maintainability
B
4 hrs
Test Coverage

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

func (sub SetSubscription) Status() (*SubscriptionStatus, error) {
    action := GetSubscriptionStatusRequest{
        ARBGetSubscriptionStatusRequest: ARBGetSubscriptionRequest{
            MerchantAuthentication: GetAuthentication(),
            SubscriptionID:         sub.Id,
Severity: Major
Found in recurring_billing.go and 2 other locations - About 1 hr to fix
recurring_billing.go on lines 181..199
recurring_billing.go on lines 228..246

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

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 3 locations. Consider refactoring.
Open

func (sub SetSubscription) Info() (*GetSubscriptionResponse, error) {
    action := GetSubscriptionRequest{
        ARBGetSubscriptionRequest: ARBGetSubscriptionRequest{
            MerchantAuthentication: GetAuthentication(),
            SubscriptionID:         sub.Id,
Severity: Major
Found in recurring_billing.go and 2 other locations - About 1 hr to fix
recurring_billing.go on lines 208..226
recurring_billing.go on lines 228..246

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

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 3 locations. Consider refactoring.
Open

func (sub SetSubscription) Cancel() (*SubscriptionCancel, error) {
    action := GetSubscriptionCancelRequest{
        ARBCancelSubscriptionRequest: ARBGetSubscriptionRequest{
            MerchantAuthentication: GetAuthentication(),
            SubscriptionID:         sub.Id,
Severity: Major
Found in recurring_billing.go and 2 other locations - About 1 hr to fix
recurring_billing.go on lines 181..199
recurring_billing.go on lines 208..226

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

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 SendSubscription(sub Subscription) (*SubscriptionResponse, error) {
    action := CreateSubscriptionRequest{
        ARBCreateSubscriptionRequest: ARBCreateSubscriptionRequest{
            MerchantAuthentication: GetAuthentication(),
            Subscription:           sub,
Severity: Major
Found in recurring_billing.go and 1 other location - About 1 hr to fix
payment_transactions.go on lines 110..128

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 method SubscriptionResponse.CustomerProfileId should have comment or be unexported
Open

func (response SubscriptionResponse) CustomerProfileId() string {
Severity: Minor
Found in recurring_billing.go by golint

exported type CreateSubscriptionRequest should have comment or be unexported
Open

type CreateSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported method SubscriptionResponse.Approved should have comment or be unexported
Open

func (response SubscriptionResponse) Approved() bool {
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionCancelRequest should have comment or be unexported
Open

type GetSubscriptionCancelRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported function UpdateSubscription should have comment or be unexported
Open

func UpdateSubscription(sub Subscription) (*SubscriptionResponse, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported method GetSubscriptionResponse.ErrorMessage should have comment or be unexported
Open

func (sub GetSubscriptionResponse) ErrorMessage() string {
Severity: Minor
Found in recurring_billing.go by golint

exported type SetSubscription should have comment or be unexported
Open

type SetSubscription struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type Interval should have comment or be unexported
Open

type Interval struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionResponse should have comment or be unexported
Open

type GetSubscriptionResponse struct {
Severity: Minor
Found in recurring_billing.go by golint

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

func (response SubscriptionResponse) Info() string {
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionListRequest should have comment or be unexported
Open

type GetSubscriptionListRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported method SubscriptionResponse.CustomerPaymentProfileId should have comment or be unexported
Open

func (response SubscriptionResponse) CustomerPaymentProfileId() string {
Severity: Minor
Found in recurring_billing.go by golint

method CustomerPaymentProfileId should be CustomerPaymentProfileID
Open

func (response SubscriptionResponse) CustomerPaymentProfileId() string {
Severity: Minor
Found in recurring_billing.go by golint

exported type SubscriptionResponse should have comment or be unexported
Open

type SubscriptionResponse struct {
Severity: Minor
Found in recurring_billing.go by golint

exported method SetSubscription.Cancel should have comment or be unexported
Open

func (sub SetSubscription) Cancel() (*SubscriptionCancel, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported type SubscriptionCancel should have comment or be unexported
Open

type SubscriptionCancel struct {
Severity: Minor
Found in recurring_billing.go by golint

method CustomerProfileId should be CustomerProfileID
Open

func (response SubscriptionResponse) CustomerProfileId() string {
Severity: Minor
Found in recurring_billing.go by golint

exported method SubscriptionResponse.ErrorMessage should have comment or be unexported
Open

func (response SubscriptionResponse) ErrorMessage() string {
Severity: Minor
Found in recurring_billing.go by golint

exported function SubscriptionList should have comment or be unexported
Open

func SubscriptionList(search string) (*GetSubscriptionList, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported type Paging should have comment or be unexported
Open

type Paging struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type ARBUpdateSubscriptionRequest should have comment or be unexported
Open

type ARBUpdateSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported function SendSubscription should have comment or be unexported
Open

func SendSubscription(sub Subscription) (*SubscriptionResponse, error) {
Severity: Minor
Found in recurring_billing.go by golint

struct field SubscriptionId should be SubscriptionID
Open

    SubscriptionId         string                 `json:"subscriptionId,omitempty"`
Severity: Minor
Found in recurring_billing.go by golint

struct field SubscriptionId should be SubscriptionID
Open

    SubscriptionId  string            `json:"subscriptionId,omitempty"`
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionRequest should have comment or be unexported
Open

type GetSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type ARBGetSubscriptionRequest should have comment or be unexported
Open

type ARBGetSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type BillTo should have comment or be unexported
Open

type BillTo struct {
Severity: Minor
Found in recurring_billing.go by golint

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

func (sub GetSubscriptionList) Count() int {
Severity: Minor
Found in recurring_billing.go by golint

exported method SubscriptionStatus.Active should have comment or be unexported
Open

func (s SubscriptionStatus) Active() bool {
Severity: Minor
Found in recurring_billing.go by golint

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

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

exported type PaymentSchedule should have comment or be unexported
Open

type PaymentSchedule struct {
Severity: Minor
Found in recurring_billing.go by golint

struct field Id should be ID
Open

    Id string `json:"subscriptionId"`
Severity: Minor
Found in recurring_billing.go by golint

exported type ARBGetSubscriptionListRequest should have comment or be unexported
Open

type ARBGetSubscriptionListRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type Subscription should have comment or be unexported
Open

type Subscription struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type SubscriptionStatus should have comment or be unexported
Open

type SubscriptionStatus struct {
Severity: Minor
Found in recurring_billing.go by golint

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

func (sub Subscription) Charge() (*SubscriptionResponse, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported type ARBCreateSubscriptionRequest should have comment or be unexported
Open

type ARBCreateSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionStatusRequest should have comment or be unexported
Open

type GetSubscriptionStatusRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

exported type GetSubscriptionList should have comment or be unexported
Open

type GetSubscriptionList struct {
Severity: Minor
Found in recurring_billing.go by golint

exported method SetSubscription.Status should have comment or be unexported
Open

func (sub SetSubscription) Status() (*SubscriptionStatus, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported type Sorting should have comment or be unexported
Open

type Sorting struct {
Severity: Minor
Found in recurring_billing.go by golint

exported method Subscription.Update should have comment or be unexported
Open

func (sub Subscription) Update() (*SubscriptionResponse, error) {
Severity: Minor
Found in recurring_billing.go by golint

exported type UpdateSubscriptionRequest should have comment or be unexported
Open

type UpdateSubscriptionRequest struct {
Severity: Minor
Found in recurring_billing.go by golint

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

func (sub SetSubscription) Info() (*GetSubscriptionResponse, error) {
Severity: Minor
Found in recurring_billing.go by golint

There are no issues that match your filters.

Category
Status