Inspectopedia Help

Method naming convention

Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern.

Instance methods that override library methods and constructors are ignored by this inspection.

Example: if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default), the following static method produces a warning, because the length of its name is 3, which is less than 4: public static int max(int a, int b).

A quick-fix that renames such methods is available only in the editor.

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.

NewMethodNamingConvention
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 | Naming conventions | Method

Configure the inspection:

Use the list in the Options section to specify which methods should be checked. Deselect the checkboxes for the method types for which you want to skip the check. Specify 0 in the length fields to skip the corresponding checks.

Regular expressions should be specified in the standard java.util.regex format.

Inspection options

Here you can find the description of settings available for the Method naming convention inspection, and the reference of their default values.

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.2, Qodana for JVM 2024.2,

Can be installed with plugin:

Java, 242.22892

Last modified: 11 September 2024