Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix UncommunicativeVariableName detector. #1164

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/reek/smell_detectors/uncommunicative_variable_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,25 @@ def self.contexts
end

#
# Checks the given +context+ for uncommunicative names.
# Checks the given context for uncommunicative names.
#
#
# @param ctx [Context::MethodContext]
# @return [Array<SmellWarning>]
#
# Given this code:
#
# def alfa
# x = 5
# end
#
# An example `ctx` could look like this:
#
# s(:def, :alfa,
# s(:args),
# s(:lvasgn, :x,
# s(:int, 5)))
#
def sniff(ctx)
self.reject_names = value(REJECT_KEY, ctx)
self.accept_names = value(ACCEPT_KEY, ctx)
Expand Down