app/workers/service_discovery/create_service_worker.rb
ServiceDiscovery::CreateServiceWorker#perform has 4 parameters Open
Open
def perform(account_id, cluster_namespace, cluster_service_name, user_id=nil)
- Read upRead up
- Exclude checks
A Long Parameter List
occurs when a method has a lot of parameters.
Example
Given
class Dummy
def long_list(foo,bar,baz,fling,flung)
puts foo,bar,baz,fling,flung
end
end
Reek would report the following warning:
test.rb -- 1 warning:
[2]:Dummy#long_list has 5 parameters (LongParameterList)
A common solution to this problem would be the introduction of parameter objects.
ServiceDiscovery::CreateServiceWorker#perform doesn't depend on instance state (maybe move it to another class?) Invalid
Invalid
def perform(account_id, cluster_namespace, cluster_service_name, user_id=nil)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.