chartmogul/chartmogul-ruby

View on GitHub

Showing 13 of 13 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Transactions
    class Refund < APIResource
      set_resource_name 'Refund Transaction'
      set_resource_path '/v1/import/invoices/:invoice_uuid/transactions'

Severity: Minor
Found in lib/chartmogul/transactions/refund.rb and 1 other location - About 40 mins to fix
lib/chartmogul/transactions/payment.rb on lines 4..24

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

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
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Transactions
    class Payment < APIResource
      set_resource_name 'Payment Transaction'
      set_resource_path '/v1/import/invoices/:invoice_uuid/transactions'

Severity: Minor
Found in lib/chartmogul/transactions/payment.rb and 1 other location - About 40 mins to fix
lib/chartmogul/transactions/refund.rb on lines 4..24

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

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
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def set_line_items(line_items_attributes)
      @line_items = line_items_attributes.map.with_index do |line_item_attributes, index|
        existing_line_item = line_items[index]

        if existing_line_item
Severity: Minor
Found in lib/chartmogul/invoice.rb and 1 other location - About 20 mins to fix
lib/chartmogul/invoice.rb on lines 50..58

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

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
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def set_transactions(transactions_attributes)
      @transactions = transactions_attributes.map.with_index do |transaction_attributes, index|
        existing_transaction = transactions[index]

        if existing_transaction
Severity: Minor
Found in lib/chartmogul/invoice.rb and 1 other location - About 20 mins to fix
lib/chartmogul/invoice.rb on lines 37..45

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

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
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    class Activities < APIResource
      set_resource_name 'Activities'
      set_resource_path '/v1/customers/:customer_uuid/activities'

      include Concerns::Entries
Severity: Minor
Found in lib/chartmogul/metrics/activity.rb and 1 other location - About 15 mins to fix
lib/chartmogul/metrics/subscription.rb on lines 25..35

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class MRRChurnRate < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :mrr_churn_rate
    end
Severity: Minor
Found in lib/chartmogul/metrics/mrr_churn_rate.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17

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

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
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    class Subscriptions < APIResource
      set_resource_name 'Subscriptions'
      set_resource_path '/v1/customers/:customer_uuid/subscriptions'

      include Concerns::Entries
Severity: Minor
Found in lib/chartmogul/metrics/subscription.rb and 1 other location - About 15 mins to fix
lib/chartmogul/metrics/activity.rb on lines 21..31

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class LTV < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :ltv
    end
Severity: Minor
Found in lib/chartmogul/metrics/ltv.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class ARPA < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :arpa
    end
Severity: Minor
Found in lib/chartmogul/metrics/arpa.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class ARR < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :arr
    end
Severity: Minor
Found in lib/chartmogul/metrics/arr.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class CustomerChurnRate < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :customer_churn_rate
    end
Severity: Minor
Found in lib/chartmogul/metrics/customer_churn_rate.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class ASP < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :asp
    end
Severity: Minor
Found in lib/chartmogul/metrics/asp.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/customer_count.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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 7 locations. Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

  module Metrics
    class CustomerCount < ChartMogul::Object
      readonly_attr :date, type: :date
      readonly_attr :customers
    end
Severity: Minor
Found in lib/chartmogul/metrics/customer_count.rb and 6 other locations - About 15 mins to fix
lib/chartmogul/metrics/arpa.rb on lines 4..17
lib/chartmogul/metrics/arr.rb on lines 4..17
lib/chartmogul/metrics/asp.rb on lines 4..17
lib/chartmogul/metrics/customer_churn_rate.rb on lines 4..17
lib/chartmogul/metrics/ltv.rb on lines 4..17
lib/chartmogul/metrics/mrr_churn_rate.rb on lines 4..17

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

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

Severity
Category