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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
exported method SubscriptionResponse.CustomerProfileId should have comment or be unexported Open
func (response SubscriptionResponse) CustomerProfileId() string {
- Exclude checks
exported type CreateSubscriptionRequest should have comment or be unexported Open
type CreateSubscriptionRequest struct {
- Exclude checks
exported method SubscriptionResponse.Approved should have comment or be unexported Open
func (response SubscriptionResponse) Approved() bool {
- Exclude checks
exported type GetSubscriptionCancelRequest should have comment or be unexported Open
type GetSubscriptionCancelRequest struct {
- Exclude checks
exported function UpdateSubscription should have comment or be unexported Open
func UpdateSubscription(sub Subscription) (*SubscriptionResponse, error) {
- Exclude checks
exported method GetSubscriptionResponse.ErrorMessage should have comment or be unexported Open
func (sub GetSubscriptionResponse) ErrorMessage() string {
- Exclude checks
exported type SetSubscription should have comment or be unexported Open
type SetSubscription struct {
- Exclude checks
exported type Interval should have comment or be unexported Open
type Interval struct {
- Exclude checks
exported type GetSubscriptionResponse should have comment or be unexported Open
type GetSubscriptionResponse struct {
- Exclude checks
exported method SubscriptionResponse.Info should have comment or be unexported Open
func (response SubscriptionResponse) Info() string {
- Exclude checks
exported type GetSubscriptionListRequest should have comment or be unexported Open
type GetSubscriptionListRequest struct {
- Exclude checks
exported method SubscriptionResponse.CustomerPaymentProfileId should have comment or be unexported Open
func (response SubscriptionResponse) CustomerPaymentProfileId() string {
- Exclude checks
method CustomerPaymentProfileId should be CustomerPaymentProfileID Open
func (response SubscriptionResponse) CustomerPaymentProfileId() string {
- Exclude checks
exported type SubscriptionResponse should have comment or be unexported Open
type SubscriptionResponse struct {
- Exclude checks
exported method SetSubscription.Cancel should have comment or be unexported Open
func (sub SetSubscription) Cancel() (*SubscriptionCancel, error) {
- Exclude checks
exported type SubscriptionCancel should have comment or be unexported Open
type SubscriptionCancel struct {
- Exclude checks
method CustomerProfileId should be CustomerProfileID Open
func (response SubscriptionResponse) CustomerProfileId() string {
- Exclude checks
exported method SubscriptionResponse.ErrorMessage should have comment or be unexported Open
func (response SubscriptionResponse) ErrorMessage() string {
- Exclude checks
exported function SubscriptionList should have comment or be unexported Open
func SubscriptionList(search string) (*GetSubscriptionList, error) {
- Exclude checks
exported type Paging should have comment or be unexported Open
type Paging struct {
- Exclude checks
exported type ARBUpdateSubscriptionRequest should have comment or be unexported Open
type ARBUpdateSubscriptionRequest struct {
- Exclude checks
exported function SendSubscription should have comment or be unexported Open
func SendSubscription(sub Subscription) (*SubscriptionResponse, error) {
- Exclude checks
struct field SubscriptionId should be SubscriptionID Open
SubscriptionId string `json:"subscriptionId,omitempty"`
- Exclude checks
struct field SubscriptionId should be SubscriptionID Open
SubscriptionId string `json:"subscriptionId,omitempty"`
- Exclude checks
exported type GetSubscriptionRequest should have comment or be unexported Open
type GetSubscriptionRequest struct {
- Exclude checks
exported type ARBGetSubscriptionRequest should have comment or be unexported Open
type ARBGetSubscriptionRequest struct {
- Exclude checks
exported type BillTo should have comment or be unexported Open
type BillTo struct {
- Exclude checks
exported method GetSubscriptionList.Count should have comment or be unexported Open
func (sub GetSubscriptionList) Count() int {
- Exclude checks
exported method SubscriptionStatus.Active should have comment or be unexported Open
func (s SubscriptionStatus) Active() bool {
- Exclude checks
don't use MixedCaps in package name; AuthorizeCIM should be authorizecim Open
package AuthorizeCIM
- Exclude checks
exported type PaymentSchedule should have comment or be unexported Open
type PaymentSchedule struct {
- Exclude checks
struct field Id should be ID Open
Id string `json:"subscriptionId"`
- Exclude checks
exported type ARBGetSubscriptionListRequest should have comment or be unexported Open
type ARBGetSubscriptionListRequest struct {
- Exclude checks
exported type Subscription should have comment or be unexported Open
type Subscription struct {
- Exclude checks
exported type SubscriptionStatus should have comment or be unexported Open
type SubscriptionStatus struct {
- Exclude checks
exported method Subscription.Charge should have comment or be unexported Open
func (sub Subscription) Charge() (*SubscriptionResponse, error) {
- Exclude checks
exported type ARBCreateSubscriptionRequest should have comment or be unexported Open
type ARBCreateSubscriptionRequest struct {
- Exclude checks
exported type GetSubscriptionStatusRequest should have comment or be unexported Open
type GetSubscriptionStatusRequest struct {
- Exclude checks
exported type GetSubscriptionList should have comment or be unexported Open
type GetSubscriptionList struct {
- Exclude checks
exported method SetSubscription.Status should have comment or be unexported Open
func (sub SetSubscription) Status() (*SubscriptionStatus, error) {
- Exclude checks
exported type Sorting should have comment or be unexported Open
type Sorting struct {
- Exclude checks
exported method Subscription.Update should have comment or be unexported Open
func (sub Subscription) Update() (*SubscriptionResponse, error) {
- Exclude checks
exported type UpdateSubscriptionRequest should have comment or be unexported Open
type UpdateSubscriptionRequest struct {
- Exclude checks
exported method SetSubscription.Info should have comment or be unexported Open
func (sub SetSubscription) Info() (*GetSubscriptionResponse, error) {
- Exclude checks