lib/reek/smells/uncommunicative_method_name.rb
#
# Checks the given +context+ for uncommunicative names.
#
# @return [Array<SmellWarning>]
#
Checks the given +context+ for uncommunicative names.
Checks the given + context + for uncommunicative names .
def examine_context(ctx)
        @reject_names = value(REJECT_KEY, ctx, DEFAULT_REJECT_SET)
        @accept_names = value(ACCEPT_KEY, ctx, DEFAULT_ACCEPT_SET)
        name = ctx.name.to_s
        return [] if @accept_names.include?(ctx.full_name)
        var = name.gsub(/^[@\*\&]*/, '')
        return [] if @accept_names.include?(var)
        return [] unless @reject_names.find { |patt| patt =~ var }
        [SmellWarning.new(self,
                          context: ctx.full_name,
                          lines: [ctx.exp.line],
                          message: "has the name '#{name}'",
                          parameters: { METHOD_NAME_KEY => name.to_s })]
      end
def examine_context ( ctx ) @reject_names = value ( REJECT_KEY , ctx , DEFAULT_REJECT_SET ) @accept_names = value ( ACCEPT_KEY , ctx , DEFAULT_ACCEPT_SET ) name = ctx . name . to_s return [ ] if @accept_names . include? ( ctx . full_name ) var = name . gsub ( / ^[@ \* \& ]* / , '' ) return [ ] if @accept_names . include? ( var ) return [ ] unless @reject_names . find { | patt | patt =~ var } [ SmellWarning . new ( self , context : ctx . full_name , lines : [ ctx . exp . line ] , message : "has the name '#{name}'" , parameters : { METHOD_NAME_KEY => name . to_s } ) ] end
Checks the given +context+ for uncommunicative names.
Checks the given + context + for uncommunicative names .
None
Array<SmellWarning>
ctx
<not_specific>