killbill/killbill-client-ruby

View on GitHub

Showing 200 of 200 total issues

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

        def install_plugin(plugin_key, plugin_version=nil, plugin_props=[], local_node_only=false, user = nil, reason = nil, comment = nil, options = {}, timeout_sec=30, sleep_sec=1)
Severity: Major
Found in lib/killbill_client/models/nodes_info.rb - About 1 hr to fix

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

          def create_entitlement_with_add_on(entitlements, entitlement_date, billing_date, migrated = false, rename_key_if_exists_and_unused = true, call_completion_sec = nil, user = nil, reason = nil, comment = nil, options = {})
    Severity: Major
    Found in lib/killbill_client/models/subscription.rb - About 1 hr to fix

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

              def stop_plugin(plugin_key, plugin_version=nil, plugin_props=[], local_node_only=false, user = nil, reason = nil, comment = nil, options = {}, timeout_sec=15, sleep_sec=1)
      Severity: Major
      Found in lib/killbill_client/models/nodes_info.rb - About 1 hr to fix

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

                def uninstall_plugin(plugin_key, plugin_version=nil, plugin_props=[], local_node_only=false, user = nil, reason = nil, comment = nil, options = {}, timeout_sec=15, sleep_sec=1)
        Severity: Major
        Found in lib/killbill_client/models/nodes_info.rb - About 1 hr 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/bundle.rb - About 1 hr to fix

            Method increment_kb_clock has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                    def increment_kb_clock(days, weeks, months, years, time_zone, options)
                      params = {}
                      params[:days] = days unless days.nil?
                      params[:weeks] = weeks unless weeks.nil?
                      params[:months] = months unless months.nil?
            Severity: Minor
            Found in lib/killbill_client/models/admin.rb - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                    def get_queues_entries(account_id, queue_name = '', service_name = '', with_history = true, min_date = '', max_date = '', with_in_processing = true, with_bus_events = true, with_notifications = true, options = {})
            Severity: Major
            Found in lib/killbill_client/models/admin.rb - About 1 hr 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 has_custom_fields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        def has_custom_fields(url_prefix, id_alias)
                          define_method('custom_fields') do |*args|
                
                            audit = args[0] || 'NONE'
                            options = args[1] || {}
                Severity: Minor
                Found in lib/killbill_client/models/helpers/custom_field_helper.rb - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                        def start_plugin(plugin_key, plugin_version=nil, plugin_props=[], local_node_only=false, user = nil, reason = nil, comment = nil, options = {}, timeout_sec=15, sleep_sec=1)
                Severity: Major
                Found in lib/killbill_client/models/nodes_info.rb - About 1 hr 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/subscription.rb - About 1 hr to fix

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

                          def update_quantity(user = nil, reason = nil, comment = nil, effective_from_date = nil, force_new_quantity_with_past_effective_date = nil, options = {})
                            params                  = {}
                            params[:effectiveFromDate] = effective_from_date unless effective_from_date.nil?
                            params[:forceNewQuantityWithPastEffectiveDate] = force_new_quantity_with_past_effective_date unless force_new_quantity_with_past_effective_date.nil?
                    
                    
                    Severity: Major
                    Found in lib/killbill_client/models/subscription.rb and 1 other location - About 1 hr to fix
                    lib/killbill_client/models/subscription.rb on lines 144..157

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

                    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 update_bcd(user = nil, reason = nil, comment = nil, effective_from_date = nil, force_past_effective_date = nil, options = {})
                    
                            params                  = {}
                            params[:effectiveFromDate] = effective_from_date unless effective_from_date.nil?
                            params[:forceNewBcdWithPastEffectiveDate] = force_past_effective_date unless force_past_effective_date.nil?
                    Severity: Major
                    Found in lib/killbill_client/models/subscription.rb and 1 other location - About 1 hr to fix
                    lib/killbill_client/models/subscription.rb on lines 227..239

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

                    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

                    Method change_plan has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def change_plan(input, user = nil, reason = nil, comment = nil,
                                          requested_date = nil, billing_policy = nil, target_phase_type = nil, call_completion = false, options = {})
                    Severity: Major
                    Found in lib/killbill_client/models/subscription.rb - About 1 hr to fix

                      Method upload_tenant_key_value has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              def upload_tenant_key_value(key_name, key_value, key_path, get_method, error_id_str, user = nil, reason = nil, comment = nil, options = {})
                      Severity: Major
                      Found in lib/killbill_client/models/tenant.rb - About 1 hr to fix

                        Method instantiate_record_from_json has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def instantiate_record_from_json(resource_class, data)
                                  record = resource_class.send :new
                        
                                  kb_ancestors = resource_class.ancestors.select { |ancestor| !@@attribute_names[ancestor.name].nil? }
                                  data.each do |name, value|
                        Severity: Minor
                        Found in lib/killbill_client/models/resource.rb - About 1 hr to fix

                          Method encode_params has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def encode_params(options = {})
                                    # Plugin properties and controlPluginNames are passed in the options but we want to send them as query parameters,
                                    # so remove with from global hash and insert them under :params
                                    plugin_properties = options.delete :pluginProperty
                                    if plugin_properties && plugin_properties.size > 0
                          Severity: Minor
                          Found in lib/killbill_client/api/net_http_adapter.rb - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method combo_payment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def combo_payment(user, reason, comment, options, refresh_options = nil)
                                  follow_location = true
                                  follow_location = options.delete(:follow_location) if options.has_key?(:follow_location)
                                  begin
                                    created_transaction = self.class.post "#{Payment::KILLBILL_API_PAYMENTS_PREFIX}/combo",
                          Severity: Minor
                          Found in lib/killbill_client/models/combo_transaction.rb - About 1 hr to fix

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

                                    def upload_catalog_translation(catalog_translation, locale, delete_if_exists, user = nil, reason = nil, comment = nil, options = {})
                            
                                      require_multi_tenant_options!(options, "Uploading a catalog translation is only supported in multi-tenant mode")
                            
                                      params                  = {}
                            Severity: Major
                            Found in lib/killbill_client/models/invoice.rb and 1 other location - About 1 hr to fix
                            lib/killbill_client/models/invoice.rb on lines 257..275

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

                            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 upload_invoice_translation(invoice_translation, locale, delete_if_exists, user = nil, reason = nil, comment = nil, options = {})
                            
                                      require_multi_tenant_options!(options, "Uploading a invoice translation is only supported in multi-tenant mode")
                            
                            
                            
                            Severity: Major
                            Found in lib/killbill_client/models/invoice.rb and 1 other location - About 1 hr to fix
                            lib/killbill_client/models/invoice.rb on lines 290..307

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

                            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
                            Status
                            Source
                            Language