Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.12 KB

number-methods.md

File metadata and controls

26 lines (16 loc) · 1.12 KB

code pal for ABAP > Documentation > Number of Methods Check

Number of Methods Check

What is the Intent of the Check?

This check counts the number of methods up to a maximum. If there are too many methods in a class, it is an indicator that the single responsibility principle is violated.

How does the check work?

This check counts METHODS and CLASS-METHODS within a global or local, CLASS DEFINITION or INTERFACE. Inherited methods are not counted, however REDEFINED METHODS increment the counter.

How to solve the issue?

The solution is to split the class or interface into multiple classes or interfaces which then contain less methods.

What to do in case of exception?

In exceptional cases, you can suppress this finding by using the pseudo comment "#EC NUMBER_METHODS which should be placed right after the class definition header:

CLASS class_name DEFINITION.   "#EC NUMBER_METHODS
  METHODS method_name_one.
  CLASS-METHODS method_name_two.
ENDCLASS.