vendor/jruby/1.9/gems/reek-1.6.5/lib/reek/smells/too_many_instance_variables.rb
#
# Checks +klass+ for too many instance variables.
#
# @return [Array<SmellWarning>]
#
Checks +klass+ for too many instance variables.
Checks + klass + for too many instance variables .
def examine_context(ctx)
        @max_allowed_ivars = value(MAX_ALLOWED_IVARS_KEY, ctx, DEFAULT_MAX_IVARS)
        count = ctx.local_nodes(:ivasgn).map { |ivasgn| ivasgn[1] }.uniq.length
        return [] if count <= @max_allowed_ivars
        [SmellWarning.new(self,
                          context: ctx.full_name,
                          lines: [ctx.exp.line],
                          message: "has at least #{count} instance variables",
                          parameters: { count: count })]
      end
def examine_context ( ctx ) @max_allowed_ivars = value ( MAX_ALLOWED_IVARS_KEY , ctx , DEFAULT_MAX_IVARS ) count = ctx . local_nodes ( :ivasgn ) . map { | ivasgn | ivasgn [ 1 ] } . uniq . length return [ ] if count <= @max_allowed_ivars [ SmellWarning . new ( self , context : ctx . full_name , lines : [ ctx . exp . line ] , message : "has at least #{count} instance variables" , parameters : { count : count } ) ] end
Checks +klass+ for too many instance variables.
Checks + klass + for too many instance variables .
None
Array<SmellWarning>
ctx