Inspectopedia 2025.2 Help

Class with too many methods

Reports classes whose number of methods exceeds the specified maximum.

Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

ClassWithTooManyMethods
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Class metrics

Configure the inspection:

  • Use the Method count limit field to specify the maximum allowed number of methods in a class.

  • Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count.

  • Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass.

Inspection options

Here you can find the description of settings available for the Class with too many methods inspection, and the reference of their default values.

Method count limit

Default value:

20
Ignore simple getter and setter methods

Default value:

Not selected
Ignore methods overriding/implementing a super method

Default value:

Not selected

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection ClassWithTooManyMethods

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025