Skip to content

Commit 240b567

Browse files
lucasborinLucas Borin
andauthored
1.16.1 (#512)
* changelog + version * DB Access in UT: False Positive (#513) * fixing false positive * changelog Co-authored-by: Lucas Borin <[email protected]> Co-authored-by: Lucas Borin <[email protected]>
1 parent 7a84921 commit 240b567

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Legend
1616
+ : added
1717
- : removed
1818

19+
2021-11-03 v.1.16.1
20+
------------------
21+
* DB Access in UT: False Positive (#513)
22+
1923
2021-11-01 v.1.16.0
2024
------------------
2125
* Prefer New: Dynamic Call with Parameters (#502)

src/checks/y_check_db_access_in_ut.clas.abap

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ CLASS y_check_db_access_in_ut DEFINITION PUBLIC INHERITING FROM y_check_base CRE
3939
END OF keys.
4040

4141
TYPES: BEGIN OF properties,
42-
name TYPE string,
42+
program_name TYPE string,
43+
class_name TYPE string,
4344
risk_level TYPE string,
4445
has_framework TYPE abap_bool,
4546
END OF properties.
@@ -128,12 +129,14 @@ CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION.
128129

129130
METHOD add_line_to_defined_classes.
130131
TRY.
131-
DATA(class_config) = VALUE properties( name = get_class_name( structure ) ).
132+
DATA(class_config) = VALUE properties( program_name = program_name
133+
class_name = get_class_name( structure ) ).
132134
CATCH cx_sy_itab_line_not_found.
133135
RETURN.
134136
ENDTRY.
135137

136-
IF line_exists( defined_classes[ name = class_config-name ] ).
138+
IF line_exists( defined_classes[ program_name = program_name
139+
class_name = class_config-class_name ] ).
137140
RETURN.
138141
ENDIF.
139142

@@ -191,7 +194,8 @@ CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION.
191194
RETURN.
192195
ENDIF.
193196

194-
DATA(defined_superclass) = VALUE #( defined_classes[ name = superclass ] OPTIONAL ).
197+
DATA(defined_superclass) = VALUE #( defined_classes[ program_name = program_name
198+
class_name = superclass ] OPTIONAL ).
195199

196200
" Avoiding false-positives (inheriting from global class which is out of scan scope)
197201
result = xsdbool( defined_superclass-has_framework = abap_true
@@ -206,7 +210,8 @@ CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION.
206210
RETURN.
207211
ENDTRY.
208212

209-
IF NOT line_exists( defined_classes[ name = class_name
213+
IF NOT line_exists( defined_classes[ program_name = program_name
214+
class_name = class_name
210215
has_framework = abap_false ] ).
211216
RETURN.
212217
ENDIF.
@@ -238,7 +243,8 @@ CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION.
238243

239244

240245
METHOD get_forbidden_tokens.
241-
DATA(class) = VALUE #( defined_classes[ name = class_name ] OPTIONAL ).
246+
DATA(class) = VALUE #( defined_classes[ program_name = program_name
247+
class_name = class_name ] OPTIONAL ).
242248

243249
DATA(risk_lvl) = COND #( WHEN class IS NOT INITIAL THEN class-risk_level
244250
ELSE space ).

src/y_code_pal_version.intf.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
INTERFACE y_code_pal_version PUBLIC. "#EC CONS_INTF
2-
CONSTANTS abap TYPE string VALUE '1.16.0' ##NO_TEXT.
2+
CONSTANTS abap TYPE string VALUE '1.16.1' ##NO_TEXT.
33
ENDINTERFACE.

0 commit comments

Comments
 (0)