Skip to content

Commit 20a895e

Browse files
authored
Revert "Part 1 - core feature - allow pseudo comment exception #329 (#357)"
This reverts commit 4da128b.
1 parent 4da128b commit 20a895e

9 files changed

+101
-189
lines changed

src/foundation/y_check_base.clas.abap

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ 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-
allow_pseudo_comments TYPE abap_bool,
3433
END OF settings.
3534

3635
METHODS constructor.
@@ -105,7 +104,8 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
105104
parameter_04 TYPE csequence OPTIONAL
106105
is_include_specific TYPE sci_inclspec DEFAULT ' '
107106
additional_information TYPE xstring OPTIONAL
108-
checksum TYPE int4 OPTIONAL. "#EC OPTL_PARAM
107+
checksum TYPE int4 OPTIONAL
108+
pseudo_comments TYPE t_comments OPTIONAL. "#EC OPTL_PARAM
109109

110110
METHODS get_column_abs REDEFINITION.
111111
METHODS get_column_rel REDEFINITION.
@@ -149,14 +149,14 @@ CLASS y_check_base DEFINITION PUBLIC ABSTRACT
149149
METHODS is_structure_type_relevant IMPORTING structure TYPE sstruc
150150
RETURNING VALUE(result) TYPE abap_bool.
151151

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.
154154

155155
ENDCLASS.
156156

157157

158158

159-
CLASS Y_CHECK_BASE IMPLEMENTATION.
159+
CLASS y_check_base IMPLEMENTATION.
160160

161161

162162
METHOD check_start_conditions.
@@ -181,7 +181,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
181181
settings-apply_on_productive_code = abap_true.
182182
settings-apply_on_test_code = abap_true.
183183
settings-documentation = |{ c_docs_path-main }check_documentation.md|.
184-
settings-allow_pseudo_comments = abap_true.
185184

186185
has_attributes = do_attributes_exist( ).
187186

@@ -299,7 +298,7 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
299298
check_configuration-object_creation_date = settings-object_created_on.
300299
check_configuration-prio = settings-prio.
301300
check_configuration-threshold = settings-threshold.
302-
check_configuration-allow_pseudo_comments = settings-allow_pseudo_comments.
301+
303302
APPEND check_configuration TO check_configurations.
304303
ENDIF.
305304
EXPORT
@@ -308,7 +307,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
308307
threshold = check_configuration-threshold
309308
apply_on_productive_code = check_configuration-apply_on_productive_code
310309
apply_on_testcode = check_configuration-apply_on_testcode
311-
allow_pseudo_comments = check_configuration-allow_pseudo_comments
312310
TO DATA BUFFER p_attributes.
313311
ENDMETHOD.
314312

@@ -514,7 +512,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
514512
check_configuration-apply_on_productive_code = settings-apply_on_productive_code.
515513
check_configuration-apply_on_testcode = settings-apply_on_test_code.
516514
check_configuration-threshold = settings-threshold.
517-
check_configuration-allow_pseudo_comments = settings-allow_pseudo_comments.
518515
ENDIF.
519516

520517
INSERT VALUE #(
@@ -553,14 +550,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
553550
) INTO TABLE sci_attributes.
554551
ENDIF.
555552

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-
564553
title = description.
565554

566555
attributes_ok = abap_false.
@@ -608,7 +597,7 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
608597
ENDIF.
609598

610599
IF clean_code_exemption_handler IS NOT BOUND.
611-
clean_code_exemption_handler = NEW y_exemption_handler( ).
600+
clean_code_exemption_handler = new y_exemption_handler( ).
612601
ENDIF.
613602

614603
IF test_code_detector IS NOT BOUND.
@@ -649,7 +638,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
649638
threshold = check_configuration-threshold
650639
apply_on_productive_code = check_configuration-apply_on_productive_code
651640
apply_on_testcode = check_configuration-apply_on_testcode
652-
allow_pseudo_comments = check_configuration-allow_pseudo_comments
653641
FROM DATA BUFFER p_attributes.
654642
APPEND check_configuration TO check_configurations.
655643
CATCH cx_root. "#EC NEED_CX_ROOT
@@ -659,15 +647,12 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
659647

660648

661649
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-
665650
statistics->collect( kind = error_priority
666651
pc = NEW y_pseudo_comment_detector( )->is_pseudo_comment( ref_scan_manager = ref_scan_manager
667652
scimessages = scimessages
668653
test = myname
669654
code = get_code( error_priority )
670-
suppress = pseudo_comment
655+
suppress = settings-pseudo_comment
671656
position = statement_index ) ).
672657

673658
IF cl_abap_typedescr=>describe_by_object_ref( ref_scan_manager )->get_relative_name( ) EQ 'Y_REF_SCAN_MANAGER'.
@@ -680,15 +665,17 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
680665
p_kind = error_priority
681666
p_test = myname
682667
p_code = get_code( error_priority )
683-
p_suppress = pseudo_comment
668+
p_suppress = settings-pseudo_comment
684669
p_param_1 = parameter_01
685670
p_param_2 = parameter_02
686671
p_param_3 = parameter_03
687672
p_param_4 = parameter_04
688673
p_inclspec = is_include_specific
689674
p_detail = additional_information
690-
p_checksum_1 = checksum ).
675+
p_checksum_1 = checksum
676+
p_comments = pseudo_comments ).
691677
ENDIF.
678+
692679
ENDMETHOD.
693680

694681

@@ -810,4 +797,6 @@ CLASS Y_CHECK_BASE IMPLEMENTATION.
810797
result = abap_true.
811798
ENDTRY.
812799
ENDMETHOD.
800+
801+
813802
ENDCLASS.

src/foundation/y_clean_code_manager.clas.abap

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@ CLASS y_clean_code_manager DEFINITION PUBLIC CREATE PUBLIC.
44
ALIASES calculate_obj_creation_date FOR y_if_clean_code_manager~calculate_obj_creation_date.
55
ALIASES read_check_customizing FOR y_if_clean_code_manager~read_check_customizing.
66

7-
PROTECTED SECTION.
87
PRIVATE SECTION.
98
METHODS determine_profiles RETURNING VALUE(result) TYPE string_table
10-
RAISING ycx_no_check_customizing.
9+
RAISING ycx_no_check_customizing.
1110

12-
METHODS determine_checks IMPORTING profile TYPE ycicc_profile
13-
checkid TYPE seoclsname
11+
METHODS determine_checks IMPORTING profile TYPE ycicc_profile
12+
checkid TYPE seoclsname
1413
RETURNING VALUE(result) TYPE y_if_clean_code_manager=>check_configurations
15-
RAISING ycx_no_check_customizing .
14+
RAISING ycx_no_check_customizing .
1615
ENDCLASS.
1716

1817

19-
20-
CLASS Y_CLEAN_CODE_MANAGER IMPLEMENTATION.
18+
CLASS y_clean_code_manager IMPLEMENTATION.
2119

2220

2321
METHOD determine_checks.
@@ -35,9 +33,7 @@ CLASS Y_CLEAN_CODE_MANAGER IMPLEMENTATION.
3533
threshold = <check>-threshold
3634
prio = <check>-prio
3735
apply_on_productive_code = <check>-apply_on_productive_code
38-
apply_on_testcode = <check>-apply_on_testcode
39-
allow_pseudo_comments = <check>-ignore_pseudo_comments
40-
).
36+
apply_on_testcode = <check>-apply_on_testcode ).
4137
result = VALUE #( BASE result ( CORRESPONDING #( check_configuration ) ) ).
4238
ENDLOOP.
4339
ENDMETHOD.
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
INTERFACE y_if_clean_code_manager
2-
PUBLIC .
1+
interface Y_IF_CLEAN_CODE_MANAGER
2+
public .
33

44

5-
TYPES:
5+
types:
66
BEGIN OF check_configuration,
77
object_creation_date TYPE datum,
88
threshold TYPE ycicc_threshold,
99
prio TYPE ycicc_message_kind,
1010
apply_on_productive_code TYPE ycicc_productive_code,
1111
apply_on_testcode TYPE ycicc_testcode,
12-
allow_pseudo_comments TYPE ycicp_pseudo_comments,
1312
END OF check_configuration .
14-
TYPES:
13+
types:
1514
check_configurations TYPE STANDARD TABLE OF check_configuration WITH DEFAULT KEY .
1615

17-
METHODS read_check_customizing
18-
IMPORTING
19-
checkid TYPE seoclsname
20-
RETURNING
21-
VALUE(result) TYPE check_configurations
22-
RAISING
23-
ycx_no_check_customizing .
24-
METHODS calculate_obj_creation_date
25-
IMPORTING
26-
object_name TYPE sobj_name
27-
object_type TYPE trobjtype
28-
RETURNING
29-
VALUE(result) TYPE creationdt .
30-
ENDINTERFACE.
16+
methods READ_CHECK_CUSTOMIZING
17+
importing
18+
CHECKID type SEOCLSNAME
19+
returning
20+
value(RESULT) type CHECK_CONFIGURATIONS
21+
raising
22+
YCX_NO_CHECK_CUSTOMIZING .
23+
methods CALCULATE_OBJ_CREATION_DATE
24+
importing
25+
OBJECT_NAME type SOBJ_NAME
26+
OBJECT_TYPE type TROBJTYPE
27+
returning
28+
value(RESULT) type CREATIONDT .
29+
endinterface.

src/foundation/ycicp_pseudo_comments.dtel.xml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)