@@ -30,6 +30,7 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
3030 apply_on_test_code TYPE ycicc_testcode,
3131 documentation TYPE c LENGTH 1000 ,
3232 is_threshold_reversed TYPE abap_bool ,
33+ ignore_pseudo_comments TYPE abap_bool ,
3334 END OF settings.
3435
3536 METHODS constructor.
@@ -103,8 +104,7 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
103104 parameter_04 TYPE csequence OPTIONAL
104105 is_include_specific TYPE sci_inclspec DEFAULT ' '
105106 additional_information TYPE xstring OPTIONAL
106- checksum TYPE int4 OPTIONAL
107- pseudo_comments TYPE t_comments OPTIONAL . "#EC OPTL_PARAM
107+ checksum TYPE int4 OPTIONAL . "#EC OPTL_PARAM
108108
109109 METHODS get_column_abs REDEFINITION .
110110 METHODS get_column_rel REDEFINITION .
@@ -148,14 +148,17 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
148148 METHODS is_structure_type_relevant IMPORTING structure TYPE sstruc
149149 RETURNING VALUE (result ) TYPE abap_bool .
150150
151- METHODS is_app_comp_in_scope IMPORTING level TYPE stmnt_levl
152- RETURNING value (result ) TYPE abap_bool .
151+ METHODS is_app_comp_in_scope IMPORTING level TYPE stmnt_levl
152+ RETURNING VALUE (result ) TYPE abap_bool .
153+
154+ METHODS switch_bool IMPORTING boolean TYPE abap_bool
155+ RETURNING VALUE (result ) TYPE abap_bool .
153156
154157ENDCLASS .
155158
156159
157160
158- CLASS y_check_base IMPLEMENTATION .
161+ CLASS Y_CHECK_BASE IMPLEMENTATION .
159162
160163
161164 METHOD check_start_conditions .
@@ -180,6 +183,7 @@ CLASS y_check_base IMPLEMENTATION.
180183 settings-apply_on_productive_code = abap_true .
181184 settings-apply_on_test_code = abap_true .
182185 settings-documentation = | { c_docs_path-main } check_documentation.md| .
186+ settings-ignore_pseudo_comments = abap_false .
183187
184188 has_attributes = do_attributes_exist( ).
185189
@@ -219,10 +223,12 @@ CLASS y_check_base IMPLEMENTATION.
219223 CONTINUE .
220224 ENDIF .
221225
222- IF result IS INITIAL OR is_config_setup_valid( previous_config = result
223- config = <configuration> ) = abap_true .
226+ IF result IS INITIAL
227+ OR is_config_setup_valid( previous_config = result
228+ config = <configuration> ) = abap_true .
224229 result = <configuration> .
225230 ENDIF .
231+
226232 ENDLOOP .
227233
228234 IF result IS INITIAL .
@@ -296,7 +302,7 @@ CLASS y_check_base IMPLEMENTATION.
296302 check_configuration-object_creation_date = settings-object_created_on.
297303 check_configuration-prio = settings-prio.
298304 check_configuration-threshold = settings-threshold.
299-
305+ check_configuration-ignore_pseudo_comments = settings-ignore_pseudo_comments.
300306 APPEND check_configuration TO check_configurations.
301307 ENDIF .
302308 EXPORT
@@ -305,6 +311,7 @@ CLASS y_check_base IMPLEMENTATION.
305311 threshold = check_configuration-threshold
306312 apply_on_productive_code = check_configuration-apply_on_productive_code
307313 apply_on_testcode = check_configuration-apply_on_testcode
314+ ignore_pseudo_comments = check_configuration-ignore_pseudo_comments
308315 TO DATA BUFFER p_attributes.
309316 ENDMETHOD .
310317
@@ -503,6 +510,7 @@ CLASS y_check_base IMPLEMENTATION.
503510 check_configuration-apply_on_productive_code = settings-apply_on_productive_code.
504511 check_configuration-apply_on_testcode = settings-apply_on_test_code.
505512 check_configuration-threshold = settings-threshold.
513+ check_configuration-ignore_pseudo_comments = settings-ignore_pseudo_comments.
506514 ENDIF .
507515
508516 INSERT VALUE #(
@@ -541,6 +549,16 @@ CLASS y_check_base IMPLEMENTATION.
541549 ) INTO TABLE sci_attributes.
542550 ENDIF .
543551
552+ check_configuration-ignore_pseudo_comments = switch_bool( check_configuration-ignore_pseudo_comments ).
553+
554+ IF settings-pseudo_comment IS NOT INITIAL .
555+ INSERT VALUE #(
556+ kind = ''
557+ ref = REF #( check_configuration-ignore_pseudo_comments )
558+ text = | Allow { settings-pseudo_comment } |
559+ ) INTO TABLE sci_attributes.
560+ ENDIF .
561+
544562 title = description.
545563
546564 attributes_ok = abap_false .
@@ -552,8 +570,10 @@ CLASS y_check_base IMPLEMENTATION.
552570 p_message = message
553571 p_display = p_display ) = abap_true .
554572 attributes_ok = abap_true .
573+ check_configuration-ignore_pseudo_comments = switch_bool( check_configuration-ignore_pseudo_comments ).
555574 RETURN .
556575 ENDIF .
576+
557577 IF check_configuration-apply_on_productive_code = abap_false AND
558578 check_configuration-apply_on_testcode = abap_false .
559579 message = 'Choose the Type of Code to be checked' (300 ).
@@ -568,6 +588,8 @@ CLASS y_check_base IMPLEMENTATION.
568588 ENDIF .
569589 ENDWHILE .
570590
591+ check_configuration-ignore_pseudo_comments = switch_bool( check_configuration-ignore_pseudo_comments ).
592+
571593 CLEAR check_configurations.
572594 APPEND check_configuration TO check_configurations.
573595 use_default_attributes = abap_false .
@@ -588,7 +610,7 @@ CLASS y_check_base IMPLEMENTATION.
588610 ENDIF .
589611
590612 IF clean_code_exemption_handler IS NOT BOUND .
591- clean_code_exemption_handler = new y_exemption_handler( ).
613+ clean_code_exemption_handler = NEW y_exemption_handler( ).
592614 ENDIF .
593615
594616 IF test_code_detector IS NOT BOUND .
@@ -629,6 +651,7 @@ CLASS y_check_base IMPLEMENTATION.
629651 threshold = check_configuration-threshold
630652 apply_on_productive_code = check_configuration-apply_on_productive_code
631653 apply_on_testcode = check_configuration-apply_on_testcode
654+ ignore_pseudo_comments = check_configuration-ignore_pseudo_comments
632655 FROM DATA BUFFER p_attributes.
633656 APPEND check_configuration TO check_configurations.
634657 CATCH cx_root. "#EC NEED_CX_ROOT
@@ -638,13 +661,15 @@ CLASS y_check_base IMPLEMENTATION.
638661
639662
640663 METHOD raise_error .
664+ DATA (pseudo_comment ) = COND #( WHEN settings-ignore_pseudo_comments = abap_false THEN settings-pseudo_comment ).
665+ DATA (pcom_detector ) = NEW y_pseudo_comment_detector( )->is_pseudo_comment( ref_scan_manager = ref_scan_manager
666+ scimessages = scimessages
667+ test = myname
668+ code = get_code( error_priority )
669+ suppress = pseudo_comment
670+ position = statement_index ).
641671 statistics->collect( kind = error_priority
642- pc = NEW y_pseudo_comment_detector( )->is_pseudo_comment( ref_scan_manager = ref_scan_manager
643- scimessages = scimessages
644- test = myname
645- code = get_code( error_priority )
646- suppress = settings-pseudo_comment
647- position = statement_index ) ).
672+ pc = pcom_detector ).
648673
649674 IF cl_abap_typedescr=>describe_by_object_ref( ref_scan_manager )->get_relative_name( ) = 'Y_REF_SCAN_MANAGER' .
650675 inform( p_sub_obj_type = object_type
@@ -656,17 +681,15 @@ CLASS y_check_base IMPLEMENTATION.
656681 p_kind = error_priority
657682 p_test = myname
658683 p_code = get_code( error_priority )
659- p_suppress = settings- pseudo_comment
684+ p_suppress = pseudo_comment
660685 p_param_1 = parameter_01
661686 p_param_2 = parameter_02
662687 p_param_3 = parameter_03
663688 p_param_4 = parameter_04
664689 p_inclspec = is_include_specific
665690 p_detail = additional_information
666- p_checksum_1 = checksum
667- p_comments = pseudo_comments ).
691+ p_checksum_1 = checksum ).
668692 ENDIF .
669-
670693 ENDMETHOD .
671694
672695
@@ -730,24 +753,27 @@ CLASS y_check_base IMPLEMENTATION.
730753
731754
732755 METHOD is_config_setup_valid .
733- result = xsdbool ( ( previous_config-prio = config-prio AND is_treshold_config_valid( config_threshold = config-threshold
734- previous_threshold = previous_config-threshold ) = abap_true ) OR
735- ( previous_config-prio <> c_error AND config-prio = c_error ) OR
736- ( previous_config-prio = c_note AND config-prio = c_warning ) ).
756+ result = xsdbool ( ( previous_config-prio = config-prio
757+ AND is_treshold_config_valid( config_threshold = config-threshold
758+ previous_threshold = previous_config-threshold ) = abap_true )
759+ OR ( previous_config-prio <> c_error AND config-prio = c_error )
760+ OR ( previous_config-prio = c_note AND config-prio = c_warning )
761+ OR ( previous_config-ignore_pseudo_comments = abap_false
762+ AND config-ignore_pseudo_comments = abap_true ) ).
737763 ENDMETHOD .
738764
739765
740766 METHOD is_skipped .
741- result = xsdbool ( ( config-threshold < error_count AND settings-is_threshold_reversed = abap_true ) OR
742- ( config-threshold > error_count AND settings-is_threshold_reversed = abap_false ) OR
743- ( is_testcode = abap_true AND config-apply_on_testcode = abap_false ) OR
744- ( is_testcode = abap_false AND config-apply_on_productive_code = abap_false ) ).
767+ result = xsdbool ( ( config-threshold < error_count AND settings-is_threshold_reversed = abap_true )
768+ OR ( config-threshold > error_count AND settings-is_threshold_reversed = abap_false )
769+ OR ( is_testcode = abap_true AND config-apply_on_testcode = abap_false )
770+ OR ( is_testcode = abap_false AND config-apply_on_productive_code = abap_false ) ).
745771 ENDMETHOD .
746772
747773
748774 METHOD is_treshold_config_valid .
749- result = xsdbool ( ( previous_threshold >= config_threshold AND settings-is_threshold_reversed = abap_false ) OR
750- ( previous_threshold < config_threshold AND settings-is_threshold_reversed = abap_true ) ).
775+ result = xsdbool ( ( previous_threshold >= config_threshold AND settings-is_threshold_reversed = abap_false )
776+ OR ( previous_threshold < config_threshold AND settings-is_threshold_reversed = abap_true ) ).
751777 ENDMETHOD .
752778
753779
@@ -790,4 +816,7 @@ CLASS y_check_base IMPLEMENTATION.
790816 ENDMETHOD .
791817
792818
819+ METHOD switch_bool .
820+ result = xsdbool ( boolean = abap_false ).
821+ ENDMETHOD .
793822ENDCLASS .
0 commit comments