killbill/killbill-client-ruby

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

Summary

Maintainability
C
1 day
Test Coverage

Class Tenant has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Tenant < TenantAttributes
      KILLBILL_API_TENANTS_PREFIX = "#{KILLBILL_API_PREFIX}/tenants"
      KILLBILL_API_TENANTS_NOTIFICATION = "#{KILLBILL_API_TENANTS_PREFIX}/registerNotificationCallback"
      KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION = "#{KILLBILL_API_TENANTS_PREFIX}/uploadPerTenantConfig"
      KILLBILL_API_TENANTS_PLUGIN_PAYMENT_STATE_MACHINE = "#{KILLBILL_API_TENANTS_PREFIX}/uploadPluginPaymentStateMachineConfig"
Severity: Minor
Found in lib/killbill_client/models/tenant.rb - About 2 hrs 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 delete_tenant_key_value has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def delete_tenant_key_value(key_name, key_path, error_id_str, user = nil, reason = nil, comment = nil, options = {})
      Severity: Major
      Found in lib/killbill_client/models/tenant.rb - About 50 mins to fix

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

                def add_payment_state_machine(plugin_name, state_machine_config, user = nil, reason = nil, comment = nil, options = {})
        Severity: Minor
        Found in lib/killbill_client/models/tenant.rb - About 45 mins to fix

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

                  def upload_tenant_user_key_value(key_name, key_value, user = nil, reason = nil, comment = nil, options = {})
          Severity: Minor
          Found in lib/killbill_client/models/tenant.rb - About 45 mins to fix

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

                    def upload_tenant_plugin_config(plugin_name, plugin_config, user = nil, reason = nil, comment = nil, options = {})
            Severity: Minor
            Found in lib/killbill_client/models/tenant.rb - About 45 mins to fix

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  def delete_system_configurations(user = nil, reason = nil, comment = nil, options = {})
                                    require_multi_tenant_options!(options, "System configuration is only supported in multi-tenant mode")
                                    delete "#{KILLBILL_API_TENANTS_SYSTEM_CONFIGURATION}",
                                            {},
                                            {},
                          Severity: Minor
                          Found in lib/killbill_client/models/tenant.rb and 1 other location - About 20 mins to fix
                          lib/killbill_client/models/tenant.rb on lines 128..137

                          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

                                  def delete_push_notification(user = nil, reason = nil, comment = nil, options = {})
                                    require_multi_tenant_options!(options, "Push notification is only supported in multi-tenant mode")
                                    delete "#{KILLBILL_API_TENANTS_NOTIFICATION}",
                                            {},
                                            {},
                          Severity: Minor
                          Found in lib/killbill_client/models/tenant.rb and 1 other location - About 20 mins to fix
                          lib/killbill_client/models/tenant.rb on lines 158..167

                          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

                          There are no issues that match your filters.

                          Category
                          Status