killbill/killbill-client-ruby

View on GitHub
lib/killbill_client/models/account.rb

Summary

Maintainability
D
2 days
Test Coverage

Class Account has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Account < AccountAttributes

      KILLBILL_API_ACCOUNTS_PREFIX = "#{KILLBILL_API_PREFIX}/accounts"

      include KillBillClient::Model::TagHelper
Severity: Minor
Found in lib/killbill_client/models/account.rb - About 6 hrs to fix

    File account.rb has 340 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module KillBillClient
      module Model
        class Account < AccountAttributes
    
          KILLBILL_API_ACCOUNTS_PREFIX = "#{KILLBILL_API_PREFIX}/accounts"
    Severity: Minor
    Found in lib/killbill_client/models/account.rb - About 4 hrs to fix

      Method set_blocking_state has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def set_blocking_state(state_name, service, is_block_change, is_block_entitlement, is_block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
      Severity: Major
      Found in lib/killbill_client/models/account.rb - About 1 hr to fix

        Method close has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def close(cancel_subscriptions, writeoff_unpaid_invoices,  item_adjust_unpaid_invoices, user = nil, reason = nil, comment = nil, options = {})
        Severity: Major
        Found in lib/killbill_client/models/account.rb - About 50 mins to fix

          Method find_in_batches_by_search_key has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def find_in_batches_by_search_key(search_key, offset = 0, limit = 100, with_balance = false, with_balance_and_cba = false, options = {})
          Severity: Minor
          Found in lib/killbill_client/models/account.rb - About 45 mins to fix

            Method remove_email has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def remove_email(email, user = nil, reason = nil, comment = nil, options = {})
            Severity: Minor
            Found in lib/killbill_client/models/account.rb - About 35 mins to fix

              Method update has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def update(treat_null_as_reset = false, user = nil, reason = nil, comment = nil, options = {})
              Severity: Minor
              Found in lib/killbill_client/models/account.rb - About 35 mins to fix

                Method find_in_batches has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def find_in_batches(offset = 0, limit = 100, with_balance = false, with_balance_and_cba = false, options = {})
                Severity: Minor
                Found in lib/killbill_client/models/account.rb - About 35 mins to fix

                  Method paginated_invoices has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def paginated_invoices(account_id, offset = 0, limit = 100, audit = "NONE", options = {})
                  Severity: Minor
                  Found in lib/killbill_client/models/account.rb - About 35 mins to fix

                    Method find_children has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def find_children(account_id, with_balance = false, with_balance_and_cba = false, audit='NONE', options = {})
                    Severity: Minor
                    Found in lib/killbill_client/models/account.rb - About 35 mins to fix

                      Method paginated_bundles has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              def paginated_bundles(account_id, offset = 0, limit = 100, audit = "NONE", options = {})
                      Severity: Minor
                      Found in lib/killbill_client/models/account.rb - About 35 mins to fix

                        Method add_email has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              def add_email(email, user = nil, reason = nil, comment = nil, options = {})
                        Severity: Minor
                        Found in lib/killbill_client/models/account.rb - About 35 mins to fix

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

                                def all_tags(object_type, included_deleted, audit = 'NONE', options = {})
                                  params = {}
                                  params[:objectType] = object_type if object_type
                                  params[:includedDeleted] = included_deleted if included_deleted
                                  params[:audit] = audit
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 1 other location - About 40 mins to fix
                          lib/killbill_client/models/account.rb on lines 339..347

                          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

                                def blocking_states(blocking_state_types, blocking_state_svcs, audit = 'NONE', options = {})
                                  params = {}
                                  params[:blockingStateTypes] = blocking_state_types if blocking_state_types
                                  params[:blockingStateSvcs] = blocking_state_svcs if blocking_state_svcs
                                  params[:audit] = audit
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 1 other location - About 40 mins to fix
                          lib/killbill_client/models/account.rb on lines 318..326

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

                                def transfer_child_credit(user = nil, reason = nil, comment = nil, options = {})
                                  self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/transferCredit",
                                                  {},
                                                  {},
                                                  {
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 3 other locations - About 25 mins to fix
                          lib/killbill_client/models/account.rb on lines 374..382
                          lib/killbill_client/models/invoice.rb on lines 397..405
                          lib/killbill_client/models/subscription.rb on lines 212..221

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

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

                                def cba_rebalancing(user = nil, reason = nil, comment = nil, options = {})
                                  self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/cbaRebalancing",
                                                  {},
                                                  {},
                                                  {
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 3 other locations - About 25 mins to fix
                          lib/killbill_client/models/account.rb on lines 148..156
                          lib/killbill_client/models/invoice.rb on lines 397..405
                          lib/killbill_client/models/subscription.rb on lines 212..221

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

                          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

                                def create(user = nil, reason = nil, comment = nil, options = {})
                                  created_account = self.class.post KILLBILL_API_ACCOUNTS_PREFIX,
                                                                    to_json,
                                                                    {},
                                                                    {
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 1 other location - About 25 mins to fix
                          lib/killbill_client/models/tag_definition.rb on lines 33..42

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

                          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

                                  def paginated_invoices(account_id, offset = 0, limit = 100, audit = "NONE", options = {})
                                    get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/invoices/pagination",
                                             {
                                              :offset => offset,
                                              :limit => limit,
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 1 other location - About 20 mins to fix
                          lib/killbill_client/models/account.rb on lines 76..84

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

                          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

                                  def paginated_bundles(account_id, offset = 0, limit = 100, audit = "NONE", options = {})
                                    get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/bundles/pagination",
                                                    {
                                                      :offset => offset,
                                                      :limit => limit,
                          Severity: Minor
                          Found in lib/killbill_client/models/account.rb and 1 other location - About 20 mins to fix
                          lib/killbill_client/models/account.rb on lines 87..95

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

                          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

                          There are no issues that match your filters.

                          Category
                          Status