lib/reek/smells/data_clump.rb
#
# Checks the given class or module for multiple identical parameter sets.
#
# @return [Array<SmellWarning>]
#
Checks the given class or module for multiple identical parameter sets.
Checks the given class or module for multiple identical parameter sets .
def examine_context(ctx)
        @max_copies = value(MAX_COPIES_KEY, ctx, DEFAULT_MAX_COPIES)
        @min_clump_size = value(MIN_CLUMP_SIZE_KEY, ctx, DEFAULT_MIN_CLUMP_SIZE)
        MethodGroup.new(ctx, @min_clump_size, @max_copies).clumps.map do |clump, methods|
          SmellWarning.new self,
                           context: ctx.full_name,
                           lines: methods.map(&:line),
                           message: "takes parameters #{DataClump.print_clump(clump)} to #{methods.length} methods",
                           parameters: {
                             PARAMETERS_KEY => clump.map(&:to_s),
                             OCCURRENCES_KEY => methods.length,
                             METHODS_KEY => methods.map(&:name)
                           }
        end
      end
def examine_context ( ctx ) @max_copies = value ( MAX_COPIES_KEY , ctx , DEFAULT_MAX_COPIES ) @min_clump_size = value ( MIN_CLUMP_SIZE_KEY , ctx , DEFAULT_MIN_CLUMP_SIZE ) MethodGroup . new ( ctx , @min_clump_size , @max_copies ) . clumps . map do | clump , methods | SmellWarning . new self , context : ctx . full_name , lines : methods . map ( & :line ) , message : "takes parameters #{DataClump.print_clump(clump)} to #{methods.length} methods" , parameters : { PARAMETERS_KEY => clump . map ( & :to_s ) , OCCURRENCES_KEY => methods . length , METHODS_KEY => methods . map ( & :name ) } end end
Checks the given class or module for multiple identical parameter sets.
Checks the given class or module for multiple identical parameter sets .
None
Array<SmellWarning>
ctx
<not_specific>