@@ -30,6 +30,7 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
30
30
apply_on_test_code TYPE ycicc_testcode,
31
31
documentation TYPE c LENGTH 1000 ,
32
32
is_threshold_reversed TYPE abap_bool ,
33
+ allow_pseudo_comments TYPE abap_bool ,
33
34
END OF settings.
34
35
35
36
METHODS constructor.
@@ -104,8 +105,7 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
104
105
parameter_04 TYPE csequence OPTIONAL
105
106
is_include_specific TYPE sci_inclspec DEFAULT ' '
106
107
additional_information TYPE xstring OPTIONAL
107
- checksum TYPE int4 OPTIONAL
108
- pseudo_comments TYPE t_comments OPTIONAL . "#EC OPTL_PARAM
108
+ checksum TYPE int4 OPTIONAL . "#EC OPTL_PARAM
109
109
110
110
METHODS get_column_abs REDEFINITION .
111
111
METHODS get_column_rel REDEFINITION .
@@ -149,14 +149,14 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
149
149
METHODS is_structure_type_relevant IMPORTING structure TYPE sstruc
150
150
RETURNING VALUE (result ) TYPE abap_bool .
151
151
152
- METHODS is_app_comp_in_scope IMPORTING level TYPE stmnt_levl
153
- RETURNING value (result ) TYPE abap_bool .
152
+ METHODS is_app_comp_in_scope IMPORTING level TYPE stmnt_levl
153
+ RETURNING VALUE (result ) TYPE abap_bool .
154
154
155
155
ENDCLASS .
156
156
157
157
158
158
159
- CLASS y_check_base IMPLEMENTATION .
159
+ CLASS Y_CHECK_BASE IMPLEMENTATION .
160
160
161
161
162
162
METHOD check_start_conditions .
@@ -181,6 +181,7 @@ CLASS y_check_base IMPLEMENTATION.
181
181
settings-apply_on_productive_code = abap_true .
182
182
settings-apply_on_test_code = abap_true .
183
183
settings-documentation = | { c_docs_path-main } check_documentation.md| .
184
+ settings-allow_pseudo_comments = abap_true .
184
185
185
186
has_attributes = do_attributes_exist( ).
186
187
@@ -298,7 +299,7 @@ CLASS y_check_base IMPLEMENTATION.
298
299
check_configuration-object_creation_date = settings-object_created_on.
299
300
check_configuration-prio = settings-prio.
300
301
check_configuration-threshold = settings-threshold.
301
-
302
+ check_configuration-allow_pseudo_comments = settings-allow_pseudo_comments.
302
303
APPEND check_configuration TO check_configurations.
303
304
ENDIF .
304
305
EXPORT
@@ -307,6 +308,7 @@ CLASS y_check_base IMPLEMENTATION.
307
308
threshold = check_configuration-threshold
308
309
apply_on_productive_code = check_configuration-apply_on_productive_code
309
310
apply_on_testcode = check_configuration-apply_on_testcode
311
+ allow_pseudo_comments = check_configuration-allow_pseudo_comments
310
312
TO DATA BUFFER p_attributes.
311
313
ENDMETHOD .
312
314
@@ -512,6 +514,7 @@ CLASS y_check_base IMPLEMENTATION.
512
514
check_configuration-apply_on_productive_code = settings-apply_on_productive_code.
513
515
check_configuration-apply_on_testcode = settings-apply_on_test_code.
514
516
check_configuration-threshold = settings-threshold.
517
+ check_configuration-allow_pseudo_comments = settings-allow_pseudo_comments.
515
518
ENDIF .
516
519
517
520
INSERT VALUE #(
@@ -550,6 +553,14 @@ CLASS y_check_base IMPLEMENTATION.
550
553
) INTO TABLE sci_attributes.
551
554
ENDIF .
552
555
556
+ IF settings-pseudo_comment IS NOT INITIAL .
557
+ INSERT VALUE #(
558
+ kind = ''
559
+ ref = REF #( check_configuration-allow_pseudo_comments )
560
+ text = | Allow { settings-pseudo_comment } |
561
+ ) INTO TABLE sci_attributes.
562
+ ENDIF .
563
+
553
564
title = description.
554
565
555
566
attributes_ok = abap_false .
@@ -597,7 +608,7 @@ CLASS y_check_base IMPLEMENTATION.
597
608
ENDIF .
598
609
599
610
IF clean_code_exemption_handler IS NOT BOUND .
600
- clean_code_exemption_handler = new y_exemption_handler( ).
611
+ clean_code_exemption_handler = NEW y_exemption_handler( ).
601
612
ENDIF .
602
613
603
614
IF test_code_detector IS NOT BOUND .
@@ -638,6 +649,7 @@ CLASS y_check_base IMPLEMENTATION.
638
649
threshold = check_configuration-threshold
639
650
apply_on_productive_code = check_configuration-apply_on_productive_code
640
651
apply_on_testcode = check_configuration-apply_on_testcode
652
+ allow_pseudo_comments = check_configuration-allow_pseudo_comments
641
653
FROM DATA BUFFER p_attributes.
642
654
APPEND check_configuration TO check_configurations.
643
655
CATCH cx_root. "#EC NEED_CX_ROOT
@@ -647,12 +659,15 @@ CLASS y_check_base IMPLEMENTATION.
647
659
648
660
649
661
METHOD raise_error .
662
+ DATA (pseudo_comment ) = COND sci_pcom( WHEN settings-allow_pseudo_comments = abap_false THEN settings-pseudo_comment
663
+ ELSE space ).
664
+
650
665
statistics->collect( kind = error_priority
651
666
pc = NEW y_pseudo_comment_detector( )->is_pseudo_comment( ref_scan_manager = ref_scan_manager
652
667
scimessages = scimessages
653
668
test = myname
654
669
code = get_code( error_priority )
655
- suppress = settings- pseudo_comment
670
+ suppress = pseudo_comment
656
671
position = statement_index ) ).
657
672
658
673
IF cl_abap_typedescr=>describe_by_object_ref( ref_scan_manager )->get_relative_name( ) EQ 'Y_REF_SCAN_MANAGER' .
@@ -665,17 +680,15 @@ CLASS y_check_base IMPLEMENTATION.
665
680
p_kind = error_priority
666
681
p_test = myname
667
682
p_code = get_code( error_priority )
668
- p_suppress = settings- pseudo_comment
683
+ p_suppress = pseudo_comment
669
684
p_param_1 = parameter_01
670
685
p_param_2 = parameter_02
671
686
p_param_3 = parameter_03
672
687
p_param_4 = parameter_04
673
688
p_inclspec = is_include_specific
674
689
p_detail = additional_information
675
- p_checksum_1 = checksum
676
- p_comments = pseudo_comments ).
690
+ p_checksum_1 = checksum ).
677
691
ENDIF .
678
-
679
692
ENDMETHOD .
680
693
681
694
@@ -797,6 +810,4 @@ CLASS y_check_base IMPLEMENTATION.
797
810
result = abap_true .
798
811
ENDTRY .
799
812
ENDMETHOD .
800
-
801
-
802
813
ENDCLASS .
0 commit comments