Showing 5,267 of 5,597 total issues
UpdateMasterDomain#up doesn't depend on instance state (maybe move it to another class?) Open
def up
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
selector_for_table_row_with_cells doesn't depend on instance state (maybe move it to another class?) Open
def selector_for_table_row_with_cells(*cells)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
OnpremisesUpgrade21To22#up doesn't depend on instance state (maybe move it to another class?) Open
def up
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
ApiDocsServiceHelper#numbered_swagger_version doesn't depend on instance state (maybe move it to another class?) Open
def numbered_swagger_version(version)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
BackendHelpers#fake_status doesn't depend on instance state (maybe move it to another class?) Open
def fake_status(code)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
EmailSupport#find_latest_email doesn't depend on instance state (maybe move it to another class?) Open
def find_latest_email(options)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
CapybaraExtensions takes parameters ['locator', 'options'] to 3 methods Open
def find_field(locator, **options)
if has_css?('.pf-c-form__label', text: locator, wait: 0)
find('.pf-c-form__group', text: locator).find('input, textarea, select, .CodeMirror', **options)
else
super
- Read upRead up
- Exclude checks
In general, a Data Clump
occurs when the same two or three items frequently appear together in classes and parameter lists, or when a group of instance variable names start or end with similar substrings.
The recurrence of the items often means there is duplicate code spread around to handle them. There may be an abstraction missing from the code, making the system harder to understand.
Example
Given
class Dummy
def x(y1,y2); end
def y(y1,y2); end
def z(y1,y2); end
end
Reek would emit the following warning:
test.rb -- 1 warning:
[2, 3, 4]:Dummy takes parameters [y1, y2] to 3 methods (DataClump)
A possible way to fix this problem (quoting from Martin Fowler):
The first step is to replace data clumps with objects and use the objects whenever you see them. An immediate benefit is that you'll shrink some parameter lists. The interesting stuff happens as you begin to look for behavior to move into the new objects.
PlanHelpers#default_plan? doesn't depend on instance state (maybe move it to another class?) Open
def default_plan?(plan)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
DeveloperPortal::Admin::Account::BraintreeBlueController has missing safe method 'update_user_and_perform_action!' Open
def update_user_and_perform_action!(result)
- Read upRead up
- Exclude checks
A candidate method for the Missing Safe Method
smell are methods whose names end with an exclamation mark.
An exclamation mark in method names means (the explanation below is taken from here ):
The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.
Such a method is called Missing Safe Method
if and only if her non-bang version does not exist and this method is reported as a smell.
Example
Given
class C
def foo; end
def foo!; end
def bar!; end
end
Reek would report bar!
as Missing Safe Method
smell but not foo!
.
Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:
class Parent
def foo; end
end
module Dangerous
def foo!; end
end
class Son < Parent
include Dangerous
end
class Daughter < Parent
end
In this example, Reek would not report the Missing Safe Method
smell for the method foo
of the Dangerous
module.
BubblesDefaultState#up doesn't depend on instance state (maybe move it to another class?) Open
def up
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
ChangeAuthenticationProvidersAccountType#update_account_type_value doesn't depend on instance state (maybe move it to another class?) Open
def update_account_type_value(word_change)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
index_options doesn't depend on instance state (maybe move it to another class?) Open
def index_options
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
matches_path? doesn't depend on instance state (maybe move it to another class?) Open
def matches_path?(url, path)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
DummyAttachments#dummy_css_filename doesn't depend on instance state (maybe move it to another class?) Open
def dummy_css_filename
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
OnboardingsTenantIdFix#up doesn't depend on instance state (maybe move it to another class?) Open
def up
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
InvoicesHelpers#create_invoice doesn't depend on instance state (maybe move it to another class?) Open
def create_invoice(buyer, date = Time.zone.now, opts = {})
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
FactoryBotStepHelpers#convert_human_hash_to_attribute_hash doesn't depend on instance state (maybe move it to another class?) Open
def convert_human_hash_to_attribute_hash(human_hash, associations = [])
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
PlanHelpers#change_plan_permission_to_sym doesn't depend on instance state (maybe move it to another class?) Open
def change_plan_permission_to_sym(mode)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
DeveloperPortal::Accounts::InviteeSignupsController has missing safe method 'check_invitation!' Open
def check_invitation!
- Read upRead up
- Exclude checks
A candidate method for the Missing Safe Method
smell are methods whose names end with an exclamation mark.
An exclamation mark in method names means (the explanation below is taken from here ):
The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.
Such a method is called Missing Safe Method
if and only if her non-bang version does not exist and this method is reported as a smell.
Example
Given
class C
def foo; end
def foo!; end
def bar!; end
end
Reek would report bar!
as Missing Safe Method
smell but not foo!
.
Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:
class Parent
def foo; end
end
module Dangerous
def foo!; end
end
class Son < Parent
include Dangerous
end
class Daughter < Parent
end
In this example, Reek would not report the Missing Safe Method
smell for the method foo
of the Dangerous
module.
CMS::Handler::Markdown#convert doesn't depend on instance state (maybe move it to another class?) Open
def convert(markup)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.