public
Description: Code smell detector for Ruby
Home | Edit | New

Large Class

A Large Class is a class or module that has a large number of instance variables, methods or lines of code in any one piece of its specification. (That is, this smell relates to pieces of the class’s specification, not to the size of the corresponding instance of Class.)

Current Support in Reek

Currently Large Class reports classes having more than a configurable number of methods or instance variables. The method count includes public, protected and private methods, and excludes methods inherited from superclasses or included modules.

Configuration

Reek’s Large Class detector supports the Basic Smell Options, plus:

Option Value Effect
max_methods integer The maximum number of methods allowed in a class before a warning is issued. Defaults to 25.
max_instance_variables integer The maximum number of instance variables allowed in a class before a warning is issued. Defaults to 9.

The Large Class detector is disabled whenever Reek is asked to check an instance of Class or Module. The file config/defaults.reek (shipped with the Reek gem) lists the default configuration settings for this smell.

Last edited by kevinrutherford, Mon Jun 15 05:28:14 -0700 2009
Home | Edit | New
Versions: