Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Whenever you upgrade code pal for ABAP, it is highly recommended to execute the

2021-08-XX v.1.16.0
------------------
* BAdI example class vs Percentage Comment (#443)
* Unit-Test Assert Validator (#450)
+ Prefer Pragmas to Pseudo Comments (#421)
+ COLLECT restriction (#441)
Expand Down
25 changes: 25 additions & 0 deletions src/checks/y_check_comment_usage.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CLASS y_check_comment_usage DEFINITION PUBLIC INHERITING FROM y_check_base CREAT
METHODS constructor.

PROTECTED SECTION.
METHODS execute_check REDEFINITION.
METHODS inspect_statements REDEFINITION.
METHODS inspect_tokens REDEFINITION.

Expand All @@ -26,6 +27,8 @@ CLASS y_check_comment_usage DEFINITION PUBLIC INHERITING FROM y_check_base CREAT
start_with TYPE string
RETURNING VALUE(result) TYPE abap_bool
RAISING cx_sy_range_out_of_bounds.

METHODS is_badi_example_class RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.


Expand All @@ -51,6 +54,12 @@ CLASS y_check_comment_usage IMPLEMENTATION.
ENDMETHOD.


METHOD execute_check.
CHECK is_badi_example_class( ) = abap_false.
super->execute_check( ).
ENDMETHOD.


METHOD inspect_statements.
abs_statement_number = 0.
comment_number = 0.
Expand Down Expand Up @@ -165,4 +174,20 @@ CLASS y_check_comment_usage IMPLEMENTATION.

result = xsdbool( is_function_module = abap_false ).
ENDMETHOD.


METHOD is_badi_example_class.
CHECK object_type = 'CLAS'.

SELECT SINGLE enhspot
FROM enhspotobj
INTO @DATA(enhancement)
WHERE obj_type = @object_type
AND obj_name = @object_name
AND VERSION = 'A'.

result = xsdbool( enhancement IS NOT INITIAL ).
ENDMETHOD.


ENDCLASS.