abaplint fixes (#276)

This commit is contained in:
oblomov 2023-06-16 10:55:26 +02:00 committed by GitHub
parent c3a327a3bd
commit 41547ee4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 311 additions and 345 deletions

View File

@ -16,7 +16,7 @@
"rules": {
"7bit_ascii": false,
"abapdoc": false,
"align_parameters": false,
"align_parameters": true,
"allowed_object_naming": true,
"allowed_object_types": true,
"ambiguous_statement": true,
@ -45,7 +45,7 @@
"classic_exceptions_overlap": true,
"cloud_types": true,
"colon_missing_space": true,
"commented_code": false,
"commented_code": true,
"constant_classes": {
"exclude": [],
"severity": "Error",
@ -63,13 +63,13 @@
"severity": "Error",
"max": 20
},
"dangerous_statement": false,
"dangerous_statement": true,
"db_operation_in_loop": true,
"definitions_top": false,
"description_empty": true,
"double_space": true,
"downport": true,
"empty_line_in_statement": false,
"empty_line_in_statement": true,
"empty_statement": true,
"empty_structure": {
"loop": true,
@ -105,7 +105,7 @@
},
"global_class": true,
"identical_conditions": true,
"identical_contents": false,
"identical_contents": true,
"identical_descriptions": true,
"identical_form_names": true,
"if_in_if": true,
@ -114,12 +114,12 @@
"indentation": false,
"inline_data_old_versions": true,
"intf_referencing_clas": true,
"keep_single_parameter_on_one_line": false,
"keep_single_parameter_on_one_line": true,
"keyword_case": false,
"line_break_multiple_parameters": false,
"line_break_style": false,
"line_break_style": true,
"line_length": false,
"line_only_punc": false,
"line_only_punc": true,
"local_class_naming": false,
"local_testclass_consistency": true,
"local_variable_names": false,

View File

@ -274,7 +274,6 @@ CLASS z2ui5_cl_http_handler IMPLEMENTATION.
` }` && |\n| &&
` sap.ui.core.BusyIndicator.hide();` && |\n| &&
` };` &&
` sap.z2ui5.checkLogActive = ` && z2ui5_lcl_utility=>get_json_boolean( check_logging ) && `;` && |\n| &&
` });` && |\n| &&
`</script><abc/>` && |\n| &&

View File

@ -68,8 +68,7 @@ CLASS ltcl_unit_01_json IMPLEMENTATION.
METHOD test_json_object.
DATA(lo_tree) = NEW z2ui5_lcl_utility_tree_json( ).
lo_tree->add_attribute_object( `CCC`
)->add_attribute( n = `AAA` v = `BBB` ).
lo_tree->add_attribute_object( `CCC` )->add_attribute( n = `AAA` v = `BBB` ).
DATA(lv_result) = lo_tree->stringify( ).
IF `{"CCC":{"AAA":"BBB"}}` <> lv_result.
@ -88,8 +87,7 @@ CLASS ltcl_unit_01_json IMPLEMENTATION.
DATA(ls_test) = VALUE ty_S_test( comp1 = `AAA` comp2 = `BBB` ).
lo_tree->add_attribute_object( `CCC`
)->add_attribute_struc( ls_test ).
lo_tree->add_attribute_object( `CCC` )->add_attribute_struc( ls_test ).
DATA(lv_result) = lo_tree->stringify( ).
IF `{"CCC":{"COMP1":"AAA","COMP2":"BBB"}}` <> lv_result.
@ -153,20 +151,7 @@ ENDCLASS.
CLASS ltcl_unit_01_utility IMPLEMENTATION.
METHOD test_util_04_attri_by_ref.
* DATA(lo_app) = NEW ltcl_unit_04_deep_data( ).
*
* DATA(lt_attri) = z2ui5_lcl_utility=>get_t_attri_by_ref( lo_app ).
*
* DATA(lt_test) = VALUE z2ui5_lcl_utility=>ty_t_attri(
*( name = `Z2UI5_IF_APP~ID` type_kind = `g` type = `STRING` bind_type = `` data_stringify = `` gen_type_kind = `` gen_type = `` gen_kind = `` )
*( name = `CHECK_INITIALIZED` type_kind = `C` type = `ABAP_BOOL` bind_type = `` data_stringify = `` gen_type_kind = `` gen_type = `` gen_kind = `` )
*( name = `SV_STATUS` type_kind = `g` type = `STRING` bind_type = `` data_stringify = `` gen_type_kind = `` gen_type = `` gen_kind = `` )
*( name = `T_TAB` type_kind = `h` type = `` bind_type = `` data_stringify = `` gen_type_kind = `` gen_type = `` gen_kind = `` )
* ).
*
* IF lt_test <> lt_attri.
* cl_abap_unit_assert=>fail( msg = 'utility - get t_attri table wrong' quit = 5 ).
* ENDIF.
ENDMETHOD.
METHOD test_util_uuid_session.
@ -422,10 +407,9 @@ CLASS ltcl_unit_02_app_start IMPLEMENTATION.
ENDMETHOD.
METHOD test_bind_one_way.
z2ui5_cl_http_handler=>client = VALUE #(
t_header = VALUE #( ( name = '~path_info' value = 'LTCL_UNIT_02_APP_START' ) )
" t_param = VALUE #( ( name = 'app' value = 'LTCL_UNIT_02_APP_START' ) )
).
t_header = VALUE #( ( name = '~path_info' value = 'LTCL_UNIT_02_APP_START' ) ) ).
sv_state = `TEST_ONE_WAY`.
DATA(lv_response) = z2ui5_cl_http_handler=>http_post( ).
@ -612,28 +596,9 @@ CLASS ltcl_unit_02_app_start IMPLEMENTATION.
/ui2/cl_json=>deserialize( EXPORTING json = lv_response
CHANGING data = lo_data ).
" FIELD-SYMBOLS <val> TYPE any.
* UNASSIGN <val>.
* DATA(lv_assign) = `OMESSAGE->CONTROL->*`.
* ASSIGN lo_data->(lv_assign) TO <val>.
* IF <val> <> `MessageBox`.
* cl_abap_unit_assert=>fail( msg = 'message box - control wrong' quit = 5 ).
* ENDIF.
*
* UNASSIGN <val>.
* lv_assign = `OMESSAGE->TEXT->*`.
* ASSIGN lo_data->(lv_assign) TO <val>.
* IF <val> <> `test message box`.
* cl_abap_unit_assert=>fail( msg = 'message box - text wrong' quit = 5 ).
* ENDIF.
*
* UNASSIGN <val>.
* lv_assign = `OMESSAGE->TYPE->*`.
* ASSIGN lo_data->(lv_assign) TO <val>.
* IF <val> <> `information`.
* cl_abap_unit_assert=>fail( msg = 'message box - type wrong' quit = 5 ).
* ENDIF.
ENDMETHOD.
METHOD test_startup_path.
@ -647,7 +612,7 @@ CLASS ltcl_unit_02_app_start IMPLEMENTATION.
/ui2/cl_json=>deserialize( EXPORTING json = lv_response
CHANGING data = lo_data ).
" FIELD-SYMBOLS <val> TYPE any.
ENDMETHOD.
METHOD test_navigate.
@ -661,7 +626,7 @@ CLASS ltcl_unit_02_app_start IMPLEMENTATION.
/ui2/cl_json=>deserialize( EXPORTING json = lv_response
CHANGING data = lo_data ).
" FIELD-SYMBOLS <val> TYPE any.
ENDMETHOD.
ENDCLASS.

View File

@ -1278,11 +1278,13 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
METHOD hlp_get_source_code_url.
DATA(lv_url) = z2ui5_cl_http_handler=>client-t_header[ name = `referer` ]-value.
" TODO: variable is assigned but never used (ABAP cleaner)
SPLIT lv_url AT '?' INTO lv_url DATA(lv_dummy).
result = z2ui5_cl_http_handler=>client-t_header[ name = `origin` ]-value && `/sap/bc/adt/oo/classes/` && lcl_utility=>get_classname_by_ref(
app ) && `/source/main`.
result = z2ui5_cl_http_handler=>client-t_header[ name = `origin` ]-value &&
`/sap/bc/adt/oo/classes/` && lcl_utility=>get_classname_by_ref( app ) &&
`/source/main`.
ENDMETHOD.
METHOD hlp_replace_controller_name.