Showing 146 of 200 total issues
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)
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)
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 = {})
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?
- Read upRead up
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 = {})
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 = {})
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] || {}
- Read upRead up
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)
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 = {})
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 = {})
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 = {})
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|
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
- Read upRead up
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",
Method create_bulk_subscriptions
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bulk_subscriptions(bulk_subscription_list, user = nil, reason = nil, comment = nil, entitlement_date = nil, billing_date = nil, call_completion_sec = nil, options = {})
Method trigger_invoice_dry_run
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def trigger_invoice_dry_run(account_id, target_date, upcoming_invoice_target_date, plugin_property = [], user = nil, reason = nil, comment = nil, options = {})
Method chargeback
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def chargeback(payment_id, amount, currency, effective_date = nil, user = nil, reason = nil, comment = nil, options = {})
Method create_subscription_dry_run
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_subscription_dry_run(account_id, bundle_id, target_date, product_name, product_category,
billing_period, price_list_name, options = {})
Method cancel
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def cancel(user = nil, reason = nil, comment = nil, requested_date = nil, entitlementPolicy = nil, billing_policy = nil, use_requested_date_for_billing = nil, options = {})
Method fix_transaction_state
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def fix_transaction_state(payment_id, transaction_id, transaction_status, payment_state_param = {}, user = nil, reason = nil, comment = nil, options = {})