Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 1.25 KB

interface-in-class.md

File metadata and controls

29 lines (17 loc) · 1.25 KB

code pal for ABAP > Documentation > Interface in Class Check

Interface Missing Check

What is the intent of the check?

This check searches for classes with public methods that are not part of an interface. Methods that are not part of an interface make decoupling more difficult and, especially if the class is declared as final, are much harder to mock in unit tests of consumers.

How does the check work?

This check searches for declarations of methods within the public section of a class that are not redefinitions. It does not care about static methods (CLASS-METHODS).

How to solve the issue?

Make sure to create an interface for public methods.

What to do in case of exception?

In exceptional cases, you can suppress this finding by using the pseudo comment "#EC INTF_IN_CLASS which should be placed right after the PUBLIC SECTION statement:

CLASS class_name DEFINITION.
  PUBLIC SECTION. "#EC INTF_IN_CLASS
ENDCLASS.

Further Readings & Knowledge