datajuicer/LLaMA-1B-dj-refine-150B
Text Generation
•
Updated
•
44.5k
hexsha
stringlengths 40
40
| size
int64 356
30.6k
| ext
stringclasses 1
value | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 27
62
| max_stars_repo_name
stringclasses 16
values | max_stars_repo_head_hexsha
stringclasses 16
values | max_stars_repo_licenses
sequence | max_stars_count
int64 199
797
| max_stars_repo_stars_event_min_datetime
stringclasses 5
values | max_stars_repo_stars_event_max_datetime
stringclasses 5
values | max_issues_repo_path
stringlengths 28
62
| max_issues_repo_name
stringclasses 15
values | max_issues_repo_head_hexsha
stringclasses 15
values | max_issues_repo_licenses
sequence | max_issues_count
int64 278
2.78k
| max_issues_repo_issues_event_min_datetime
stringclasses 5
values | max_issues_repo_issues_event_max_datetime
stringclasses 5
values | max_forks_repo_path
stringlengths 28
62
| max_forks_repo_name
stringclasses 15
values | max_forks_repo_head_hexsha
stringclasses 15
values | max_forks_repo_licenses
sequence | max_forks_count
int64 59
499
| max_forks_repo_forks_event_min_datetime
stringclasses 5
values | max_forks_repo_forks_event_max_datetime
stringclasses 5
values | text
stringlengths 355
30.6k
| avg_line_length
float64 14.1
51.1
| max_line_length
int64 48
140
| alphanum_fraction
float64 0.46
0.79
| stats
dict | simhash
float64 126,633,855B
18,322,467,230B
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7413ec96dcef18660c1c9193a3bf5ceb94585a0 | 10,730 | abap | ABAP | src/ui/zcl_abapgit_gui_page_tag.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/ui/zcl_abapgit_gui_page_tag.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/ui/zcl_abapgit_gui_page_tag.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_gui_page_tag DEFINITION PUBLIC FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
CONSTANTS: BEGIN OF c_action,
commit_post TYPE string VALUE 'commit_post',
commit_cancel TYPE string VALUE 'commit_cancel',
change_tag_type TYPE string VALUE 'change_tag_type',
END OF c_action.
METHODS:
constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_tag_type,
lightweight TYPE string VALUE 'lightweight',
annotated TYPE string VALUE 'annotated',
END OF c_tag_type .
DATA mo_repo_online TYPE REF TO zcl_abapgit_repo_online .
DATA mv_selected_type TYPE string .
METHODS render_menu
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
METHODS render_form
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_text_input
IMPORTING
!iv_name TYPE string
!iv_label TYPE string
!iv_value TYPE string OPTIONAL
!iv_max_length TYPE string OPTIONAL
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
METHODS create_tag
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RAISING
zcx_abapgit_exception .
METHODS parse_tag_request
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_git_tag) TYPE zif_abapgit_definitions=>ty_git_tag
RAISING
zcx_abapgit_exception .
METHODS parse_change_tag_type_request
IMPORTING
!it_postdata TYPE zif_abapgit_html_viewer=>ty_post_data .
METHODS render_scripts
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_TAG IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_repo_online ?= io_repo.
ms_control-page_title = 'Tag'.
mv_selected_type = c_tag_type-lightweight.
ENDMETHOD.
METHOD create_tag.
DATA:
ls_tag TYPE zif_abapgit_definitions=>ty_git_tag,
lx_error TYPE REF TO zcx_abapgit_exception,
lv_text TYPE string.
ls_tag = parse_tag_request( ii_event ).
IF ls_tag-name IS INITIAL.
zcx_abapgit_exception=>raise( |Please supply a tag name| ).
ENDIF.
ls_tag-name = zcl_abapgit_git_tag=>add_tag_prefix( ls_tag-name ).
ASSERT ls_tag-name CP zif_abapgit_definitions=>c_git_branch-tags.
CASE mv_selected_type.
WHEN c_tag_type-lightweight.
ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-lightweight_tag.
WHEN c_tag_type-annotated.
ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Invalid tag type: { mv_selected_type }| ).
ENDCASE.
TRY.
zcl_abapgit_git_porcelain=>create_tag( iv_url = mo_repo_online->get_url( )
is_tag = ls_tag ).
CATCH zcx_abapgit_exception INTO lx_error.
zcx_abapgit_exception=>raise( |Cannot create tag { ls_tag-name }. Error: '{ lx_error->get_text( ) }'| ).
ENDTRY.
IF ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-lightweight_tag.
lv_text = |Lightweight tag { zcl_abapgit_git_tag=>remove_tag_prefix( ls_tag-name ) } created|.
ELSEIF ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
lv_text = |Annotated tag { zcl_abapgit_git_tag=>remove_tag_prefix( ls_tag-name ) } created|.
ENDIF.
MESSAGE lv_text TYPE 'S'.
ENDMETHOD.
METHOD parse_change_tag_type_request.
FIELD-SYMBOLS <lv_postdata> LIKE LINE OF it_postdata.
READ TABLE it_postdata ASSIGNING <lv_postdata> INDEX 1.
IF sy-subrc = 0.
FIND FIRST OCCURRENCE OF REGEX `type=(.*)` IN <lv_postdata> SUBMATCHES mv_selected_type.
ENDIF.
mv_selected_type = condense( mv_selected_type ).
ENDMETHOD.
METHOD parse_tag_request.
DATA lo_map TYPE REF TO zcl_abapgit_string_map.
lo_map = ii_event->form_data( ).
lo_map->strict( abap_false ). " Hack, refactor !
lo_map->to_abap( CHANGING cs_container = rs_git_tag ).
REPLACE ALL OCCURRENCES
OF zif_abapgit_definitions=>c_crlf
IN rs_git_tag-body
WITH zif_abapgit_definitions=>c_newline.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div class="repo">' ).
ri_html->add( render_menu( ) ).
ri_html->add( render_form( ) ).
ri_html->add( '</div>' ).
register_deferred_script( render_scripts( ) ).
ENDMETHOD.
METHOD render_form.
CONSTANTS: lc_body_col_max TYPE i VALUE 150.
DATA: li_user TYPE REF TO zif_abapgit_persist_user,
lv_user TYPE string,
lv_email TYPE string,
lv_s_param TYPE string,
lo_settings TYPE REF TO zcl_abapgit_settings,
lv_body_size TYPE i,
lt_type TYPE string_table,
lv_selected TYPE string.
FIELD-SYMBOLS: <lv_type> LIKE LINE OF lt_type.
li_user = zcl_abapgit_persistence_user=>get_instance( ).
lv_user = li_user->get_repo_git_user_name( mo_repo_online->get_url( ) ).
IF lv_user IS INITIAL.
lv_user = li_user->get_default_git_user_name( ).
ENDIF.
IF lv_user IS INITIAL.
" get default from user record
lv_user = zcl_abapgit_user_record=>get_instance( sy-uname )->get_name( ).
ENDIF.
lv_email = li_user->get_repo_git_user_email( mo_repo_online->get_url( ) ).
IF lv_email IS INITIAL.
lv_email = li_user->get_default_git_user_email( ).
ENDIF.
IF lv_email IS INITIAL.
" get default from user record
lv_email = zcl_abapgit_user_record=>get_instance( sy-uname )->get_email( ).
ENDIF.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div class="form-container">' ).
ri_html->add( '<form id="commit_form" class="aligned-form grey70"'
&& ' method="post" action="">' ).
INSERT c_tag_type-lightweight
INTO TABLE lt_type.
INSERT c_tag_type-annotated
INTO TABLE lt_type.
ri_html->add( '<div class="row">' ).
ri_html->add( 'Tag type <select name="folder_logic" onchange="onTagTypeChange(this)">' ).
LOOP AT lt_type ASSIGNING <lv_type>.
IF mv_selected_type = <lv_type>.
lv_selected = 'selected'.
ELSE.
CLEAR: lv_selected.
ENDIF.
ri_html->add( |<option value="{ <lv_type> }" | && |{ lv_selected }>| && |{ <lv_type> }</option>| ).
ENDLOOP.
ri_html->add( '</div>' ).
ri_html->add( '</select>' ).
ri_html->add( '<br>' ).
ri_html->add( '<br>' ).
ri_html->add( render_text_input( iv_name = 'sha1'
iv_label = 'SHA1'
iv_value = mo_repo_online->get_current_remote( ) ) ).
ri_html->add( render_text_input( iv_name = 'name'
iv_label = 'tag name' ) ).
IF mv_selected_type = c_tag_type-annotated.
ri_html->add( render_text_input( iv_name = 'tagger_name'
iv_label = 'tagger name'
iv_value = lv_user ) ).
ri_html->add( render_text_input( iv_name = 'tagger_email'
iv_label = 'tagger e-mail'
iv_value = lv_email ) ).
lo_settings = zcl_abapgit_persist_factory=>get_settings( )->read( ).
lv_s_param = lo_settings->get_commitmsg_comment_length( ).
ri_html->add( render_text_input( iv_name = 'message'
iv_label = 'message'
iv_max_length = lv_s_param ) ).
ri_html->add( '<div class="row">' ).
ri_html->add( '<label for="c-body">body</label>' ).
lv_body_size = lo_settings->get_commitmsg_body_size( ).
IF lv_body_size > lc_body_col_max.
lv_body_size = lc_body_col_max.
ENDIF.
ri_html->add( |<textarea id="c-body" name="body" rows="10" cols="{ lv_body_size }"></textarea>| ).
ENDIF.
ri_html->add( '<input type="submit" class="hidden-submit">' ).
ri_html->add( '</div>' ).
ri_html->add( '</form>' ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD render_menu.
DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
CREATE OBJECT lo_toolbar.
lo_toolbar->add( iv_act = 'submitFormById(''commit_form'');'
iv_txt = 'Create'
iv_typ = zif_abapgit_html=>c_action_type-onclick
iv_opt = zif_abapgit_html=>c_html_opt-strong ).
lo_toolbar->add( iv_act = c_action-commit_cancel
iv_txt = 'Cancel'
iv_opt = zif_abapgit_html=>c_html_opt-cancel ).
ri_html->add( '<div class="paddings">' ).
ri_html->add( lo_toolbar->render( ) ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD render_scripts.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->set_title( cl_abap_typedescr=>describe_by_object_ref( me )->get_relative_name( ) ).
ri_html->add( 'setInitialFocus("name");' ).
ENDMETHOD.
METHOD render_text_input.
DATA lv_attrs TYPE string.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
IF iv_value IS NOT INITIAL.
lv_attrs = | value="{ iv_value }"|.
ENDIF.
IF iv_max_length IS NOT INITIAL.
lv_attrs = | maxlength="{ iv_max_length }"|.
ENDIF.
ri_html->add( '<div class="row">' ).
ri_html->add( |<label for="{ iv_name }">{ iv_label }</label>| ).
ri_html->add( |<input id="{ iv_name }" name="{ iv_name }" type="text"{ lv_attrs }>| ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
CASE ii_event->mv_action.
WHEN c_action-commit_post.
create_tag( ii_event ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
WHEN c_action-change_tag_type.
parse_change_tag_type_request( ii_event->mt_postdata ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_action-commit_cancel.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
ENDCASE.
ENDMETHOD.
ENDCLASS. | 29.078591 | 112 | 0.642777 | {
"alnum_ratio": 0.5901578112,
"alpha_token_ratio": 1.6982503365,
"avg_line_length": 29.1005434783,
"char_rep_ratio": 0.1512149533,
"max_line_length": 112,
"num_words": 713,
"text_len": 10709,
"word_rep_ratio": 0
} | 628,723,976,018,621,300 |
f7adc6e42088d51f71135ad00a52b4e7c8a30a6c | 2,626 | abap | ABAP | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_item_graph DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
!it_items TYPE zif_abapgit_definitions=>ty_items_tt .
METHODS add_edge
IMPORTING
!is_from TYPE zif_abapgit_definitions=>ty_item
!is_to TYPE zif_abapgit_definitions=>ty_item .
METHODS has_vertices
RETURNING
VALUE(rv_bool) TYPE abap_bool .
METHODS get_next
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log
RETURNING
VALUE(rs_item) TYPE zif_abapgit_definitions=>ty_item .
PRIVATE SECTION.
TYPES: BEGIN OF ty_edge,
from TYPE zif_abapgit_definitions=>ty_item,
to TYPE zif_abapgit_definitions=>ty_item,
END OF ty_edge.
DATA mt_vertices TYPE STANDARD TABLE OF zif_abapgit_definitions=>ty_item WITH DEFAULT KEY.
DATA mt_edges TYPE STANDARD TABLE OF ty_edge WITH DEFAULT KEY.
DATA mv_warning TYPE abap_bool.
METHODS remove_vertex IMPORTING iv_index TYPE i.
ENDCLASS.
CLASS ZCL_ABAPGIT_ITEM_GRAPH IMPLEMENTATION.
METHOD add_edge.
DATA ls_edge LIKE LINE OF mt_edges.
ASSERT is_from IS NOT INITIAL.
ASSERT is_to IS NOT INITIAL.
ls_edge-from = is_from.
ls_edge-to = is_to.
APPEND ls_edge TO mt_edges.
ENDMETHOD.
METHOD constructor.
INSERT LINES OF it_items INTO TABLE mt_vertices.
ENDMETHOD.
METHOD get_next.
* find a vertex with no inbound edges, if it does not exist pick anything
DATA ls_vertex LIKE LINE OF mt_vertices.
DATA lv_index TYPE i.
LOOP AT mt_vertices INTO ls_vertex.
lv_index = sy-tabix.
READ TABLE mt_edges WITH KEY
to-obj_type = ls_vertex-obj_type
to-obj_name = ls_vertex-obj_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
remove_vertex( lv_index ).
rs_item = ls_vertex.
RETURN.
ENDIF.
ENDLOOP.
IF mv_warning = abap_false.
* only issue the warning once per graph
ii_log->add_warning( |Cycle detected in item graph| ).
mv_warning = abap_true.
ENDIF.
READ TABLE mt_vertices INTO rs_item INDEX 1.
ASSERT sy-subrc = 0.
remove_vertex( 1 ).
ENDMETHOD.
METHOD has_vertices.
rv_bool = boolc( lines( mt_vertices ) > 0 ).
ENDMETHOD.
METHOD remove_vertex.
DATA ls_vertex LIKE LINE OF mt_vertices.
READ TABLE mt_vertices INDEX iv_index INTO ls_vertex.
ASSERT sy-subrc = 0.
DELETE mt_vertices INDEX iv_index.
DELETE mt_edges WHERE
from-obj_type = ls_vertex-obj_type AND
from-obj_name = ls_vertex-obj_name.
ENDMETHOD.
ENDCLASS. | 25.009524 | 94 | 0.690784 | {
"alnum_ratio": 0.6502857143,
"alpha_token_ratio": 1.9090909091,
"avg_line_length": 25.2403846154,
"char_rep_ratio": 0.1112385321,
"max_line_length": 94,
"num_words": 248,
"text_len": 2625,
"word_rep_ratio": 0
} | 18,322,467,229,596,588,000 |
f7d57157806c56f64bc21f5bd85f997716b94c23 | 6,968 | abap | ABAP | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_http DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS:
BEGIN OF c_scheme,
digest TYPE string VALUE 'Digest',
END OF c_scheme .
CLASS-METHODS get_agent
RETURNING
VALUE(rv_agent) TYPE string .
CLASS-METHODS create_by_url
IMPORTING
!iv_url TYPE string
!iv_service TYPE string
RETURNING
VALUE(ro_client) TYPE REF TO zcl_abapgit_http_client
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
CLASS-METHODS check_auth_requested
IMPORTING
!ii_client TYPE REF TO if_http_client
RETURNING
VALUE(rv_auth_requested) TYPE abap_bool
RAISING
zcx_abapgit_exception .
CLASS-METHODS is_local_system
IMPORTING
!iv_url TYPE string
RETURNING
VALUE(rv_bool) TYPE abap_bool .
CLASS-METHODS acquire_login_details
IMPORTING
!ii_client TYPE REF TO if_http_client
!io_client TYPE REF TO zcl_abapgit_http_client
!iv_url TYPE string
RETURNING
VALUE(rv_scheme) TYPE string
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_http IMPLEMENTATION.
METHOD acquire_login_details.
DATA: lv_default_user TYPE string,
lv_user TYPE string,
lv_pass TYPE string,
lo_digest TYPE REF TO zcl_abapgit_http_digest.
lv_default_user = zcl_abapgit_persistence_user=>get_instance( )->get_repo_login( iv_url ).
lv_user = lv_default_user.
zcl_abapgit_password_dialog=>popup(
EXPORTING
iv_repo_url = iv_url
CHANGING
cv_user = lv_user
cv_pass = lv_pass ).
IF lv_user IS INITIAL.
zcx_abapgit_exception=>raise( 'Unauthorized access. Check your credentials' ).
ENDIF.
IF lv_user <> lv_default_user.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_login(
iv_url = iv_url
iv_login = lv_user ).
ENDIF.
rv_scheme = ii_client->response->get_header_field( 'www-authenticate' ).
FIND REGEX '^(\w+)' IN rv_scheme SUBMATCHES rv_scheme.
CASE rv_scheme.
WHEN c_scheme-digest.
*
* e.g. used by
CREATE OBJECT lo_digest
EXPORTING
ii_client = ii_client
iv_username = lv_user
iv_password = lv_pass.
lo_digest->run( ii_client ).
io_client->set_digest( lo_digest ).
WHEN OTHERS.
*
ii_client->authenticate(
username = lv_user
password = lv_pass ).
ENDCASE.
ENDMETHOD.
METHOD check_auth_requested.
DATA: lv_code TYPE i.
ii_client->response->get_status( IMPORTING code = lv_code ).
IF lv_code = 401.
rv_auth_requested = abap_true.
ENDIF.
ENDMETHOD.
METHOD create_by_url.
DATA: lv_uri TYPE string,
lv_scheme TYPE string,
li_client TYPE REF TO if_http_client,
lo_proxy_configuration TYPE REF TO zcl_abapgit_proxy_config,
lv_text TYPE string.
CREATE OBJECT lo_proxy_configuration.
li_client = zcl_abapgit_exit=>get_instance( )->create_http_client( iv_url ).
IF li_client IS NOT BOUND.
cl_http_client=>create_by_url(
EXPORTING
url = zcl_abapgit_url=>host( iv_url )
ssl_id = zcl_abapgit_exit=>get_instance( )->get_ssl_id( )
proxy_host = lo_proxy_configuration->get_proxy_url( iv_url )
proxy_service = lo_proxy_configuration->get_proxy_port( iv_url )
IMPORTING
client = li_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
" make sure:
" a) SSL is setup properly in STRUST
lv_text = 'HTTPS ARGUMENT_NOT_FOUND | STRUST/SSL Setup correct?'.
WHEN OTHERS.
lv_text = 'While creating HTTP Client'.
ENDCASE.
zcx_abapgit_exception=>raise( lv_text ).
ENDIF.
ENDIF.
IF lo_proxy_configuration->get_proxy_authentication( iv_url ) = abap_true.
zcl_abapgit_proxy_auth=>run( li_client ).
ENDIF.
CREATE OBJECT ro_client
EXPORTING
ii_client = li_client.
IF is_local_system( iv_url ) = abap_true.
li_client->send_sap_logon_ticket( ).
ENDIF.
li_client->request->set_cdata( '' ).
li_client->request->set_header_field(
name = '~request_method'
value = 'GET' ).
li_client->request->set_header_field(
name = 'user-agent'
value = get_agent( ) ).
lv_uri = zcl_abapgit_url=>path_name( iv_url ) &&
'/info/refs?service=git-' &&
iv_service &&
'-pack'.
li_client->request->set_header_field(
name = '~request_uri'
value = lv_uri ).
" Disable internal auth dialog (due to its unclarity)
li_client->propertytype_logon_popup = if_http_client=>co_disabled.
zcl_abapgit_login_manager=>load(
iv_uri = iv_url
ii_client = li_client ).
zcl_abapgit_exit=>get_instance( )->http_client(
iv_url = iv_url
ii_client = li_client ).
ro_client->send_receive( ).
IF check_auth_requested( li_client ) = abap_true.
lv_scheme = acquire_login_details( ii_client = li_client
io_client = ro_client
iv_url = iv_url ).
ro_client->send_receive( ).
ENDIF.
ro_client->check_http_200( ).
IF lv_scheme <> c_scheme-digest.
zcl_abapgit_login_manager=>save( iv_uri = iv_url
ii_client = li_client ).
ENDIF.
ENDMETHOD.
METHOD get_agent.
* bitbucket require agent prefix = "git/"
* also see
rv_agent = |git/2.0 (abapGit { zif_abapgit_version=>c_abap_version })|.
ENDMETHOD.
METHOD is_local_system.
DATA: lv_host TYPE string,
lt_list TYPE zif_abapgit_definitions=>ty_string_tt,
li_exit TYPE REF TO zif_abapgit_exit.
cl_http_server=>get_location( IMPORTING host = lv_host ).
APPEND lv_host TO lt_list.
APPEND 'localhost' TO lt_list.
li_exit = zcl_abapgit_exit=>get_instance( ).
li_exit->change_local_host( CHANGING ct_hosts = lt_list ).
FIND REGEX 'https?://([^/^:]*)' IN iv_url SUBMATCHES lv_host.
READ TABLE lt_list WITH KEY table_line = lv_host TRANSPORTING NO FIELDS.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
ENDCLASS. | 28.210526 | 94 | 0.621412 | {
"alnum_ratio": 0.5676952606,
"alpha_token_ratio": 1.7377495463,
"avg_line_length": 27.5325203252,
"char_rep_ratio": 0.1286221171,
"max_line_length": 94,
"num_words": 450,
"text_len": 6773,
"word_rep_ratio": 0
} | 9,234,174,715,337,748,000 |
7989de5cf513c6eddc099f464627fce6d60da13e | 7,268 | abap | ABAP | src/ui/zcl_abapgit_gui_page_main.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/ui/zcl_abapgit_gui_page_main.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/ui/zcl_abapgit_gui_page_main.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_gui_page_main DEFINITION
PUBLIC
FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
INTERFACES: zif_abapgit_gui_hotkeys.
METHODS:
constructor
IMPORTING iv_only_favorites TYPE abap_bool
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_actions,
show TYPE string VALUE 'show' ##NO_TEXT,
overview TYPE string VALUE 'overview',
select TYPE string VALUE 'select',
apply_filter TYPE string VALUE 'apply_filter',
abapgit_home TYPE string VALUE 'abapgit_home',
END OF c_actions.
DATA: mo_repo_overview TYPE REF TO zcl_abapgit_gui_page_repo_over,
mv_repo_key TYPE zif_abapgit_persistence=>ty_value,
mv_only_favorites TYPE abap_bool.
METHODS build_main_menu
RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION.
METHOD build_main_menu.
CREATE OBJECT ro_menu EXPORTING iv_id = 'toolbar-main'.
ro_menu->add(
iv_txt = zcl_abapgit_gui_buttons=>new_online( )
iv_act = zif_abapgit_definitions=>c_action-repo_newonline
)->add(
iv_txt = zcl_abapgit_gui_buttons=>new_offline( )
iv_act = zif_abapgit_definitions=>c_action-repo_newoffline
)->add(
iv_txt = zcl_abapgit_gui_buttons=>settings( )
iv_act = zif_abapgit_definitions=>c_action-go_settings
)->add(
iv_txt = zcl_abapgit_gui_buttons=>advanced( )
iv_title = 'Utilities'
io_sub = zcl_abapgit_gui_chunk_lib=>advanced_submenu( )
)->add(
iv_txt = zcl_abapgit_gui_buttons=>help( )
iv_title = 'Help'
io_sub = zcl_abapgit_gui_chunk_lib=>help_submenu( ) ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
ms_control-page_menu = build_main_menu( ).
ms_control-page_title = 'Repository List'.
mv_only_favorites = iv_only_favorites.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
gui_services( )->get_hotkeys_ctl( )->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ).
IF mo_repo_overview IS INITIAL OR mo_repo_overview->mv_only_favorites <> mv_only_favorites.
CREATE OBJECT mo_repo_overview EXPORTING iv_only_favorites = mv_only_favorites.
ENDIF.
ri_html->add( mo_repo_overview->zif_abapgit_gui_renderable~render( ) ).
register_deferred_script( zcl_abapgit_gui_chunk_lib=>render_repo_palette( c_actions-select ) ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_value.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN c_actions-abapgit_home.
CLEAR mv_repo_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-select.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lv_key ).
TRY.
zcl_abapgit_repo_srv=>get_instance( )->get( lv_key )->refresh( ).
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
mv_repo_key = lv_key.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
EXPORTING
iv_key = lv_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-change_order_by.
mo_repo_overview->set_order_by( ii_event->query( )->get( 'ORDERBY' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-toggle_favorites.
mv_only_favorites = ii_event->query( )->get( 'FAVORITES' ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-direction.
mo_repo_overview->set_order_direction(
boolc( ii_event->query( )->get( 'DIRECTION' ) = 'DESCENDING' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-apply_filter.
mo_repo_overview->set_filter( ii_event->mt_postdata ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-go_patch.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_patch
EXPORTING
iv_key = lv_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN OTHERS.
rs_handled = super->zif_abapgit_gui_event_handler~on_event( ii_event ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_hotkeys~get_hotkey_actions.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
ls_hotkey_action-ui_component = 'Main'.
ls_hotkey_action-description = |abapGit Settings|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_settings.
ls_hotkey_action-hotkey = |x|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |New Online Repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newonline.
ls_hotkey_action-hotkey = |n|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |New Offline Repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newoffline.
ls_hotkey_action-hotkey = |o|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Stage|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_stage.
ls_hotkey_action-hotkey = |s|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Diff|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_repo_diff.
ls_hotkey_action-hotkey = |d|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Check|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_code_inspector.
ls_hotkey_action-hotkey = |c|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Pull|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_reset.
ls_hotkey_action-hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Patch|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_patch.
ls_hotkey_action-hotkey = |p|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
" registered/handled in js
ls_hotkey_action-description = |Previous Repository|.
ls_hotkey_action-action = `#`.
ls_hotkey_action-hotkey = |4|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Next Repository|.
ls_hotkey_action-action = `##`.
ls_hotkey_action-hotkey = |6|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |Open Repository|.
ls_hotkey_action-action = `###`.
ls_hotkey_action-hotkey = |Enter|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDMETHOD.
ENDCLASS. | 33.187215 | 107 | 0.729499 | {
"alnum_ratio": 0.6672629696,
"alpha_token_ratio": 1.8304380665,
"avg_line_length": 33.3348623853,
"char_rep_ratio": 0.1898594654,
"max_line_length": 107,
"num_words": 402,
"text_len": 7267,
"word_rep_ratio": 0
} | 1,288,424,671,841,002,800 |
79a94acf6371884e060cede941bff713be44d58d | 1,490 | abap | ABAP | src/objects/zcl_abapgit_object_pdts.clas.locals_def.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/objects/zcl_abapgit_object_pdts.clas.locals_def.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/objects/zcl_abapgit_object_pdts.clas.locals_def.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | INTERFACE lif_task_definition.
TYPES: BEGIN OF ty_task_data,
short_text TYPE hr_mcshort,
plvar TYPE plvar,
wi_text TYPE witext,
method TYPE hrs1201,
method_binding TYPE hrsmtbind,
starting_events TYPE hrsevtab,
starting_events_binding TYPE hrsevbind,
terminating_events TYPE hrsetmtab,
terminating_events_binding TYPE hrsevbind,
descriptions TYPE wstexts,
END OF ty_task_data.
METHODS clear_origin_data.
METHODS get_definition RETURNING VALUE(rs_result) TYPE ty_task_data.
METHODS get_container RETURNING VALUE(ri_result) TYPE REF TO if_swf_cnt_container.
METHODS get_user_container RETURNING VALUE(ri_result) TYPE REF TO if_swf_cnt_container.
METHODS import_container IMPORTING iv_xml_string TYPE xstring
RAISING zcx_abapgit_exception.
METHODS create_task RAISING zcx_abapgit_exception.
METHODS save IMPORTING iv_package TYPE devclass OPTIONAL
RAISING zcx_abapgit_exception.
METHODS change_wi_text RAISING zcx_abapgit_exception.
METHODS change_method RAISING zcx_abapgit_exception.
METHODS change_start_events RAISING zcx_abapgit_exception.
METHODS change_terminating_events RAISING zcx_abapgit_exception.
METHODS change_text RAISING zcx_abapgit_exception.
ENDINTERFACE. | 46.5625 | 89 | 0.69396 | {
"alnum_ratio": 0.6527871054,
"alpha_token_ratio": 2.2669789227,
"avg_line_length": 48.0322580645,
"char_rep_ratio": 0.2256756757,
"max_line_length": 89,
"num_words": 105,
"text_len": 1489,
"word_rep_ratio": 0
} | 3,800,832,169,395,036,000 |
79c7d4ab2f70338aafa1ac37fd4e4a79fe4d108a | 1,274 | abap | ABAP | src/zif_abapgit_sap_package.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/zif_abapgit_sap_package.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/zif_abapgit_sap_package.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | INTERFACE zif_abapgit_sap_package
PUBLIC .
TYPES:
ty_devclass_tt TYPE STANDARD TABLE OF devclass WITH DEFAULT KEY .
METHODS create
IMPORTING
!is_package TYPE scompkdtln
RAISING
zcx_abapgit_exception .
METHODS create_local
RAISING
zcx_abapgit_exception .
METHODS list_subpackages
RETURNING
VALUE(rt_list) TYPE ty_devclass_tt .
METHODS list_superpackages
RETURNING
VALUE(rt_list) TYPE ty_devclass_tt
RAISING
zcx_abapgit_exception .
METHODS read_parent
RETURNING
VALUE(rv_parentcl) TYPE tdevc-parentcl
RAISING
zcx_abapgit_exception .
METHODS create_child
IMPORTING
!iv_child TYPE devclass
RAISING
zcx_abapgit_exception .
METHODS exists
RETURNING
VALUE(rv_bool) TYPE abap_bool .
METHODS are_changes_recorded_in_tr_req
RETURNING
VALUE(rv_are_changes_rec_in_tr_req) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS get_transport_type
RETURNING
VALUE(rs_transport_type) TYPE zif_abapgit_definitions=>ty_transport_type
RAISING
zcx_abapgit_exception .
METHODS get_transport_layer
RETURNING
VALUE(rv_transport_layer) TYPE devlayer
RAISING
zcx_abapgit_exception .
ENDINTERFACE. | 24.037736 | 78 | 0.739403 | {
"alnum_ratio": 0.6920659859,
"alpha_token_ratio": 2.0440835267,
"avg_line_length": 24.4807692308,
"char_rep_ratio": 0.1764240506,
"max_line_length": 78,
"num_words": 86,
"text_len": 1273,
"word_rep_ratio": 0
} | 3,449,537,884,030,178,000 |
79d9b927dec18f5f4c07cb30af06f689b1b284a1 | 2,560 | abap | ABAP | src/objects/zcl_abapgit_object_iwsg.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/objects/zcl_abapgit_object_iwsg.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/objects/zcl_abapgit_object_iwsg.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_object_iwsg DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
METHODS get_generic
RETURNING
VALUE(ro_generic) TYPE REF TO zcl_abapgit_objects_generic
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
METHODS get_field_rules
RETURNING
VALUE(ro_result) TYPE REF TO zif_abapgit_field_rules.
ENDCLASS.
CLASS zcl_abapgit_object_iwsg IMPLEMENTATION.
METHOD get_generic.
CREATE OBJECT ro_generic
EXPORTING
io_field_rules = get_field_rules( )
is_item = ms_item
iv_language = mv_language.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = zcl_abapgit_objects_super=>c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
get_generic( )->delete( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
get_generic( )->deserialize(
iv_package = iv_package
io_xml = io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
rv_bool = get_generic( )->exists( ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
get_generic( )->serialize( io_xml ).
ENDMETHOD.
METHOD get_field_rules.
ro_result = zcl_abapgit_field_rules=>create( ).
ro_result->add(
iv_table = '/IWFND/I_MED_SRH'
iv_field = 'CREATED_BY'
iv_fill_rule = zif_abapgit_field_rules=>c_fill_rule-user
)->add(
iv_table = '/IWFND/I_MED_SRH'
iv_field = 'CREATED_TIMESTMP'
iv_fill_rule = zif_abapgit_field_rules=>c_fill_rule-timestamp
)->add(
iv_table = '/IWFND/I_MED_SRH'
iv_field = 'CHANGED_BY'
iv_fill_rule = zif_abapgit_field_rules=>c_fill_rule-user
)->add(
iv_table = '/IWFND/I_MED_SRH'
iv_field = 'CHANGED_TIMESTMP'
iv_fill_rule = zif_abapgit_field_rules=>c_fill_rule-timestamp ).
ENDMETHOD.
ENDCLASS. | 19.844961 | 70 | 0.703125 | {
"alnum_ratio": 0.6447831184,
"alpha_token_ratio": 1.7313746065,
"avg_line_length": 19.9921875,
"char_rep_ratio": 0.1949019608,
"max_line_length": 70,
"num_words": 149,
"text_len": 2559,
"word_rep_ratio": 0
} | 4,716,796,218,827,222,000 |
79e9c26918590421cc9a3be137085d626e8839f4 | 1,655 | abap | ABAP | src/utils/zcl_abapgit_hash.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/utils/zcl_abapgit_hash.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/utils/zcl_abapgit_hash.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
adler32 FOR TESTING,
sha1 FOR TESTING RAISING zcx_abapgit_exception,
sha1_raw_valid FOR TESTING RAISING zcx_abapgit_exception,
sha1_raw_invalid FOR TESTING RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ltcl_test IMPLEMENTATION.
METHOD adler32.
DATA: lv_adler TYPE zif_abapgit_definitions=>ty_adler32.
lv_adler = zcl_abapgit_hash=>adler32( '1122334455667788' ).
cl_abap_unit_assert=>assert_equals(
act = lv_adler
exp = '08000265' ).
ENDMETHOD.
METHOD sha1.
DATA: lv_sha1 TYPE zif_abapgit_definitions=>ty_sha1.
lv_sha1 = zcl_abapgit_hash=>sha1(
iv_type = zif_abapgit_definitions=>c_type-commit
iv_data = '112211221122' ).
cl_abap_unit_assert=>assert_equals(
act = lv_sha1
exp = 'af2261a340c5188baf86a64a581d22012303023c' ).
ENDMETHOD.
METHOD sha1_raw_valid.
DATA: lv_sha1 TYPE zif_abapgit_definitions=>ty_sha1,
lv_input TYPE xstring.
lv_input = 'C5188BAF86A64A581D2201'.
lv_sha1 = zcl_abapgit_hash=>sha1_raw( lv_input ).
cl_abap_unit_assert=>assert_equals(
act = lv_sha1
exp = '0ec2eba75071f87988ced3237cae5ec7c5efd795' ).
ENDMETHOD.
METHOD sha1_raw_invalid.
DATA: lv_sha1 TYPE zif_abapgit_definitions=>ty_sha1,
lv_input TYPE xstring.
lv_input = 'LOREM_IPSUM'.
lv_sha1 = zcl_abapgit_hash=>sha1_raw( lv_input ).
cl_abap_unit_assert=>assert_equals(
act = lv_sha1
exp = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' ).
ENDMETHOD.
ENDCLASS. | 22.364865 | 65 | 0.720846 | {
"alnum_ratio": 0.6745311555,
"alpha_token_ratio": 1.40969163,
"avg_line_length": 22.9583333333,
"char_rep_ratio": 0.0888077859,
"max_line_length": 65,
"num_words": 107,
"text_len": 1653,
"word_rep_ratio": 0
} | 14,822,831,653,648,120,000 |
79eeeba671e89751876dcc8e8e4df006b72d4c15 | 7,295 | abap | ABAP | src/apack/zcl_abapgit_apack_reader.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/apack/zcl_abapgit_apack_reader.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/apack/zcl_abapgit_apack_reader.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_apack_reader DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
TYPES ty_package_name TYPE devclass .
CLASS-METHODS create_instance
IMPORTING
!iv_package_name TYPE ty_package_name
RETURNING
VALUE(ro_manifest_reader) TYPE REF TO zcl_abapgit_apack_reader .
CLASS-METHODS deserialize
IMPORTING
!iv_package_name TYPE ty_package_name
!iv_xstr TYPE xstring
RETURNING
VALUE(ro_manifest_reader) TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception.
METHODS get_manifest_descriptor
RETURNING
VALUE(rs_manifest_descriptor) TYPE zif_abapgit_apack_definitions=>ty_descriptor
RAISING
zcx_abapgit_exception.
METHODS set_manifest_descriptor
IMPORTING
!is_manifest_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor
RAISING
zcx_abapgit_exception.
METHODS copy_manifest_descriptor
IMPORTING
!io_manifest_provider TYPE REF TO object
RAISING
zcx_abapgit_exception.
METHODS has_manifest
RETURNING
VALUE(rv_has_manifest) TYPE abap_bool
RAISING
zcx_abapgit_exception.
METHODS constructor
IMPORTING
!iv_package_name TYPE ty_package_name .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_s_manifest_declaration,
clsname TYPE seoclsname,
devclass TYPE devclass,
END OF ty_s_manifest_declaration .
DATA mv_package_name TYPE ty_package_name .
DATA ms_cached_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor .
DATA mv_is_cached TYPE abap_bool .
CLASS-METHODS from_xml
IMPORTING
iv_xml TYPE string
RETURNING
VALUE(rs_data) TYPE zif_abapgit_apack_definitions=>ty_descriptor.
METHODS format_version
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_apack_reader IMPLEMENTATION.
METHOD constructor.
mv_package_name = iv_package_name.
ENDMETHOD.
METHOD copy_manifest_descriptor.
DATA: ls_my_manifest_wo_deps TYPE zif_abapgit_apack_definitions=>ty_descriptor_wo_dependencies,
ls_my_dependency TYPE zif_abapgit_apack_definitions=>ty_dependency,
ls_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor,
lv_descriptor_cust TYPE string,
lv_descriptor_sap TYPE string.
FIELD-SYMBOLS: <lg_descriptor> TYPE any,
<lt_dependencies> TYPE ANY TABLE,
<lg_dependency> TYPE any.
lv_descriptor_cust = zif_abapgit_apack_definitions=>c_apack_interface_cust && '~DESCRIPTOR'.
lv_descriptor_sap = zif_abapgit_apack_definitions=>c_apack_interface_sap && '~DESCRIPTOR'.
ASSIGN io_manifest_provider->(lv_descriptor_cust) TO <lg_descriptor>.
IF <lg_descriptor> IS NOT ASSIGNED.
ASSIGN io_manifest_provider->(lv_descriptor_sap) TO <lg_descriptor>.
ENDIF.
IF <lg_descriptor> IS ASSIGNED.
" A little more complex than a normal MOVE-CORRSPONDING
" to avoid dumps in case of future updates to the dependencies table structure
ASSIGN COMPONENT 'DEPENDENCIES' OF STRUCTURE <lg_descriptor> TO <lt_dependencies>.
IF <lt_dependencies> IS ASSIGNED.
LOOP AT <lt_dependencies> ASSIGNING <lg_dependency>.
MOVE-CORRESPONDING <lg_dependency> TO ls_my_dependency.
INSERT ls_my_dependency INTO TABLE ls_descriptor-dependencies.
ENDLOOP.
MOVE-CORRESPONDING <lg_descriptor> TO ls_my_manifest_wo_deps.
MOVE-CORRESPONDING ls_my_manifest_wo_deps TO ls_descriptor.
ENDIF.
ENDIF.
set_manifest_descriptor( ls_descriptor ).
ENDMETHOD.
METHOD create_instance.
CREATE OBJECT ro_manifest_reader
EXPORTING
iv_package_name = iv_package_name.
ENDMETHOD.
METHOD deserialize.
DATA: lv_xml TYPE string,
ls_data TYPE zif_abapgit_apack_definitions=>ty_descriptor.
lv_xml = zcl_abapgit_convert=>xstring_to_string_utf8( iv_xstr ).
ls_data = from_xml( lv_xml ).
ro_manifest_reader = create_instance( iv_package_name ).
ro_manifest_reader = create_instance( iv_package_name ).
ro_manifest_reader->set_manifest_descriptor( ls_data ).
ENDMETHOD.
METHOD format_version.
FIELD-SYMBOLS: <ls_dependency> TYPE zif_abapgit_apack_definitions=>ty_dependency.
TRANSLATE ms_cached_descriptor-version TO LOWER CASE.
ms_cached_descriptor-sem_version = zcl_abapgit_version=>conv_str_to_version( ms_cached_descriptor-version ).
LOOP AT ms_cached_descriptor-dependencies ASSIGNING <ls_dependency>.
<ls_dependency>-sem_version = zcl_abapgit_version=>conv_str_to_version( <ls_dependency>-version ).
ENDLOOP.
ENDMETHOD.
METHOD from_xml.
DATA: lv_xml TYPE string.
lv_xml = iv_xml.
CALL TRANSFORMATION id
OPTIONS value_handling = 'accept_data_loss'
SOURCE XML lv_xml
RESULT data = rs_data.
ENDMETHOD.
METHOD get_manifest_descriptor.
DATA: lo_manifest_provider TYPE REF TO object,
ls_manifest_implementation TYPE ty_s_manifest_declaration.
IF mv_is_cached IS INITIAL AND mv_package_name IS NOT INITIAL.
SELECT SINGLE seometarel~clsname tadir~devclass FROM seometarel "#EC CI_NOORDER
INNER JOIN tadir ON seometarel~clsname = tadir~obj_name "#EC CI_BUFFJOIN
INTO ls_manifest_implementation
WHERE tadir~pgmid = 'R3TR' AND
tadir~object = 'CLAS' AND
seometarel~version = '1' AND
seometarel~refclsname = zif_abapgit_apack_definitions=>c_apack_interface_cust AND
tadir~devclass = mv_package_name.
IF ls_manifest_implementation IS INITIAL.
SELECT SINGLE seometarel~clsname tadir~devclass FROM seometarel "#EC CI_NOORDER
INNER JOIN tadir ON seometarel~clsname = tadir~obj_name "#EC CI_BUFFJOIN
INTO ls_manifest_implementation
WHERE tadir~pgmid = 'R3TR' AND
tadir~object = 'CLAS' AND
seometarel~version = '1' AND
seometarel~refclsname = zif_abapgit_apack_definitions=>c_apack_interface_sap AND
tadir~devclass = mv_package_name.
ENDIF.
IF ls_manifest_implementation IS NOT INITIAL.
TRY.
CREATE OBJECT lo_manifest_provider TYPE (ls_manifest_implementation-clsname).
CATCH cx_sy_create_object_error.
CLEAR: rs_manifest_descriptor.
ENDTRY.
IF lo_manifest_provider IS BOUND.
copy_manifest_descriptor( lo_manifest_provider ).
ENDIF.
ENDIF.
mv_is_cached = abap_true.
ENDIF.
rs_manifest_descriptor = ms_cached_descriptor.
ENDMETHOD.
METHOD has_manifest.
DATA: ls_returned_manifest TYPE zif_abapgit_apack_definitions=>ty_descriptor.
ls_returned_manifest = get_manifest_descriptor( ).
rv_has_manifest = abap_false.
IF ls_returned_manifest IS NOT INITIAL.
rv_has_manifest = abap_true.
ENDIF.
ENDMETHOD.
METHOD set_manifest_descriptor.
mv_is_cached = abap_true.
ms_cached_descriptor = is_manifest_descriptor.
format_version( ).
ENDMETHOD.
ENDCLASS. | 31.175214 | 112 | 0.714462 | {
"alnum_ratio": 0.6663010694,
"alpha_token_ratio": 2.121013543,
"avg_line_length": 31.30472103,
"char_rep_ratio": 0.1457789979,
"max_line_length": 112,
"num_words": 473,
"text_len": 7294,
"word_rep_ratio": 0.0862068966
} | 14,606,137,192,457,090,000 |
035a6450a5689c22e6a151c3d856db575d5794ba | 9,878 | abap | ABAP | src/objects/zcl_abapgit_object_suso.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/objects/zcl_abapgit_object_suso.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/objects/zcl_abapgit_object_suso.clas.abap | wangdongcheng/abapGit | 7cf4e4b5fe718cb95d12d0a439aa9f2cfb128eab | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_object_suso DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS:
constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
mv_objectname TYPE tobj-objct.
METHODS:
delete_documentation
RAISING
zcx_abapgit_exception,
pre_check
RAISING
zcx_abapgit_exception,
regenerate_sap_all.
ENDCLASS.
CLASS zcl_abapgit_object_suso IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_objectname = ms_item-obj_name.
ENDMETHOD.
METHOD delete_documentation.
DATA:
lv_docu_obj TYPE dokhl-object,
lv_dummy TYPE sy-langu.
lv_docu_obj = mv_objectname.
SELECT SINGLE langu
FROM dokil INTO lv_dummy
WHERE id = 'UO' "#EC CI_GENBUFF
AND object = lv_docu_obj.
IF sy-subrc = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'UO'
doku_object = lv_docu_obj
suppress_transport = space
EXCEPTIONS
header_without_text = 1
index_without_header = 2
no_authority_for_devclass_xxxx = 3
no_docu_found = 4
object_is_already_enqueued = 5
object_is_enqueued_by_corr = 6
techn_enqueue_problem = 7
user_break = 8
OTHERS = 9.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD pre_check.
CONSTANTS:
lc_act_delete TYPE activ_auth VALUE '06'.
DATA:
lv_act_head TYPE activ_auth,
lv_dummy TYPE string,
lo_suso TYPE REF TO object,
lv_failed TYPE abap_bool,
lv_suso_collect_in_cts TYPE i,
ls_clskey TYPE seoclskey.
" Downport: CL_SUSO_GEN doesn't exist in 702
ls_clskey-clsname = |CL_SUSO_GEN|.
CALL FUNCTION 'SEO_CLASS_EXISTENCE_CHECK'
EXPORTING
clskey = ls_clskey
EXCEPTIONS
not_specified = 1
not_existing = 2
is_interface = 3
no_text = 4
inconsistent = 5
OTHERS = 6.
IF sy-subrc = 0.
" so these check are not executed in 702
CREATE OBJECT lo_suso
TYPE
('CL_SUSO_GEN').
CALL METHOD lo_suso->('SUSO_LOAD_FROM_DB')
EXPORTING
id_object = mv_objectname
RECEIVING
ed_failed = lv_failed.
IF lv_failed = abap_true.
" Object & does not exist; choose an existing object
MESSAGE s111(01) WITH mv_objectname INTO lv_dummy.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL METHOD lo_suso->('GET_SUSO_EDIT_MODE')
EXPORTING
id_object = mv_objectname
id_planed_act = lc_act_delete
IMPORTING
ed_mode_head = lv_act_head.
IF lv_act_head <> lc_act_delete.
zcx_abapgit_exception=>raise( |SUSO { mv_objectname }: Delete not allowed. Check where-used in SU21| ).
ENDIF.
CALL METHOD lo_suso->('SUSO_COLLECT_IN_CTS')
EXPORTING
id_object = mv_objectname
RECEIVING
ed_result = lv_suso_collect_in_cts.
IF lv_suso_collect_in_cts IS NOT INITIAL.
zcx_abapgit_exception=>raise( |SUSO { mv_objectname }: Cannot delete| ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD regenerate_sap_all.
DATA: ls_e071 TYPE e071,
lt_e071 TYPE STANDARD TABLE OF e071,
lt_e071k TYPE STANDARD TABLE OF e071k.
ls_e071-pgmid = 'R3TR'.
ls_e071-object = ms_item-obj_type.
ls_e071-obj_name = ms_item-obj_name.
INSERT ls_e071 INTO TABLE lt_e071.
CALL FUNCTION 'PRGN_AFTER_IMP_SUSO_SAP_ALL'
EXPORTING
iv_tarclient = '000'
iv_is_upgrade = space
TABLES
tt_e071 = lt_e071
tt_e071k = lt_e071k.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~delete.
" FM SUSR_DELETE_OBJECT calls the UI. Therefore we reimplement it here.
" As the class CL_SUSO_GEN isn't present in 702, we call dynamically and
" skip the pre checks on 702 system. That seems ok.
pre_check( ).
delete_documentation( ).
DELETE FROM tobj WHERE objct = mv_objectname.
DELETE FROM tobjt WHERE object = mv_objectname.
DELETE FROM tactz WHERE brobj = mv_objectname.
CALL FUNCTION 'SUPV_DELETE_OBJECT_ASSIGNMENTS'
EXPORTING
object_name = mv_objectname
all_releases = abap_true.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = mv_objectname
type = 'SUSO'
operation = 'DELETE'.
regenerate_sap_all( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* see function group SUSA
DATA: lv_objectname TYPE trobj_name,
ls_tobj TYPE tobj,
ls_tobjt TYPE tobjt,
ls_tobjvorflg TYPE tobjvorflg,
lt_tactz TYPE TABLE OF tactz,
lt_tobjvordat TYPE TABLE OF tobjvordat,
lt_tobjvor TYPE TABLE OF tobjvor.
ASSERT NOT ms_item-obj_name IS INITIAL.
io_xml->read( EXPORTING iv_name = 'TOBJ'
CHANGING cg_data = ls_tobj ).
ls_tobj-bname = sy-uname.
io_xml->read( EXPORTING iv_name = 'TOBJT'
CHANGING cg_data = ls_tobjt ).
io_xml->read( EXPORTING iv_name = 'TOBJVORFLG'
CHANGING cg_data = ls_tobjvorflg ).
io_xml->read( EXPORTING iv_name = 'TACTZ'
CHANGING cg_data = lt_tactz ).
io_xml->read( EXPORTING iv_name = 'TOBJVORDAT'
CHANGING cg_data = lt_tobjvordat ).
io_xml->read( EXPORTING iv_name = 'TOBJVOR'
CHANGING cg_data = lt_tobjvor ).
tadir_insert( iv_package ).
lv_objectname = mv_objectname.
CALL FUNCTION 'SUSR_COMMEDITCHECK'
EXPORTING
objectname = lv_objectname
transobjecttype = 'O'.
MODIFY tobj FROM ls_tobj. "#EC CI_SUBRC
MODIFY tobjt FROM ls_tobjt. "#EC CI_SUBRC
MODIFY tobjvorflg FROM ls_tobjvorflg. "#EC CI_SUBRC
DELETE FROM tactz WHERE brobj = ms_item-obj_name. "#EC CI_SUBRC
INSERT tactz FROM TABLE lt_tactz. "#EC CI_SUBRC
DELETE FROM tobjvordat WHERE objct = ms_item-obj_name. "#EC CI_SUBRC
INSERT tobjvordat FROM TABLE lt_tobjvordat. "#EC CI_SUBRC
DELETE FROM tobjvor WHERE objct = ms_item-obj_name. "#EC CI_SUBRC
INSERT tobjvor FROM TABLE lt_tobjvor. "#EC CI_SUBRC
regenerate_sap_all( ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_objct TYPE tobj-objct.
SELECT SINGLE objct FROM tobj INTO lv_objct
WHERE objct = ms_item-obj_name.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'SUSR_SHOW_OBJECT'
EXPORTING
object = mv_objectname.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_tobj TYPE tobj,
ls_tobjt TYPE tobjt,
ls_tobjvorflg TYPE tobjvorflg,
lt_tactz TYPE TABLE OF tactz,
lt_tobjvordat TYPE TABLE OF tobjvordat,
lt_tobjvor TYPE TABLE OF tobjvor.
SELECT SINGLE * FROM tobj INTO ls_tobj
WHERE objct = ms_item-obj_name.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CLEAR ls_tobj-bname.
SELECT SINGLE * FROM tobjt INTO ls_tobjt
WHERE object = ms_item-obj_name
AND langu = mv_language. "#EC CI_GENBUFF
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'TOBJT no english description'
&& ' for object (' && ms_item-obj_name && ')' ).
ENDIF.
SELECT SINGLE * FROM tobjvorflg INTO ls_tobjvorflg
WHERE objct = ms_item-obj_name. "#EC CI_SUBRC
SELECT * FROM tactz INTO TABLE lt_tactz
WHERE brobj = ms_item-obj_name
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
SELECT * FROM tobjvordat INTO TABLE lt_tobjvordat
WHERE objct = ms_item-obj_name
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
SELECT * FROM tobjvor INTO TABLE lt_tobjvor
WHERE objct = ms_item-obj_name
ORDER BY PRIMARY KEY. "#EC CI_SUBRC
io_xml->add( iv_name = 'TOBJ'
ig_data = ls_tobj ).
io_xml->add( iv_name = 'TOBJT'
ig_data = ls_tobjt ).
io_xml->add( iv_name = 'TOBJVORFLG'
ig_data = ls_tobjvorflg ).
io_xml->add( ig_data = lt_tactz
iv_name = 'TACTZ' ).
io_xml->add( ig_data = lt_tobjvordat
iv_name = 'TOBJVORDAT' ).
io_xml->add( ig_data = lt_tobjvor
iv_name = 'TOBJVOR' ).
ENDMETHOD.
ENDCLASS. | 26.625337 | 111 | 0.612168 | {
"alnum_ratio": 0.5728460059,
"alpha_token_ratio": 1.6404129794,
"avg_line_length": 26.6945945946,
"char_rep_ratio": 0.1489663559,
"max_line_length": 111,
"num_words": 740,
"text_len": 9877,
"word_rep_ratio": 0.0465116279
} | 6,763,849,213,477,315,000 |
0372632e144510e0900d89e7a2c5a87ebe061e9d | 1,702 | abap | ABAP | src/ui/zcl_abapgit_ui_injector.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/ui/zcl_abapgit_ui_injector.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/ui/zcl_abapgit_ui_injector.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_ui_injector DEFINITION
PUBLIC
CREATE PRIVATE .
PUBLIC SECTION.
CLASS-METHODS set_popups
IMPORTING
!ii_popups TYPE REF TO zif_abapgit_popups .
CLASS-METHODS set_tag_popups
IMPORTING
!ii_tag_popups TYPE REF TO zif_abapgit_tag_popups .
CLASS-METHODS set_frontend_services
IMPORTING
!ii_fe_serv TYPE REF TO zif_abapgit_frontend_services .
CLASS-METHODS set_gui_services
IMPORTING
!ii_gui_services TYPE REF TO zif_abapgit_gui_services .
CLASS-METHODS get_dummy_gui_services
RETURNING
VALUE(ri_gui_services) TYPE REF TO zif_abapgit_gui_services .
CLASS-METHODS set_html_viewer
IMPORTING
!ii_html_viewer TYPE REF TO zif_abapgit_html_viewer .
CLASS-METHODS set_gui_jumper
IMPORTING
!ii_gui_jumper TYPE REF TO zif_abapgit_gui_jumper .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_ui_injector IMPLEMENTATION.
METHOD get_dummy_gui_services.
ri_gui_services = lcl_gui_services_dummy=>create( ).
ENDMETHOD.
METHOD set_frontend_services.
zcl_abapgit_ui_factory=>gi_fe_services = ii_fe_serv.
ENDMETHOD.
METHOD set_gui_jumper.
zcl_abapgit_ui_factory=>gi_gui_jumper = ii_gui_jumper.
ENDMETHOD.
METHOD set_gui_services.
zcl_abapgit_ui_factory=>gi_gui_services = ii_gui_services.
ENDMETHOD.
METHOD set_html_viewer.
zcl_abapgit_ui_factory=>gi_html_viewer = ii_html_viewer.
ENDMETHOD.
METHOD set_popups.
zcl_abapgit_ui_factory=>gi_popups = ii_popups.
ENDMETHOD.
METHOD set_tag_popups.
zcl_abapgit_ui_factory=>gi_tag_popups = ii_tag_popups.
ENDMETHOD.
ENDCLASS. | 20.023529 | 69 | 0.752056 | {
"alnum_ratio": 0.6866549089,
"alpha_token_ratio": 1.8393700787,
"avg_line_length": 20.25,
"char_rep_ratio": 0.1317966903,
"max_line_length": 69,
"num_words": 108,
"text_len": 1701,
"word_rep_ratio": 0
} | 6,659,243,800,928,970,000 |
037c6ccbaa70fbb421cdc3a3fd1778f19e84a107 | 17,136 | abap | ABAP | src/ui/zcl_abapgit_gui_page_commit.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/ui/zcl_abapgit_gui_page_commit.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/ui/zcl_abapgit_gui_page_commit.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_gui_page_commit DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_component
FINAL
CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler.
INTERFACES zif_abapgit_gui_renderable.
CLASS-METHODS create
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!io_stage TYPE REF TO zcl_abapgit_stage
!iv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result DEFAULT zif_abapgit_definitions=>c_sci_result-no_run
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception.
METHODS constructor
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!io_stage TYPE REF TO zcl_abapgit_stage
!iv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_id,
committer TYPE string VALUE 'committer',
committer_name TYPE string VALUE 'committer_name',
committer_email TYPE string VALUE 'committer_email',
message TYPE string VALUE 'message',
comment TYPE string VALUE 'comment',
body TYPE string VALUE 'body',
author TYPE string VALUE 'author',
author_name TYPE string VALUE 'author_name',
author_email TYPE string VALUE 'author_email',
new_branch_name TYPE string VALUE 'new_branch_name',
END OF c_id.
CONSTANTS:
BEGIN OF c_event,
commit TYPE string VALUE 'commit',
END OF c_event.
DATA mo_form TYPE REF TO zcl_abapgit_html_form.
DATA mo_form_data TYPE REF TO zcl_abapgit_string_map.
DATA mo_form_util TYPE REF TO zcl_abapgit_html_form_utils.
DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map.
DATA mo_settings TYPE REF TO zcl_abapgit_settings.
DATA mo_repo TYPE REF TO zcl_abapgit_repo_online.
DATA mo_stage TYPE REF TO zcl_abapgit_stage.
DATA mt_stage TYPE zif_abapgit_definitions=>ty_stage_tt.
DATA ms_commit TYPE zif_abapgit_services_git=>ty_commit_fields.
DATA mv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result.
METHODS render_stage_summary
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception.
METHODS render_stage_details
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception.
METHODS validate_form
IMPORTING
!io_form_data TYPE REF TO zcl_abapgit_string_map
RETURNING
VALUE(ro_validation_log) TYPE REF TO zcl_abapgit_string_map
RAISING
zcx_abapgit_exception.
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form.
METHODS get_defaults
RAISING
zcx_abapgit_exception.
METHODS get_committer_name
RETURNING
VALUE(rv_user) TYPE string
RAISING
zcx_abapgit_exception.
METHODS get_committer_email
RETURNING
VALUE(rv_email) TYPE string
RAISING
zcx_abapgit_exception.
METHODS get_comment_default
RETURNING
VALUE(rv_text) TYPE string.
METHODS get_comment_object
IMPORTING
!it_stage TYPE zif_abapgit_definitions=>ty_stage_tt
RETURNING
VALUE(rv_text) TYPE string.
METHODS get_comment_file
IMPORTING
!it_stage TYPE zif_abapgit_definitions=>ty_stage_tt
RETURNING
VALUE(rv_text) TYPE string.
METHODS is_valid_email
IMPORTING
iv_email TYPE string
RETURNING
VALUE(rv_valid) TYPE abap_bool.
METHODS branch_name_to_internal
IMPORTING
iv_branch_name TYPE string
RETURNING
VALUE(rv_new_branch_name) TYPE string.
ENDCLASS.
CLASS zcl_abapgit_gui_page_commit IMPLEMENTATION.
METHOD branch_name_to_internal.
rv_new_branch_name = zcl_abapgit_git_branch_list=>complete_heads_branch_name(
zcl_abapgit_git_branch_list=>normalize_branch_name( iv_branch_name ) ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
mo_repo = io_repo.
mo_stage = io_stage.
mt_stage = mo_stage->get_all( ).
mv_sci_result = iv_sci_result.
" Get settings from DB
mo_settings = zcl_abapgit_persist_factory=>get_settings( )->read( ).
CREATE OBJECT mo_validation_log.
CREATE OBJECT mo_form_data.
mo_form = get_form_schema( ).
mo_form_util = zcl_abapgit_html_form_utils=>create( mo_form ).
ENDMETHOD.
METHOD create.
DATA lo_component TYPE REF TO zcl_abapgit_gui_page_commit.
CREATE OBJECT lo_component
EXPORTING
io_repo = io_repo
io_stage = io_stage
iv_sci_result = iv_sci_result.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'Commit'
ii_child_component = lo_component ).
ENDMETHOD.
METHOD get_comment_default.
rv_text = mo_settings->get_commitmsg_comment_default( ).
IF rv_text IS INITIAL.
RETURN.
ENDIF.
REPLACE '$FILE' IN rv_text WITH get_comment_file( mt_stage ).
REPLACE '$OBJECT' IN rv_text WITH get_comment_object( mt_stage ).
ENDMETHOD.
METHOD get_comment_file.
DATA:
lv_count TYPE i,
lv_value TYPE c LENGTH 10.
FIELD-SYMBOLS <ls_stage> LIKE LINE OF it_stage.
lv_count = lines( it_stage ).
IF lv_count = 1.
" Just one file so we use the file name
READ TABLE it_stage ASSIGNING <ls_stage> INDEX 1.
ASSERT sy-subrc = 0.
rv_text = <ls_stage>-file-filename.
ELSE.
" For multiple file we use the count instead
WRITE lv_count TO lv_value LEFT-JUSTIFIED.
CONCATENATE lv_value 'files' INTO rv_text SEPARATED BY space.
ENDIF.
ENDMETHOD.
METHOD get_comment_object.
DATA:
lv_count TYPE i,
lv_value TYPE c LENGTH 10,
ls_item TYPE zif_abapgit_definitions=>ty_item,
lt_items TYPE zif_abapgit_definitions=>ty_items_tt.
FIELD-SYMBOLS <ls_stage> LIKE LINE OF it_stage.
" Get objects
LOOP AT it_stage ASSIGNING <ls_stage>.
CLEAR ls_item.
ls_item-obj_type = <ls_stage>-status-obj_type.
ls_item-obj_name = <ls_stage>-status-obj_name.
COLLECT ls_item INTO lt_items.
ENDLOOP.
lv_count = lines( lt_items ).
IF lv_count = 1.
" Just one object so we use the object name
READ TABLE lt_items INTO ls_item INDEX 1.
ASSERT sy-subrc = 0.
CONCATENATE ls_item-obj_type ls_item-obj_name INTO rv_text SEPARATED BY space.
ELSE.
" For multiple objects we use the count instead
WRITE lv_count TO lv_value LEFT-JUSTIFIED.
CONCATENATE lv_value 'objects' INTO rv_text SEPARATED BY space.
ENDIF.
ENDMETHOD.
METHOD get_committer_email.
DATA li_user TYPE REF TO zif_abapgit_persist_user.
li_user = zcl_abapgit_persistence_user=>get_instance( ).
rv_email = li_user->get_repo_git_user_email( mo_repo->get_url( ) ).
IF rv_email IS INITIAL.
rv_email = li_user->get_default_git_user_email( ).
ENDIF.
IF rv_email IS INITIAL.
" get default from user record
rv_email = zcl_abapgit_user_record=>get_instance( sy-uname )->get_email( ).
ENDIF.
ENDMETHOD.
METHOD get_committer_name.
DATA li_user TYPE REF TO zif_abapgit_persist_user.
li_user = zcl_abapgit_persistence_user=>get_instance( ).
rv_user = li_user->get_repo_git_user_name( mo_repo->get_url( ) ).
IF rv_user IS INITIAL.
rv_user = li_user->get_default_git_user_name( ).
ENDIF.
IF rv_user IS INITIAL.
" get default from user record
rv_user = zcl_abapgit_user_record=>get_instance( sy-uname )->get_name( ).
ENDIF.
ENDMETHOD.
METHOD get_defaults.
ms_commit-committer_name = get_committer_name( ).
ms_commit-committer_email = get_committer_email( ).
ms_commit-comment = get_comment_default( ).
" Committer
mo_form_data->set(
iv_key = c_id-committer_name
iv_val = ms_commit-committer_name ).
mo_form_data->set(
iv_key = c_id-committer_email
iv_val = ms_commit-committer_email ).
" Message
mo_form_data->set(
iv_key = c_id-comment
iv_val = ms_commit-comment ).
ENDMETHOD.
METHOD get_form_schema.
DATA: lv_commitmsg_comment_length TYPE i.
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'commit-form'
iv_help_page = '' ).
lv_commitmsg_comment_length = mo_settings->get_commitmsg_comment_length( ).
ro_form->text(
iv_name = c_id-comment
iv_label = 'Comment'
iv_required = abap_true
iv_max = lv_commitmsg_comment_length
iv_placeholder = |Add a mandatory comment with max { lv_commitmsg_comment_length } characters|
)->textarea(
iv_name = c_id-body
iv_label = 'Body'
iv_rows = 6
iv_cols = mo_settings->get_commitmsg_body_size( )
iv_placeholder = 'Add an optional description...'
)->text(
iv_name = c_id-committer_name
iv_label = 'Committer Name'
iv_required = abap_true
)->text(
iv_name = c_id-committer_email
iv_label = 'Committer Email'
iv_required = abap_true ).
IF mo_settings->get_commitmsg_hide_author( ) IS INITIAL.
ro_form->text(
iv_name = c_id-author_name
iv_label = 'Author Name'
iv_placeholder = 'Optionally, specify an author (same as committer by default)'
)->text(
iv_name = c_id-author_email
iv_label = 'Author Email' ).
ENDIF.
ro_form->text(
iv_name = c_id-new_branch_name
iv_label = 'New Branch Name'
iv_placeholder = 'Optionally, enter a new branch name for this commit'
iv_condense = abap_true ).
ro_form->command(
iv_label = 'Commit'
iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
iv_action = c_event-commit
)->command(
iv_label = 'Back'
iv_action = zif_abapgit_definitions=>c_action-go_back ).
ENDMETHOD.
METHOD is_valid_email.
" Email address validation (RFC 5322)
"
CONSTANTS lc_email_regex TYPE string VALUE
'[\w!#$%&*+/=?`{|}~^-]+(?:\.[\w!#$%&*+/=?`{|}~^-]+)*@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,6}'.
IF iv_email IS INITIAL.
rv_valid = abap_true.
ELSE.
FIND REGEX lc_email_regex IN iv_email.
rv_valid = boolc( sy-subrc = 0 ).
ENDIF.
ENDMETHOD.
METHOD render_stage_details.
FIELD-SYMBOLS <ls_stage> LIKE LINE OF mt_stage.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<table class="stage_tab">' ).
ri_html->add( '<thead>' ).
ri_html->add( '<tr>' ).
ri_html->add( '<th colspan="3">Staged Files (See <a href="#top">Summary</a> Above)</th>' ).
ri_html->add( '</tr>' ).
ri_html->add( '</thead>' ).
ri_html->add( '<tbody>' ).
LOOP AT mt_stage ASSIGNING <ls_stage>.
ri_html->add( '<tr>' ).
ri_html->add( '<td>' ).
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_item_state(
iv_lstate = <ls_stage>-status-lstate
iv_rstate = <ls_stage>-status-rstate ) ).
ri_html->add( '</td>' ).
ri_html->add( '<td class="method">' ).
ri_html->add( zcl_abapgit_stage=>method_description( <ls_stage>-method ) ).
ri_html->add( '</td>' ).
ri_html->add( '<td>' ).
ri_html->add( <ls_stage>-file-path && <ls_stage>-file-filename ).
ri_html->add( '</td>' ).
ri_html->add( '</tr>' ).
ENDLOOP.
ri_html->add( '</tbody>' ).
ri_html->add( '</table>' ).
ENDMETHOD.
METHOD render_stage_summary.
DATA:
BEGIN OF ls_sum,
method TYPE string,
count TYPE i,
END OF ls_sum,
lt_sum LIKE STANDARD TABLE OF ls_sum WITH DEFAULT KEY.
FIELD-SYMBOLS <ls_stage> LIKE LINE OF mt_stage.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
LOOP AT mt_stage ASSIGNING <ls_stage>.
ls_sum-method = <ls_stage>-method.
ls_sum-count = 1.
COLLECT ls_sum INTO lt_sum.
ENDLOOP.
ri_html->add( 'Stage Summary: ' ).
READ TABLE lt_sum INTO ls_sum WITH TABLE KEY method = zif_abapgit_definitions=>c_method-add.
IF sy-subrc = 0.
ri_html->add( |<span class="diff_banner diff_ins" title="add">+ { ls_sum-count }</span>| ).
ENDIF.
READ TABLE lt_sum INTO ls_sum WITH TABLE KEY method = zif_abapgit_definitions=>c_method-rm.
IF sy-subrc = 0.
ri_html->add( |<span class="diff_banner diff_del" title="remove">- { ls_sum-count }</span>| ).
ENDIF.
READ TABLE lt_sum INTO ls_sum WITH TABLE KEY method = zif_abapgit_definitions=>c_method-ignore.
IF sy-subrc = 0.
ri_html->add( |<span class="diff_banner diff_upd" title="ignore">~ { ls_sum-count }</span>| ).
ENDIF.
IF lines( mt_stage ) = 1.
ri_html->add( 'file' ).
ELSE.
ri_html->add( 'files' ).
ENDIF.
ri_html->add( '(See <a href="#stage-details">Details</a> Below)' ).
ENDMETHOD.
METHOD validate_form.
DATA: lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
lv_new_branch_name TYPE string.
ro_validation_log = mo_form_util->validate( io_form_data ).
IF is_valid_email( io_form_data->get( c_id-committer_email ) ) = abap_false.
ro_validation_log->set(
iv_key = c_id-committer_email
iv_val = |Invalid email address| ).
ENDIF.
IF is_valid_email( io_form_data->get( c_id-author_email ) ) = abap_false.
ro_validation_log->set(
iv_key = c_id-author_email
iv_val = |Invalid email address| ).
ENDIF.
lv_new_branch_name = io_form_data->get( c_id-new_branch_name ).
IF lv_new_branch_name IS NOT INITIAL.
" check if branch already exists
lt_branches = zcl_abapgit_git_transport=>branches( mo_repo->get_url( ) )->get_branches_only( ).
READ TABLE lt_branches TRANSPORTING NO FIELDS WITH TABLE KEY name_key
COMPONENTS name = branch_name_to_internal( lv_new_branch_name ).
IF sy-subrc = 0.
ro_validation_log->set(
iv_key = c_id-new_branch_name
iv_val = |Branch already exists| ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA lv_new_branch_name TYPE string.
mo_form_data = mo_form_util->normalize( ii_event->form_data( ) ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-go_back.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
WHEN c_event-commit.
" Validate form entries before committing
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->is_empty( ) = abap_true.
" new branch fields not needed in commit data
mo_form_data->strict( abap_false ).
mo_form_data->to_abap( CHANGING cs_container = ms_commit ).
REPLACE ALL OCCURRENCES
OF zif_abapgit_definitions=>c_crlf
IN ms_commit-body
WITH zif_abapgit_definitions=>c_newline.
lv_new_branch_name = mo_form_data->get( c_id-new_branch_name ).
" create new branch and commit to it if branch name is not empty
IF lv_new_branch_name IS NOT INITIAL.
lv_new_branch_name = branch_name_to_internal( lv_new_branch_name ).
" creates a new branch and automatically switches to it
mo_repo->create_branch( lv_new_branch_name ).
ENDIF.
zcl_abapgit_services_git=>commit(
is_commit = ms_commit
io_repo = mo_repo
io_stage = mo_stage ).
MESSAGE 'Commit was successful' TYPE 'S'.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back_to_bookmark.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
gui_services( )->register_event_handler( me ).
IF mo_form_util->is_empty( mo_form_data ) = abap_true.
get_defaults( ).
ENDIF.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div id="top" class="paddings">' ).
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( mo_repo ) ).
ri_html->add( '</div>' ).
ri_html->add( '<div id="stage-summary" class="dialog w800px paddings">' ).
ri_html->add( render_stage_summary( ) ).
ri_html->add( '</div>' ).
ri_html->add( mo_form->render(
iv_form_class = 'w800px'
io_values = mo_form_data
io_validation_log = mo_validation_log ) ).
ri_html->add( '<div id="stage-details" class="dialog w800px">' ).
ri_html->add( render_stage_details( ) ).
ri_html->add( '</div>' ).
ENDMETHOD.
ENDCLASS. | 30.010508 | 119 | 0.663107 | {
"alnum_ratio": 0.6101794645,
"alpha_token_ratio": 1.7604770017,
"avg_line_length": 29.8157894737,
"char_rep_ratio": 0.1172141764,
"max_line_length": 119,
"num_words": 1233,
"text_len": 16995,
"word_rep_ratio": 0.0212418301
} | 5,028,805,886,648,274,000 |
039ceffca1158284df9b108aeb7b521bcad84cf2 | 356 | abap | ABAP | src/zif_abapgit_code_inspector.intf.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/zif_abapgit_code_inspector.intf.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/zif_abapgit_code_inspector.intf.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | INTERFACE zif_abapgit_code_inspector
PUBLIC .
METHODS run
IMPORTING
!iv_variant TYPE sci_chkv
!iv_save TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_list) TYPE scit_alvlist
RAISING
zcx_abapgit_exception .
METHODS is_successful
RETURNING
VALUE(rv_success) TYPE abap_bool .
ENDINTERFACE. | 20.941176 | 54 | 0.710674 | {
"alnum_ratio": 0.6704225352,
"alpha_token_ratio": 1.9508196721,
"avg_line_length": 22.1875,
"char_rep_ratio": 0.1040462428,
"max_line_length": 54,
"num_words": 27,
"text_len": 355,
"word_rep_ratio": 0
} | 3,172,155,845,220,974,000 |
03b61fa271fa1bf00818e7c350e94bb582daae09 | 1,698 | abap | ABAP | src/persist/zif_abapgit_persist_repo.intf.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/persist/zif_abapgit_persist_repo.intf.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/persist/zif_abapgit_persist_repo.intf.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | INTERFACE zif_abapgit_persist_repo
PUBLIC .
METHODS add
IMPORTING
!iv_url TYPE string
!iv_branch_name TYPE string
!iv_branch TYPE zif_abapgit_definitions=>ty_sha1 OPTIONAL
iv_display_name TYPE string OPTIONAL
!iv_package TYPE devclass
!iv_offline TYPE abap_bool DEFAULT abap_false
!is_dot_abapgit TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit
RETURNING
VALUE(rv_key) TYPE zif_abapgit_persistence=>ty_repo-key
RAISING
zcx_abapgit_exception .
METHODS delete
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RAISING
zcx_abapgit_exception .
METHODS list
RETURNING
VALUE(rt_repos) TYPE zif_abapgit_persistence=>ty_repos
RAISING
zcx_abapgit_exception .
METHODS list_favorites
IMPORTING it_keys TYPE zif_abapgit_persistence=>ty_repo_keys
RETURNING VALUE(rt_repos) TYPE zif_abapgit_persistence=>ty_repos
RAISING
zcx_abapgit_exception .
METHODS lock
IMPORTING
!iv_mode TYPE enqmode
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RAISING
zcx_abapgit_exception .
METHODS read
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RETURNING
VALUE(rs_repo) TYPE zif_abapgit_persistence=>ty_repo
RAISING
zcx_abapgit_exception
zcx_abapgit_not_found .
METHODS update_metadata
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!is_meta TYPE zif_abapgit_persistence=>ty_repo_xml
!is_change_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask
RAISING
zcx_abapgit_exception .
ENDINTERFACE. | 30.872727 | 72 | 0.722615 | {
"alnum_ratio": 0.6688273424,
"alpha_token_ratio": 1.8837209302,
"avg_line_length": 31.4259259259,
"char_rep_ratio": 0.2026066351,
"max_line_length": 72,
"num_words": 104,
"text_len": 1697,
"word_rep_ratio": 0
} | 8,072,360,762,168,377,000 |
03d05cc7c6ce652c629b981ea7c0ba3fde08a24a | 647 | abap | ABAP | src/profiles/ycx_failed_to_add_a_line.clas.abap | thomham/code-pal-for-abap | c58c4333f236a17937335871d9261b0897209399 | [
"Apache-2.0"
] | 202 | 2020-05-05T13:41:12.000Z | 2022-03-26T15:18:13.000Z | src/profiles/ycx_failed_to_add_a_line.clas.abap | thomham/code-pal-for-abap | c58c4333f236a17937335871d9261b0897209399 | [
"Apache-2.0"
] | 322 | 2020-05-05T19:14:35.000Z | 2022-03-22T14:48:44.000Z | src/profiles/ycx_failed_to_add_a_line.clas.abap | lucasborin/code-pal-for-abap | 4e1247693457e7687648806b18b63cb8968f927a | [
"Apache-2.0"
] | 59 | 2020-05-05T18:59:19.000Z | 2022-03-20T11:24:48.000Z | class YCX_FAILED_TO_ADD_A_LINE definition
public
inheriting from CX_STATIC_CHECK
final
create public .
public section.
interfaces IF_T100_MESSAGE .
methods CONSTRUCTOR
importing
!TEXTID like IF_T100_MESSAGE=>T100KEY optional
!PREVIOUS like PREVIOUS optional .
protected section.
private section.
ENDCLASS.
CLASS YCX_FAILED_TO_ADD_A_LINE IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
PREVIOUS = PREVIOUS
.
clear me->textid.
if textid is initial.
IF_T100_MESSAGE~T100KEY = IF_T100_MESSAGE=>DEFAULT_TEXTID.
else.
IF_T100_MESSAGE~T100KEY = TEXTID.
endif.
endmethod.
ENDCLASS. | 17.486486 | 60 | 0.785162 | {
"alnum_ratio": 0.7507739938,
"alpha_token_ratio": 2.067264574,
"avg_line_length": 17.9444444444,
"char_rep_ratio": 0.1098901099,
"max_line_length": 60,
"num_words": 55,
"text_len": 646,
"word_rep_ratio": 0
} | 3,172,528,766,988,770,000 |
03d8551ec4bb068dc96cb781cfcc9be4e4e6fa74 | 1,001 | abap | ABAP | src/objects/texts/zif_abapgit_lxe_texts.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/objects/texts/zif_abapgit_lxe_texts.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/objects/texts/zif_abapgit_lxe_texts.intf.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | INTERFACE zif_abapgit_lxe_texts
PUBLIC .
TYPES:
BEGIN OF ty_lxe_i18n,
source_lang TYPE lxeisolang,
target_lang TYPE lxeisolang,
custmnr TYPE lxecustmnr,
objtype TYPE trobjtype,
objname TYPE lxeobjname,
text_pairs TYPE STANDARD TABLE OF lxe_pcx_s1 WITH DEFAULT KEY,
END OF ty_lxe_i18n .
TYPES:
ty_tlxe_i18n TYPE STANDARD TABLE OF ty_lxe_i18n WITH DEFAULT KEY .
METHODS serialize
IMPORTING
!iv_lxe_text_name TYPE string DEFAULT 'LXE_TEXTS'
!iv_object_type TYPE trobjtype
!iv_object_name TYPE sobj_name
!ii_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS deserialize
IMPORTING
!iv_lxe_text_name TYPE string DEFAULT 'LXE_TEXTS'
!iv_object_type TYPE trobjtype OPTIONAL
!iv_object_name TYPE sobj_name OPTIONAL
!ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception .
ENDINTERFACE. | 29.441176 | 70 | 0.701299 | {
"alnum_ratio": 0.656,
"alpha_token_ratio": 1.7299465241,
"avg_line_length": 30.303030303,
"char_rep_ratio": 0.0928355197,
"max_line_length": 70,
"num_words": 89,
"text_len": 1000,
"word_rep_ratio": 0
} | 4,754,980,455,551,480,000 |
ff2bd5b385e64b8ef602abd441a2bdd6f1905aa1 | 9,365 | abap | ABAP | src/checks/y_check_db_access_in_ut.clas.abap | pokrakam/code-pal-for-abap | 65c008f75d4d2453c6994c57dc03741862c1d510 | [
"Apache-2.0"
] | 202 | 2020-05-05T13:41:12.000Z | 2022-03-26T15:18:13.000Z | src/checks/y_check_db_access_in_ut.clas.abap | pokrakam/code-pal-for-abap | 65c008f75d4d2453c6994c57dc03741862c1d510 | [
"Apache-2.0"
] | 322 | 2020-05-05T19:14:35.000Z | 2022-03-22T14:48:44.000Z | src/checks/y_check_db_access_in_ut.clas.abap | lucasborin/code-pal-for-abap | 4e1247693457e7687648806b18b63cb8968f927a | [
"Apache-2.0"
] | 59 | 2020-05-05T18:59:19.000Z | 2022-03-20T11:24:48.000Z | CLASS y_check_db_access_in_ut DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS inspect_structures REDEFINITION.
METHODS inspect_tokens REDEFINITION.
PRIVATE SECTION.
CONSTANTS: BEGIN OF risk_level,
harmless TYPE string VALUE 'HARMLESS',
dangerous TYPE string VALUE 'DANGEROUS',
critical TYPE string VALUE 'CRITICAL',
END OF risk_level.
CONSTANTS: BEGIN OF check_for,
alter TYPE char40 VALUE 'ALTER',
delete TYPE char40 VALUE 'DELETE',
update TYPE char40 VALUE 'UPDATE',
modify TYPE char40 VALUE 'MODIFY',
insert TYPE char40 VALUE 'INSERT',
select TYPE char40 VALUE 'SELECT',
commit TYPE char40 VALUE 'COMMIT',
rollback TYPE char40 VALUE 'ROLLBACK',
END OF check_for.
CONSTANTS: BEGIN OF framework,
qsql_if TYPE char40 VALUE 'IF_OSQL_TEST_ENVIRONMENT',
qsql_cl TYPE char40 VALUE 'CL_OSQL_TEST_ENVIRONMENT',
cds_if TYPE char40 VALUE 'IF_CDS_TEST_ENVIRONMENT',
cds_cl TYPE char40 VALUE 'CL_CDS_TEST_ENVIRONMENT',
END OF framework.
CONSTANTS: BEGIN OF keys,
from TYPE char40 VALUE 'FROM',
into TYPE char40 VALUE 'INTO',
class TYPE char40 VALUE 'CLASS',
table TYPE char4 VALUE 'TABL',
END OF keys.
TYPES: BEGIN OF properties,
name TYPE string,
risk_level TYPE string,
END OF properties.
DATA defined_classes TYPE STANDARD TABLE OF properties.
METHODS get_class_name IMPORTING structure TYPE sstruc
RETURNING VALUE(result) TYPE string
RAISING cx_sy_itab_line_not_found.
METHODS get_risk_level IMPORTING statement TYPE sstmnt
RETURNING VALUE(result) TYPE string.
METHODS add_line_to_defined_classes IMPORTING statement TYPE sstmnt
structure TYPE sstruc.
METHODS check_class IMPORTING index TYPE i
statement TYPE sstmnt
structure TYPE sstruc.
METHODS is_part_of_framework IMPORTING structure TYPE sstruc
RETURNING VALUE(result) TYPE abap_bool.
METHODS is_persistent_object IMPORTING obj_name TYPE tadir-obj_name
RETURNING VALUE(result) TYPE abap_bool.
METHODS is_internal_table IMPORTING statement TYPE sstmnt
RETURNING VALUE(result) TYPE abap_bool.
METHODS get_forbidden_tokens IMPORTING class_name TYPE string
RETURNING VALUE(result) TYPE y_char255_tab.
METHODS has_ddic_itab_same_syntax IMPORTING token TYPE stokesx
RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC DB_ACCESS_UT' ##NO_TEXT.
settings-disable_threshold_selection = abap_true.
settings-disable_on_prodcode_selection = abap_true.
settings-disable_on_testcode_selection = abap_true.
settings-threshold = 0.
settings-apply_on_productive_code = abap_false.
settings-apply_on_test_code = abap_true.
settings-documentation = |{ c_docs_path-checks }db-access-in-ut.md|.
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_definition )
( scan_struc_stmnt_type-class_implementation ) ).
relevant_structure_types = VALUE #( ).
set_check_message( 'Database access(es) within a Unit-Test should be removed!' ).
ENDMETHOD.
METHOD inspect_tokens.
CASE structure-stmnt_type.
WHEN scan_struc_stmnt_type-class_definition.
add_line_to_defined_classes( statement = statement
structure = structure ).
WHEN scan_struc_stmnt_type-class_implementation.
check_class( index = index
statement = statement
structure = structure ).
ENDCASE.
ENDMETHOD.
METHOD is_persistent_object.
DATA(upper_name) = to_upper( obj_name ).
SELECT SINGLE @abap_true
FROM tadir
INTO @result
WHERE obj_name = @upper_name
AND object = @keys-table
AND delflag = @space.
ENDMETHOD.
METHOD is_internal_table.
DATA(second_token) = get_token_abs( statement-from + 1 ).
DATA(third_token) = get_token_abs( statement-from + 2 ).
DATA(fourth_token) = get_token_abs( statement-from + 2 ).
IF second_token = keys-into.
RETURN.
ENDIF.
DATA(table_name) = COND #( WHEN second_token = keys-from THEN third_token
WHEN third_token = keys-into THEN fourth_token
ELSE second_token ).
IF strlen( table_name ) > 40.
RETURN.
ENDIF.
result = xsdbool( is_persistent_object( CONV #( table_name ) ) = abap_false ).
ENDMETHOD.
METHOD add_line_to_defined_classes.
TRY.
DATA(class_config) = VALUE properties( name = get_class_name( structure ) ).
CATCH cx_sy_itab_line_not_found.
RETURN.
ENDTRY.
IF line_exists( defined_classes[ name = class_config-name ] ).
RETURN.
ENDIF.
class_config-risk_level = get_risk_level( statement ).
IF is_part_of_framework( structure ) = abap_false.
APPEND class_config TO defined_classes.
ENDIF.
ENDMETHOD.
METHOD check_class.
TRY.
DATA(class_name) = get_class_name( structure ).
CATCH cx_sy_itab_line_not_found.
RETURN.
ENDTRY.
IF NOT line_exists( defined_classes[ name = class_name ] ).
RETURN.
ENDIF.
DATA(forbidden_tokens) = get_forbidden_tokens( class_name ).
DATA(token) = ref_scan_manager->tokens[ statement-from ].
IF NOT line_exists( forbidden_tokens[ table_line = token-str ] ).
RETURN.
ENDIF.
IF has_ddic_itab_same_syntax( token ) = abap_true
AND is_internal_table( statement ) = abap_true.
RETURN.
ENDIF.
IF ref_scan_manager->tokens[ statement-from + 1 ]-str = '='.
RETURN.
ENDIF.
DATA(check_configuration) = detect_check_configuration( statement ).
IF check_configuration IS INITIAL.
RETURN.
ENDIF.
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
error_priority = check_configuration-prio ).
ENDMETHOD.
METHOD get_forbidden_tokens.
DATA risk_lvl TYPE properties-risk_level.
TRY.
risk_lvl = defined_classes[ name = class_name ]-risk_level.
CATCH cx_sy_itab_line_not_found.
risk_lvl = space.
ENDTRY.
CASE risk_lvl.
WHEN risk_level-dangerous OR risk_level-critical.
result = VALUE #( ( check_for-alter )
( check_for-delete )
( check_for-update )
( check_for-modify ) ).
WHEN OTHERS.
result = VALUE #( ( check_for-alter )
( check_for-delete )
( check_for-update )
( check_for-modify )
( check_for-insert )
( check_for-select )
( check_for-commit )
( check_for-rollback ) ).
ENDCASE.
ENDMETHOD.
METHOD is_part_of_framework.
LOOP AT ref_scan_manager->statements ASSIGNING FIELD-SYMBOL(<statement>)
FROM structure-stmnt_from TO structure-stmnt_to.
LOOP AT ref_scan_manager->tokens TRANSPORTING NO FIELDS
FROM <statement>-from TO <statement>-to
WHERE str = framework-qsql_if
OR str = framework-qsql_cl
OR str = framework-cds_if
OR str = framework-cds_cl.
result = abap_true.
RETURN.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD get_class_name.
DATA(index) = ref_scan_manager->statements[ structure-stmnt_from ]-from.
IF get_token_abs( index ) = keys-class.
result = get_token_abs( index + 1 ).
ENDIF.
ENDMETHOD.
METHOD get_risk_level.
LOOP AT ref_scan_manager->tokens ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-to
WHERE str = risk_level-harmless
OR str = risk_level-dangerous
OR str = risk_level-critical.
result = <token>-str.
ENDLOOP.
ENDMETHOD.
METHOD inspect_structures.
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_definition ) ).
super->inspect_structures( ).
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_implementation ) ).
super->inspect_structures( ).
ENDMETHOD.
METHOD has_ddic_itab_same_syntax.
result = xsdbool( token-str = check_for-modify
OR token-str = check_for-update
OR token-str = check_for-delete
OR token-str = check_for-insert ).
ENDMETHOD.
ENDCLASS. | 32.071918 | 91 | 0.621356 | {
"alnum_ratio": 0.5888509184,
"alpha_token_ratio": 2.0066006601,
"avg_line_length": 32.1786941581,
"char_rep_ratio": 0.1841795831,
"max_line_length": 91,
"num_words": 635,
"text_len": 9364,
"word_rep_ratio": 0
} | 8,559,763,524,118,234,000 |
ff557b2f2e5ffb026a1fcd9e819dffdecb968adf | 6,750 | abap | ABAP | src/checks/zcl_aoc_check_25.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 199 | 2015-02-17T07:08:01.000Z | 2022-03-23T09:50:05.000Z | src/checks/zcl_aoc_check_25.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 769 | 2015-01-03T07:09:11.000Z | 2022-03-21T11:59:53.000Z | src/checks/zcl_aoc_check_25.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 109 | 2015-03-09T10:22:34.000Z | 2022-03-08T08:47:41.000Z | CLASS zcl_aoc_check_25 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS check
REDEFINITION .
METHODS get_attributes
REDEFINITION .
METHODS if_ci_test~query_attributes
REDEFINITION .
METHODS put_attributes
REDEFINITION .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_field,
name TYPE string,
level TYPE i,
row TYPE token_row,
END OF ty_field .
TYPES:
ty_fields_tt TYPE STANDARD TABLE OF ty_field WITH NON-UNIQUE DEFAULT KEY .
DATA mv_skip_radio TYPE sychar01 .
METHODS strip
IMPORTING
!iv_input TYPE string
RETURNING
VALUE(rv_output) TYPE string .
METHODS analyze
IMPORTING
!io_scan TYPE REF TO zcl_aoc_scan
!it_fields TYPE ty_fields_tt .
METHODS find_fields
IMPORTING
!it_tokens TYPE stokesx_tab
!it_statements TYPE sstmnt_tab
RETURNING
VALUE(rt_fields) TYPE ty_fields_tt .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_25 IMPLEMENTATION.
METHOD analyze.
* this might not be 100% correct but will work for most cases
DATA: lv_include TYPE program,
lv_name TYPE string,
lt_fields LIKE it_fields.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF io_scan->statements,
<ls_field> LIKE LINE OF it_fields,
<ls_token> LIKE LINE OF io_scan->tokens.
lt_fields = it_fields.
LOOP AT io_scan->statements ASSIGNING <ls_statement>.
LOOP AT io_scan->tokens ASSIGNING <ls_token>
FROM <ls_statement>-from
TO <ls_statement>-to
WHERE type <> io_scan->gc_token-comment
AND type <> io_scan->gc_token-literal.
lv_name = strip( <ls_token>-str ).
DELETE lt_fields
WHERE name = lv_name
AND ( row <> <ls_token>-row
OR level <> <ls_statement>-level ).
ENDLOOP.
ENDLOOP.
LOOP AT lt_fields ASSIGNING <ls_field>.
lv_include = io_scan->get_include( <ls_field>-level ).
inform( p_sub_obj_name = lv_include
p_line = <ls_field>-row
p_kind = mv_errty
p_test = myname
p_code = '001'
p_param_1 = <ls_field>-name ).
ENDLOOP.
ENDMETHOD.
METHOD check.
* abapOpenChecks
*
* MIT License
DATA: lt_fields TYPE ty_fields_tt.
lt_fields = find_fields( it_tokens = io_scan->tokens
it_statements = io_scan->statements ).
analyze( io_scan = io_scan
it_fields = lt_fields ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '025'.
has_attributes = abap_true.
attributes_ok = abap_true.
enable_rfc( ).
mv_skip_radio = abap_true.
insert_scimessage(
iv_code = '001'
iv_text = '&1 not referenced statically'(m01) ).
ENDMETHOD.
METHOD find_fields.
DATA: lv_keyword TYPE string,
lt_code TYPE string_table,
ls_result TYPE zcl_aoc_parser=>ty_result,
ls_field LIKE LINE OF rt_fields,
lv_statement TYPE string.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF it_statements,
<ls_rt> LIKE LINE OF ls_result-tokens,
<ls_token> LIKE LINE OF it_tokens.
LOOP AT it_statements ASSIGNING <ls_statement>
WHERE type = zcl_aoc_scan=>gc_statement-standard.
CLEAR lv_keyword.
CLEAR lv_statement.
LOOP AT it_tokens ASSIGNING <ls_token>
FROM <ls_statement>-from
TO <ls_statement>-to
WHERE type <> zcl_aoc_scan=>gc_token-comment.
IF lv_keyword IS INITIAL.
lv_keyword = <ls_token>-str.
ENDIF.
IF lv_statement IS INITIAL.
lv_statement = <ls_token>-str.
ELSE.
CONCATENATE lv_statement <ls_token>-str INTO lv_statement SEPARATED BY space.
ENDIF.
ENDLOOP.
IF lv_keyword <> 'PARAMETERS'
AND lv_keyword <> 'PARAMETER'
AND lv_keyword <> 'SELECT-OPTIONS'.
CONTINUE. " current loop
ENDIF.
CLEAR lt_code.
APPEND lv_statement TO lt_code.
ls_result = zcl_aoc_parser=>run( it_code = lt_code
iv_rule = lv_keyword ).
IF ls_result-match = abap_false.
CONTINUE.
ENDIF.
LOOP AT ls_result-tokens ASSIGNING <ls_rt>
WHERE value = zcl_aoc_parser=>c_role-fielddefid
AND type = zcl_aoc_parser=>c_type-role.
IF mv_skip_radio = abap_true.
READ TABLE ls_result-tokens
WITH KEY type = zcl_aoc_parser=>c_type-terminal code = 'RADIOBUTTON'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONTINUE.
ENDIF.
ENDIF.
CLEAR ls_field.
ls_field-name = strip( <ls_rt>-code ).
ls_field-level = <ls_statement>-level.
ls_field-row = <ls_token>-row.
APPEND ls_field TO rt_fields.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD get_attributes.
EXPORT
mv_errty = mv_errty
mv_skip_radio = mv_skip_radio
TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_fill_att mv_skip_radio 'Skip radio buttons' 'C'. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
mv_skip_radio = mv_skip_radio
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD strip.
DATA: lv_offset TYPE i,
lv_length TYPE i.
rv_output = iv_input.
FIND FIRST OCCURRENCE OF '[' IN rv_output MATCH OFFSET lv_offset.
IF sy-subrc = 0.
rv_output = rv_output(lv_offset).
ENDIF.
FIND FIRST OCCURRENCE OF '+' IN rv_output MATCH OFFSET lv_offset.
IF sy-subrc = 0.
rv_output = rv_output(lv_offset).
ENDIF.
lv_length = strlen( rv_output ) - 1.
IF strlen( rv_output ) > 1 AND rv_output(1) = '(' AND rv_output+lv_length(1) = ')'.
lv_length = lv_length - 1.
rv_output = rv_output+1(lv_length).
ELSE.
FIND FIRST OCCURRENCE OF '(' IN rv_output MATCH OFFSET lv_offset.
IF sy-subrc = 0.
rv_output = rv_output(lv_offset).
ENDIF.
ENDIF.
IF strlen( rv_output ) > 1 AND rv_output(1) = '@'.
rv_output = rv_output+1.
ENDIF.
ENDMETHOD.
ENDCLASS. | 24.107143 | 87 | 0.607111 | {
"alnum_ratio": 0.5683410344,
"alpha_token_ratio": 1.7084653689,
"avg_line_length": 24.0465949821,
"char_rep_ratio": 0.1137313433,
"max_line_length": 87,
"num_words": 524,
"text_len": 6709,
"word_rep_ratio": 0.0291262136
} | 3,819,693,131,489,001,000 |
ffd3eb704fba497ba7596bd6fd898d48b0e65d9d | 13,180 | abap | ABAP | src/ui/zcl_abapgit_gui_page_sett_repo.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/ui/zcl_abapgit_gui_page_sett_repo.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/ui/zcl_abapgit_gui_page_sett_repo.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_gui_page_sett_repo DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_component
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler .
INTERFACES zif_abapgit_gui_renderable .
CLASS-METHODS create
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS constructor
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_id,
dot TYPE string VALUE 'dot',
main_language TYPE string VALUE 'main_language',
i18n_langs TYPE string VALUE 'i18n_langs',
starting_folder TYPE string VALUE 'starting_folder',
folder_logic TYPE string VALUE 'folder_logic',
ignore TYPE string VALUE 'ignore',
requirements TYPE string VALUE 'requirements',
END OF c_id .
CONSTANTS:
BEGIN OF c_event,
save TYPE string VALUE 'save',
END OF c_event .
CONSTANTS c_empty_rows TYPE i VALUE 2 ##NO_TEXT.
DATA mo_form TYPE REF TO zcl_abapgit_html_form .
DATA mo_form_data TYPE REF TO zcl_abapgit_string_map .
DATA mo_form_util TYPE REF TO zcl_abapgit_html_form_utils .
DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map .
DATA mo_repo TYPE REF TO zcl_abapgit_repo .
DATA mv_requirements_count TYPE i .
METHODS validate_form
IMPORTING
!io_form_data TYPE REF TO zcl_abapgit_string_map
RETURNING
VALUE(ro_validation_log) TYPE REF TO zcl_abapgit_string_map
RAISING
zcx_abapgit_exception .
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form
RAISING
zcx_abapgit_exception .
METHODS read_settings
RAISING
zcx_abapgit_exception .
METHODS save_settings
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_gui_page_sett_repo IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
CREATE OBJECT mo_validation_log.
CREATE OBJECT mo_form_data.
mo_repo = io_repo.
mo_form = get_form_schema( ).
mo_form_util = zcl_abapgit_html_form_utils=>create( mo_form ).
read_settings( ).
ENDMETHOD.
METHOD create.
DATA lo_component TYPE REF TO zcl_abapgit_gui_page_sett_repo.
CREATE OBJECT lo_component
EXPORTING
io_repo = io_repo.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'Repository Settings'
io_page_menu = zcl_abapgit_gui_chunk_lib=>settings_repo_toolbar(
iv_key = io_repo->get_key( )
iv_act = zif_abapgit_definitions=>c_action-repo_settings )
ii_child_component = lo_component ).
ENDMETHOD.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'repo-settings-form'
iv_help_page = '' ).
ro_form->start_group(
iv_name = c_id-dot
iv_label = 'Repository Settings (.abapgit.xml)'
iv_hint = 'Settings stored in root folder in .abapgit.xml file'
)->text(
iv_name = c_id-main_language
iv_label = 'Main Language'
iv_hint = 'Main language of repository (cannot be changed)'
iv_readonly = abap_true
)->text(
iv_name = c_id-i18n_langs
iv_label = 'Serialize Translations (experimental LXE approach)'
iv_hint = 'Comma-separate 2-letter ISO language codes e.g. "DE,ES,..." - should not include main language'
)->radio(
iv_name = c_id-folder_logic
iv_default_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
iv_label = 'Folder Logic'
iv_hint = 'Define how package folders are named in repository'
)->option(
iv_label = 'Prefix'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
)->option(
iv_label = 'Full'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-full
)->text(
iv_name = c_id-starting_folder
iv_label = 'Starting Folder'
iv_hint = 'Root folder that defines where serialization starts'
)->textarea(
iv_name = c_id-ignore
iv_label = 'Ignore Files'
iv_hint = 'List of files in starting folder that shall not be serialized'
)->table(
iv_name = c_id-requirements
iv_label = 'Requirements'
iv_hint = 'List of software components with minimum release and patch'
)->column(
iv_label = 'Software Component'
iv_width = '40%'
)->column(
iv_label = 'Minimum Release'
iv_width = '30%'
)->column(
iv_label = 'Minimum Patch'
iv_width = '30%'
)->command(
iv_label = 'Save Settings'
iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
iv_action = c_event-save
)->command(
iv_label = 'Back'
iv_action = zif_abapgit_definitions=>c_action-go_back ).
ENDMETHOD.
METHOD read_settings.
DATA:
lo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
ls_dot TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit,
lv_main_lang TYPE spras,
lv_language TYPE t002t-sptxt,
lv_ignore TYPE string,
ls_requirements LIKE LINE OF ls_dot-requirements,
lv_row TYPE i,
lv_val TYPE string.
FIELD-SYMBOLS:
<lv_ignore> TYPE string.
" Get settings from DB
lo_dot = mo_repo->get_dot_abapgit( ).
ls_dot = lo_dot->get_data( ).
lv_main_lang = lo_dot->get_main_language( ).
" Repository Settings
SELECT SINGLE sptxt INTO lv_language FROM t002t
WHERE spras = sy-langu AND sprsl = lv_main_lang.
IF sy-subrc <> 0.
lv_language = 'Unknown language; Check your .abapgit.xml file'.
ENDIF.
mo_form_data->set(
iv_key = c_id-main_language
iv_val = |{ lv_main_lang } ({ lv_language })| ).
mo_form_data->set(
iv_key = c_id-i18n_langs
iv_val = zcl_abapgit_lxe_texts=>convert_table_to_lang_string( lo_dot->get_i18n_languages( ) ) ).
mo_form_data->set(
iv_key = c_id-folder_logic
iv_val = ls_dot-folder_logic ).
mo_form_data->set(
iv_key = c_id-starting_folder
iv_val = ls_dot-starting_folder ).
LOOP AT ls_dot-ignore ASSIGNING <lv_ignore>.
lv_ignore = lv_ignore && <lv_ignore> && zif_abapgit_definitions=>c_newline.
ENDLOOP.
IF sy-subrc <> 0.
lv_ignore = zif_abapgit_definitions=>c_newline.
ENDIF.
mo_form_data->set(
iv_key = c_id-ignore
iv_val = lv_ignore ).
LOOP AT ls_dot-requirements INTO ls_requirements.
lv_row = lv_row + 1.
DO 3 TIMES.
CASE sy-index.
WHEN 1.
lv_val = ls_requirements-component.
WHEN 2.
lv_val = ls_requirements-min_release.
WHEN 3.
lv_val = ls_requirements-min_patch.
ENDCASE.
mo_form_data->set(
iv_key = |{ c_id-requirements }-{ lv_row }-{ sy-index }|
iv_val = lv_val ).
ENDDO.
ENDLOOP.
DO c_empty_rows TIMES.
lv_row = lv_row + 1.
DO 3 TIMES.
mo_form_data->set(
iv_key = |{ c_id-requirements }-{ lv_row }-{ sy-index }|
iv_val = '' ).
ENDDO.
ENDDO.
mv_requirements_count = lv_row.
mo_form_data->set(
iv_key = |{ c_id-requirements }-{ zif_abapgit_html_form=>c_rows }|
iv_val = |{ mv_requirements_count }| ).
" Set for is_dirty check
mo_form_util->set_data( mo_form_data ).
ENDMETHOD.
METHOD save_settings.
DATA:
lo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
lv_ignore TYPE string,
lt_ignore TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
ls_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement,
lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
lo_dot = mo_repo->get_dot_abapgit( ).
lo_dot->set_folder_logic( mo_form_data->get( c_id-folder_logic ) ).
lo_dot->set_starting_folder( mo_form_data->get( c_id-starting_folder ) ).
lo_dot->set_i18n_languages(
zcl_abapgit_lxe_texts=>convert_lang_string_to_table(
iv_langs = mo_form_data->get( c_id-i18n_langs )
iv_skip_main_language = lo_dot->get_main_language( ) ) ).
" Remove all ignores
lt_ignore = lo_dot->get_data( )-ignore.
LOOP AT lt_ignore INTO lv_ignore.
lo_dot->remove_ignore( iv_path = ''
iv_filename = lv_ignore ).
ENDLOOP.
" Add newly entered ignores
lt_ignore = zcl_abapgit_convert=>split_string( mo_form_data->get( c_id-ignore ) ).
LOOP AT lt_ignore INTO lv_ignore WHERE table_line IS NOT INITIAL.
lo_dot->add_ignore( iv_path = ''
iv_filename = lv_ignore ).
ENDLOOP.
" Requirements
DO mv_requirements_count TIMES.
ls_requirements-component = to_upper( mo_form_data->get( |{ c_id-requirements }-{ sy-index }-1| ) ).
ls_requirements-min_release = mo_form_data->get( |{ c_id-requirements }-{ sy-index }-2| ).
ls_requirements-min_patch = mo_form_data->get( |{ c_id-requirements }-{ sy-index }-3| ).
APPEND ls_requirements TO lt_requirements.
ENDDO.
SORT lt_requirements BY component min_release min_patch.
DELETE lt_requirements WHERE component IS INITIAL.
DELETE ADJACENT DUPLICATES FROM lt_requirements COMPARING ALL FIELDS.
lo_dot->set_requirements( lt_requirements ).
mo_repo->set_dot_abapgit( lo_dot ).
mo_repo->refresh( ).
COMMIT WORK AND WAIT.
MESSAGE 'Settings succesfully saved' TYPE 'S'.
read_settings( ).
ENDMETHOD.
METHOD validate_form.
DATA:
lv_folder TYPE string,
lv_len TYPE i,
lv_component TYPE zif_abapgit_dot_abapgit=>ty_requirement-component,
lv_min_release TYPE zif_abapgit_dot_abapgit=>ty_requirement-min_release,
lv_min_patch TYPE zif_abapgit_dot_abapgit=>ty_requirement-min_patch.
ro_validation_log = mo_form_util->validate( io_form_data ).
lv_folder = io_form_data->get( c_id-starting_folder ).
lv_len = strlen( lv_folder ) - 1.
IF lv_len > 0 AND lv_folder(1) <> '/'.
ro_validation_log->set(
iv_key = c_id-starting_folder
iv_val = |The folder must begin with /| ).
ELSEIF lv_len > 0 AND lv_folder+lv_len(1) <> '/'.
ro_validation_log->set(
iv_key = c_id-starting_folder
iv_val = |The folder must end with /| ).
ELSEIF lv_folder CA '\'.
ro_validation_log->set(
iv_key = c_id-starting_folder
iv_val = |Use / instead of \\| ).
ENDIF.
DO mv_requirements_count TIMES.
lv_component = mo_form_data->get( |{ c_id-requirements }-{ sy-index }-1| ).
lv_min_release = mo_form_data->get( |{ c_id-requirements }-{ sy-index }-2| ).
lv_min_patch = mo_form_data->get( |{ c_id-requirements }-{ sy-index }-3| ).
IF lv_component IS INITIAL AND ( lv_min_release IS NOT INITIAL OR lv_min_patch IS NOT INITIAL ).
ro_validation_log->set(
iv_key = c_id-requirements
iv_val = |If you enter a release or patch, you must also enter a software component| ).
ELSEIF lv_component IS NOT INITIAL AND lv_min_release IS INITIAL.
ro_validation_log->set(
iv_key = c_id-requirements
iv_val = |If you enter a software component, you must also enter a minumum release| ).
ENDIF.
ENDDO.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
mo_form_data = mo_form_util->normalize( ii_event->form_data( ) ).
CASE ii_event->mv_action.
WHEN zif_abapgit_definitions=>c_action-go_back.
rs_handled-state = mo_form_util->exit( mo_form_data ).
WHEN c_event-save.
" Validate all form entries
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->is_empty( ) = abap_true.
save_settings( ).
ENDIF.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
gui_services( )->register_event_handler( me ).
IF mo_form_util->is_empty( mo_form_data ) = abap_true.
read_settings( ).
ENDIF.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( `<div class="repo">` ).
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top(
io_repo = mo_repo
iv_show_commit = abap_false
iv_interactive_branch = abap_true ) ).
ri_html->add( mo_form->render(
io_values = mo_form_data
io_validation_log = mo_validation_log ) ).
ri_html->add( `</div>` ).
ENDMETHOD.
ENDCLASS. | 31.912833 | 119 | 0.645903 | {
"alnum_ratio": 0.5937999848,
"alpha_token_ratio": 1.7187222715,
"avg_line_length": 31.8665048544,
"char_rep_ratio": 0.125304878,
"max_line_length": 119,
"num_words": 906,
"text_len": 13129,
"word_rep_ratio": 0
} | 12,228,686,424,605,415,000 |
ffdaaebd89e1cc4e2f1053f571c49b84a5356592 | 6,383 | abap | ABAP | src/foundation/y_exemption_of_class.clas.abap | pokrakam/code-pal-for-abap | 65c008f75d4d2453c6994c57dc03741862c1d510 | [
"Apache-2.0"
] | 202 | 2020-05-05T13:41:12.000Z | 2022-03-26T15:18:13.000Z | src/foundation/y_exemption_of_class.clas.abap | pokrakam/code-pal-for-abap | 65c008f75d4d2453c6994c57dc03741862c1d510 | [
"Apache-2.0"
] | 322 | 2020-05-05T19:14:35.000Z | 2022-03-22T14:48:44.000Z | src/foundation/y_exemption_of_class.clas.abap | lucasborin/code-pal-for-abap | 4e1247693457e7687648806b18b63cb8968f927a | [
"Apache-2.0"
] | 59 | 2020-05-05T18:59:19.000Z | 2022-03-20T11:24:48.000Z | CLASS y_exemption_of_class DEFINITION PUBLIC CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES y_if_exemption_of_object.
ALIASES is_exempted FOR y_if_exemption_of_object~is_exempted.
PRIVATE SECTION.
CLASS-DATA class_header_data TYPE seoclassdf.
CLASS-METHODS is_srv_maint_ui_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_odata_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_ecatt_odata_test_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_fin_infotype_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_extensibility_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_shma_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_proxy_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_sadl_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_exit_class RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_exception_class RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_bcp_application RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS y_exemption_of_class IMPLEMENTATION.
METHOD y_if_exemption_of_object~is_exempted.
result = abap_true.
SELECT SINGLE *
FROM seoclassdf
INTO @class_header_data
WHERE clsname = @object_name
AND version = 1.
IF sy-subrc = 0.
result = xsdbool( is_srv_maint_ui_generate( ) = abap_true OR
is_odata_generate( ) = abap_true OR
is_ecatt_odata_test_generate( ) = abap_true OR
is_fin_infotype_generate( ) = abap_true OR
is_extensibility_generate( ) = abap_true OR
is_shma_generate( ) = abap_true OR
is_proxy_generate( ) = abap_true OR
is_sadl_generate( ) = abap_true OR
is_exit_class( ) = abap_true OR
is_exception_class( ) = abap_true OR
is_bcp_application( ) = abap_true ).
ENDIF.
ENDMETHOD.
METHOD is_bcp_application.
DATA it_bsp_classes TYPE STANDARD TABLE OF seoclsname.
it_bsp_classes = VALUE #( ( 'CL_BSP_WD_COMPONENT_CONTROLLER' )
( 'CL_BSP_WD_CONTEXT' )
( 'CL_BSP_WD_CONTEXT_NODE' )
( 'CL_BSP_WD_WINDOW' )
( 'CL_BSP_WD_CUSTOM_CONTROLLER' )
( 'CL_BSP_WD_VIEW_CONTROLLER' )
( 'CL_BSP_WD_ADVSEARCH_CONTROLLER' )
( 'CL_BSP_WD_CONTEXT_NODE_ASP' ) ).
SELECT SINGLE refclsname FROM seometarel
WHERE clsname = @class_header_data-clsname AND refclsname IS NOT NULL
INTO @DATA(inherited_by).
IF sy-subrc <> 0.
RETURN.
ENDIF.
"Multi Inheritance
DO.
LOOP AT it_bsp_classes TRANSPORTING NO FIELDS WHERE table_line = inherited_by.
result = abap_true.
RETURN.
ENDLOOP.
SELECT SINGLE refclsname FROM seometarel
WHERE clsname = @inherited_by AND refclsname IS NOT NULL
INTO @inherited_by.
IF sy-subrc = 4.
RETURN.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD is_ecatt_odata_test_generate.
SELECT SINGLE @abap_true
FROM seoclassdf
INTO @result
WHERE clsname = @class_header_data-clsname
AND author = 'eCATTClassGe'.
ENDMETHOD.
METHOD is_exception_class.
CONSTANTS exception_clase_type LIKE class_header_data-category VALUE '40'.
IF class_header_data-category = exception_clase_type.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_exit_class.
CONSTANTS exit_class_type LIKE class_header_data-category VALUE '01'.
IF class_header_data-category = exit_class_type.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_extensibility_generate.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = 'IF_CFD_ODATA_MPC_FLX' OR refclsname = 'IF_CFD_ODATA_DPC_FLX'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD is_fin_infotype_generate.
SELECT SINGLE @abap_true
FROM t777ditclass
INTO @result
WHERE idclass = @class_header_data-clsname
OR cont_db = @class_header_data-clsname
OR bl_class = @class_header_data-clsname.
ENDMETHOD.
METHOD is_odata_generate.
SELECT SINGLE @abap_true
FROM /iwbep/i_sbd_ga
INTO @result
WHERE ( gen_art_type = 'DPCB' OR gen_art_type = 'MPCB' )
AND trobj_type = 'CLAS'
AND trobj_name = @class_header_data-clsname. "#EC CI_NOFIELD
ENDMETHOD.
METHOD is_proxy_generate.
result = xsdbool( class_header_data-clsproxy = abap_true ).
ENDMETHOD.
METHOD is_sadl_generate.
SELECT SINGLE @abap_true
FROM seoclasstx
INTO @result
WHERE clsname = @class_header_data-clsname
AND descript = 'Generated by SADL Generation Toolkit' ##NO_TEXT.
ENDMETHOD.
METHOD is_shma_generate.
SELECT SINGLE @abap_true
FROM tadir
INTO @result
WHERE pgmid = 'R3TR'
AND object = 'SHMA'
AND obj_name = @class_header_data-clsname.
ENDMETHOD.
METHOD is_srv_maint_ui_generate.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = '/FTI/IF_FTI_MODEL' OR refclsname = '/FTI/IF_NATIVE_SQL_GENERATOR'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
ENDCLASS. | 30.108491 | 92 | 0.666614 | {
"alnum_ratio": 0.6233155751,
"alpha_token_ratio": 1.7989995452,
"avg_line_length": 30.2464454976,
"char_rep_ratio": 0.1484387259,
"max_line_length": 92,
"num_words": 447,
"text_len": 6382,
"word_rep_ratio": 0.1232876712
} | 14,143,860,330,382,924,000 |
ffdc71d4a7915b854095265840e36298d8b5927f | 2,044 | abap | ABAP | src/zcl_abapgit_injector.clas.testclasses.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/zcl_abapgit_injector.clas.testclasses.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/zcl_abapgit_injector.clas.testclasses.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS ltcl_abapgit_tadir_mock DEFINITION FOR TESTING.
PUBLIC SECTION.
INTERFACES: zif_abapgit_tadir.
ENDCLASS.
CLASS ltcl_no_dependency_injection DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS:
no_injection FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_simple_dependency_inject DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS:
setup,
simple_injection FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_abapgit_tadir_mock IMPLEMENTATION.
METHOD zif_abapgit_tadir~get_object_package.
ENDMETHOD.
METHOD zif_abapgit_tadir~read.
ENDMETHOD.
METHOD zif_abapgit_tadir~read_single.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_no_dependency_injection IMPLEMENTATION.
METHOD no_injection.
DATA: li_tadir TYPE REF TO zif_abapgit_tadir,
lo_class_descr TYPE REF TO cl_abap_classdescr.
li_tadir = zcl_abapgit_factory=>get_tadir( ).
lo_class_descr ?= cl_abap_classdescr=>describe_by_object_ref( li_tadir ).
cl_abap_unit_assert=>assert_equals(
exp = '\CLASS=ZCL_ABAPGIT_TADIR'
act = lo_class_descr->absolute_name ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_simple_dependency_inject IMPLEMENTATION.
METHOD setup.
DATA: lo_tadir_mock TYPE REF TO ltcl_abapgit_tadir_mock.
CREATE OBJECT lo_tadir_mock.
zcl_abapgit_injector=>set_tadir( lo_tadir_mock ).
ENDMETHOD.
METHOD simple_injection.
DATA: li_tadir TYPE REF TO zif_abapgit_tadir,
lo_class_descr TYPE REF TO cl_abap_classdescr.
li_tadir = zcl_abapgit_factory=>get_tadir( ).
lo_class_descr ?= cl_abap_classdescr=>describe_by_object_ref( li_tadir ).
cl_abap_unit_assert=>assert_equals(
exp = '\CLASS-POOL=ZCL_ABAPGIT_INJECTOR\CLASS=LTCL_ABAPGIT_TADIR_MOCK'
act = lo_class_descr->absolute_name ).
ENDMETHOD.
ENDCLASS. | 22.217391 | 77 | 0.716732 | {
"alnum_ratio": 0.6642192854,
"alpha_token_ratio": 1.790237467,
"avg_line_length": 22.4505494505,
"char_rep_ratio": 0.1420845624,
"max_line_length": 77,
"num_words": 132,
"text_len": 2043,
"word_rep_ratio": 0.1788617886
} | 13,042,564,264,104,036,000 |
0822769d8b019a837b16435fca5a0550e55cc514 | 902 | abap | ABAP | src/repo/zif_abapgit_dot_abapgit.intf.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/repo/zif_abapgit_dot_abapgit.intf.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/repo/zif_abapgit_dot_abapgit.intf.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | INTERFACE zif_abapgit_dot_abapgit PUBLIC.
TYPES:
BEGIN OF ty_requirement,
component TYPE tdevc-dlvunit,
min_release TYPE saprelease,
min_patch TYPE sappatchlv,
END OF ty_requirement .
TYPES:
ty_requirement_tt TYPE STANDARD TABLE OF ty_requirement WITH DEFAULT KEY .
TYPES:
BEGIN OF ty_dot_abapgit,
master_language TYPE spras,
i18n_languages TYPE zif_abapgit_definitions=>ty_languages,
starting_folder TYPE string,
folder_logic TYPE string,
ignore TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
requirements TYPE ty_requirement_tt,
END OF ty_dot_abapgit .
CONSTANTS:
BEGIN OF c_folder_logic,
prefix TYPE string VALUE 'PREFIX',
full TYPE string VALUE 'FULL',
END OF c_folder_logic .
ENDINTERFACE. | 31.103448 | 82 | 0.646341 | {
"alnum_ratio": 0.6170921199,
"alpha_token_ratio": 2.0827067669,
"avg_line_length": 32.1785714286,
"char_rep_ratio": 0.168161435,
"max_line_length": 82,
"num_words": 78,
"text_len": 901,
"word_rep_ratio": 0
} | 12,119,524,896,609,092,000 |
0830015039778b5da25f695ab0641421ae61c563 | 9,945 | abap | ABAP | src/ui/zcl_abapgit_gui_page_addonline.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/ui/zcl_abapgit_gui_page_addonline.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/ui/zcl_abapgit_gui_page_addonline.clas.abap | gepparta/abapGit | 79da4eb38520facea52e1f5a1b2a189f208de4e9 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_gui_page_addonline DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_component
FINAL
CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler.
INTERFACES zif_abapgit_gui_renderable.
CLASS-METHODS create
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception.
METHODS constructor
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_id,
url TYPE string VALUE 'url',
package TYPE string VALUE 'package',
branch_name TYPE string VALUE 'branch_name',
display_name TYPE string VALUE 'display_name',
folder_logic TYPE string VALUE 'folder_logic',
ignore_subpackages TYPE string VALUE 'ignore_subpackages',
main_lang_only TYPE string VALUE 'main_lang_only',
END OF c_id.
CONSTANTS:
BEGIN OF c_event,
go_back TYPE string VALUE 'go-back',
choose_package TYPE string VALUE 'choose-package',
create_package TYPE string VALUE 'create-package',
choose_branch TYPE string VALUE 'choose-branch',
add_online_repo TYPE string VALUE 'add-repo-online',
END OF c_event.
DATA mo_form TYPE REF TO zcl_abapgit_html_form .
DATA mo_form_data TYPE REF TO zcl_abapgit_string_map .
DATA mo_form_util TYPE REF TO zcl_abapgit_html_form_utils.
DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map .
METHODS validate_form
IMPORTING
io_form_data TYPE REF TO zcl_abapgit_string_map
RETURNING
VALUE(ro_validation_log) TYPE REF TO zcl_abapgit_string_map
RAISING
zcx_abapgit_exception.
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form.
ENDCLASS.
CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
CREATE OBJECT mo_validation_log.
CREATE OBJECT mo_form_data.
mo_form = get_form_schema( ).
mo_form_util = zcl_abapgit_html_form_utils=>create( mo_form ).
ENDMETHOD.
METHOD create.
DATA lo_component TYPE REF TO zcl_abapgit_gui_page_addonline.
CREATE OBJECT lo_component.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'New Online Repository'
ii_child_component = lo_component ).
ENDMETHOD.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'add-repo-online-form'
iv_help_page = '' ).
ro_form->text(
iv_name = c_id-url
iv_required = abap_true
iv_condense = abap_true
iv_label = 'Git Repository URL'
iv_hint = 'HTTPS address of the repository'
iv_placeholder = ''
)->text(
iv_name = c_id-package
iv_side_action = c_event-choose_package
iv_required = abap_true
iv_upper_case = abap_true
iv_label = 'Package'
iv_hint = 'SAP package for repository (should be a dedicated one)'
iv_placeholder = 'Z... / $...'
)->text(
iv_name = c_id-branch_name
iv_side_action = c_event-choose_branch
iv_label = 'Branch'
iv_hint = 'Switch to a specific branch (default: autodetect)'
iv_placeholder = 'Autodetect default branch'
)->radio(
iv_name = c_id-folder_logic
iv_default_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
iv_label = 'Folder Logic'
iv_hint = 'Define how package folders are named in repository'
)->option(
iv_label = 'Prefix'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
)->option(
iv_label = 'Full'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-full
)->option(
iv_label = 'Mixed'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-mixed
)->text(
iv_name = c_id-display_name
iv_label = 'Display Name'
iv_hint = 'Name to show instead of original repository name (optional)'
)->checkbox(
iv_name = c_id-ignore_subpackages
iv_label = 'Ignore Subpackages'
iv_hint = 'Synchronize root package only'
)->checkbox(
iv_name = c_id-main_lang_only
iv_label = 'Serialize Main Language Only'
iv_hint = 'Ignore translations, serialize just main language'
)->command(
iv_label = 'Create Online Repo'
iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
iv_action = c_event-add_online_repo
)->command(
iv_label = 'Create Package'
iv_action = c_event-create_package
)->command(
iv_label = 'Back'
iv_action = c_event-go_back ).
ENDMETHOD.
METHOD validate_form.
DATA lx_err TYPE REF TO zcx_abapgit_exception.
ro_validation_log = mo_form_util->validate( io_form_data ).
IF io_form_data->get( c_id-url ) IS NOT INITIAL.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_url( io_form_data->get( c_id-url ) ).
CATCH zcx_abapgit_exception INTO lx_err.
ro_validation_log->set(
iv_key = c_id-url
iv_val = lx_err->get_text( ) ).
ENDTRY.
ENDIF.
IF io_form_data->get( c_id-package ) IS NOT INITIAL.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_package(
iv_package = |{ io_form_data->get( c_id-package ) }|
iv_ign_subpkg = |{ io_form_data->get( c_id-ignore_subpackages ) }| ).
CATCH zcx_abapgit_exception INTO lx_err.
ro_validation_log->set(
iv_key = c_id-package
iv_val = lx_err->get_text( ) ).
ENDTRY.
ENDIF.
IF io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix
AND io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-full
AND io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-mixed.
ro_validation_log->set(
iv_key = c_id-folder_logic
iv_val = |Invalid folder logic { io_form_data->get( c_id-folder_logic ) }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: ls_repo_params TYPE zif_abapgit_services_repo=>ty_repo_params,
lo_new_online_repo TYPE REF TO zcl_abapgit_repo_online.
mo_form_data = mo_form_util->normalize( ii_event->form_data( ) ).
CASE ii_event->mv_action.
WHEN c_event-go_back.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
WHEN c_event-create_package.
mo_form_data->set(
iv_key = c_id-package
iv_val = zcl_abapgit_services_basis=>create_package(
iv_prefill_package = |{ mo_form_data->get( c_id-package ) }| ) ).
IF mo_form_data->get( c_id-package ) IS NOT INITIAL.
mo_validation_log = validate_form( mo_form_data ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDIF.
WHEN c_event-choose_package.
mo_form_data->set(
iv_key = c_id-package
iv_val = zcl_abapgit_ui_factory=>get_popups( )->popup_search_help( 'TDEVC-DEVCLASS' ) ).
IF mo_form_data->get( c_id-package ) IS NOT INITIAL.
mo_validation_log = validate_form( mo_form_data ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDIF.
WHEN c_event-choose_branch.
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->has( c_id-url ) = abap_true.
mo_validation_log->set(
iv_key = c_id-branch_name
iv_val = 'Check URL issues' ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
RETURN.
ENDIF.
mo_form_data->set(
iv_key = c_id-branch_name
iv_val = zcl_abapgit_ui_factory=>get_popups( )->branch_list_popup( mo_form_data->get( c_id-url ) )-name ).
IF mo_form_data->get( c_id-branch_name ) IS INITIAL.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ELSE.
mo_form_data->set(
iv_key = c_id-branch_name
iv_val = replace( " strip technical
val = mo_form_data->get( c_id-branch_name )
sub = zif_abapgit_definitions=>c_git_branch-heads_prefix
with = '' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDIF.
WHEN c_event-add_online_repo.
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->is_empty( ) = abap_true.
mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ).
lo_new_online_repo = zcl_abapgit_services_repo=>new_online( ls_repo_params ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
EXPORTING
iv_key = lo_new_online_repo->get_key( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
gui_services( )->register_event_handler( me ).
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( mo_form->render(
io_values = mo_form_data
io_validation_log = mo_validation_log ) ).
ENDMETHOD.
ENDCLASS. | 34.293103 | 116 | 0.654399 | {
"alnum_ratio": 0.5957037187,
"alpha_token_ratio": 1.7465834819,
"avg_line_length": 34.1487889273,
"char_rep_ratio": 0.1352941176,
"max_line_length": 116,
"num_words": 614,
"text_len": 9869,
"word_rep_ratio": 0.0231404959
} | 4,795,104,471,449,308,000 |
084a5e94805cf6887f9f8407899a7290425afe17 | 425 | abap | ABAP | src/checks/zcl_aoc_check_69.clas.locals_imp.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 199 | 2015-02-17T07:08:01.000Z | 2022-03-23T09:50:05.000Z | src/checks/zcl_aoc_check_69.clas.locals_imp.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 769 | 2015-01-03T07:09:11.000Z | 2022-03-21T11:59:53.000Z | src/checks/zcl_aoc_check_69.clas.locals_imp.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 109 | 2015-03-09T10:22:34.000Z | 2022-03-08T08:47:41.000Z | CLASS lcl_stack IMPLEMENTATION.
METHOD push.
APPEND iv_string TO mt_data.
ENDMETHOD.
METHOD concatenate.
rv_string = concat_lines_of( mt_data ) && iv_string.
ENDMETHOD.
METHOD set.
clear( ).
push( iv_string ).
ENDMETHOD.
METHOD clear.
CLEAR mt_data.
ENDMETHOD.
METHOD pop.
IF lines( mt_data ) > 0.
DELETE mt_data INDEX lines( mt_data ).
ENDIF.
ENDMETHOD.
ENDCLASS. | 15.740741 | 56 | 0.661176 | {
"alnum_ratio": 0.6320754717,
"alpha_token_ratio": 1.7565789474,
"avg_line_length": 16.3076923077,
"char_rep_ratio": 0.1927710843,
"max_line_length": 56,
"num_words": 41,
"text_len": 424,
"word_rep_ratio": 0
} | 14,028,541,844,102,660,000 |
0852cf3b4cafd7ee0d0965a97c1a1689d0087b32 | 2,370 | abap | ABAP | src/checks/zcl_aoc_check_13.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 199 | 2015-02-17T07:08:01.000Z | 2022-03-23T09:50:05.000Z | src/checks/zcl_aoc_check_13.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 769 | 2015-01-03T07:09:11.000Z | 2022-03-21T11:59:53.000Z | src/checks/zcl_aoc_check_13.clas.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 109 | 2015-03-09T10:22:34.000Z | 2022-03-08T08:47:41.000Z | CLASS zcl_aoc_check_13 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS check
REDEFINITION .
METHODS get_attributes
REDEFINITION .
METHODS if_ci_test~query_attributes
REDEFINITION .
METHODS put_attributes
REDEFINITION .
PROTECTED SECTION.
DATA mv_lines TYPE linestotal .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_13 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
*
* MIT License
DATA: lt_code TYPE string_table,
lv_seq TYPE i,
lv_line TYPE token_row.
FIELD-SYMBOLS: <ls_level> LIKE LINE OF io_scan->levels,
<lv_code> LIKE LINE OF lt_code.
LOOP AT io_scan->levels ASSIGNING <ls_level> WHERE type = io_scan->gc_level-program.
lt_code = get_source( <ls_level> ).
LOOP AT lt_code ASSIGNING <lv_code>.
lv_line = sy-tabix.
IF strlen( <lv_code> ) = 0.
lv_seq = lv_seq + 1.
ELSE.
lv_seq = 0.
ENDIF.
IF lv_seq >= mv_lines.
inform( p_sub_obj_name = <ls_level>-name
p_line = lv_line
p_kind = mv_errty
p_test = myname
p_code = '001' ).
* only report one error per include
EXIT. " current loop
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '013'.
has_attributes = abap_true.
attributes_ok = abap_true.
mv_lines = 4.
enable_rfc( ).
insert_scimessage(
iv_code = '001'
iv_text = 'Sequential blank lines'(m01) ).
ENDMETHOD.
METHOD get_attributes.
EXPORT mv_errty = mv_errty mv_maxlength = mv_lines TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_fill_att mv_lines 'Lines' ''. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
mv_maxlength = mv_lines
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
ENDCLASS. | 19.75 | 88 | 0.603376 | {
"alnum_ratio": 0.5637612709,
"alpha_token_ratio": 1.6538461538,
"avg_line_length": 19.5714285714,
"char_rep_ratio": 0.1215517241,
"max_line_length": 88,
"num_words": 178,
"text_len": 2329,
"word_rep_ratio": 0
} | 2,869,114,584,371,828,700 |
08577d2efa2ba9ea666153ff1ca458af91528d6f | 20,225 | abap | ABAP | src/objects/zcl_abapgit_object_fdt0.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"MIT"
] | 317 | 2020-09-25T19:50:59.000Z | 2022-03-29T22:59:01.000Z | src/objects/zcl_abapgit_object_fdt0.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"MIT"
] | 1,114 | 2020-09-24T07:44:36.000Z | 2022-03-31T18:01:19.000Z | src/objects/zcl_abapgit_object_fdt0.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_object_fdt0 DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS check_is_local
RETURNING
VALUE(rv_is_local) TYPE abap_bool .
METHODS get_application_id
RETURNING
VALUE(rv_application_id) TYPE fdt_admn_0000s-application_id .
METHODS before_xml_deserialize
IMPORTING
!iv_package TYPE devclass
EXPORTING
!ev_create TYPE abap_bool
!ev_is_local TYPE abap_bool
CHANGING
!co_dom_tree TYPE REF TO if_ixml_document
RAISING
zcx_abapgit_exception .
METHODS filter_xml_serialize
CHANGING
!co_ixml_element TYPE REF TO if_ixml_element
RAISING
zcx_abapgit_exception .
METHODS set_field
IMPORTING
!iv_name TYPE string
!iv_value TYPE string DEFAULT ''
CHANGING
!co_ixml_element TYPE REF TO if_ixml_element
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_object_fdt0 IMPLEMENTATION.
METHOD before_xml_deserialize.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lv_timestamp TYPE timestamp.
DATA lv_transport TYPE string.
DATA lv_dlvunit TYPE tdevc-dlvunit.
DATA lo_node_local TYPE REF TO if_ixml_element.
DATA lo_node_package TYPE REF TO if_ixml_element.
DATA lo_node_id TYPE REF TO if_ixml_element.
DATA lo_xml_element TYPE REF TO if_ixml_element.
DATA lv_count TYPE i.
lo_node_local = co_dom_tree->find_from_name( name = 'Local'
namespace = 'FDTNS' ).
IF lo_node_local IS BOUND.
ev_is_local = lo_node_local->get_value( ).
ENDIF.
lo_node_package = co_dom_tree->find_from_name(
name = 'DevelopmentPackage'
namespace = 'FDTNS' ).
IF lo_node_package IS BOUND.
lo_node_package->set_value( value = |{ iv_package }| ).
ENDIF.
lo_node_id = co_dom_tree->find_from_name(
name = 'ApplicationId'
namespace = 'FDTNS' ).
IF lo_node_id IS BOUND.
lv_application_id = lo_node_id->get_value( ).
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
WHERE object_type = 'AP'
AND id = lv_application_id
AND deleted = ''.
ev_create = boolc( lv_count = 0 ).
ENDIF.
" Fill in user/time/system-specific fields
GET TIME STAMP FIELD lv_timestamp.
lv_transport = |${ sy-sysid }0000000000000001|.
lo_xml_element = co_dom_tree->get_root_element( ).
IF ev_create = abap_true.
set_field(
EXPORTING
iv_name = 'CreationUser'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'CreationTimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
ENDIF.
set_field(
EXPORTING
iv_name = 'ChangeUser'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'ChangeTimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'User'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Timestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trrequest'
iv_value = lv_transport
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trversion'
iv_value = '000001'
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trtimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trsysid'
iv_value = |{ sy-sysid }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trclient'
iv_value = |{ sy-mandt }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'OversId'
iv_value = |{ lv_application_id }|
CHANGING
co_ixml_element = lo_xml_element ).
SELECT SINGLE dlvunit FROM tdevc INTO lv_dlvunit WHERE devclass = iv_package.
IF sy-subrc = 0.
set_field(
EXPORTING
iv_name = 'SoftwareComponent'
iv_value = |{ lv_dlvunit }|
CHANGING
co_ixml_element = lo_xml_element ).
ENDIF.
lo_xml_element->set_attribute(
name = 'Client'
value = |{ sy-mandt }| ).
lo_xml_element->set_attribute(
name = 'Date'
value = |{ sy-datum }| ).
lo_xml_element->set_attribute(
name = 'SAPRelease'
value = |{ sy-saprl }| ).
lo_xml_element->set_attribute(
name = 'Server'
value = |{ sy-host }| ).
lo_xml_element->set_attribute(
name = 'SourceExportReqID'
value = lv_transport ).
lo_xml_element->set_attribute(
name = 'SystemID'
value = |{ sy-sysid }| ).
lo_xml_element->set_attribute(
name = 'Time'
value = |{ sy-uzeit }| ).
lo_xml_element->set_attribute(
name = 'User'
value = |{ sy-uname }| ).
ENDMETHOD.
METHOD check_is_local.
SELECT SINGLE local_object FROM fdt_admn_0000s INTO rv_is_local
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ENDMETHOD.
METHOD filter_xml_serialize.
DATA lo_components_node TYPE REF TO if_ixml_element.
lo_components_node = co_ixml_element->find_from_name( name = 'ComponentReleases'
namespace = 'FDTNS' ).
IF lo_components_node IS BOUND.
co_ixml_element->remove_child( old_child = lo_components_node ).
ENDIF.
" Clear user/time/system-specific fields
set_field(
EXPORTING
iv_name = 'CreationUser'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'CreationTimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'ChangeUser'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'ChangeTimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'User'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Timestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trrequest'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trversion'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trtimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trsysid'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trclient'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'OversId'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'SoftwareComponent'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'DevelopmentPackage'
CHANGING
co_ixml_element = co_ixml_element ).
" Clear attributes of root node
co_ixml_element->set_attribute(
name = 'Client'
value = '' ).
co_ixml_element->set_attribute(
name = 'Date'
value = '' ).
co_ixml_element->set_attribute(
name = 'SAPRelease'
value = '' ).
co_ixml_element->set_attribute(
name = 'Server'
value = '' ).
co_ixml_element->set_attribute(
name = 'SourceExportReqID'
value = '' ).
co_ixml_element->set_attribute(
name = 'SystemID'
value = '' ).
co_ixml_element->set_attribute(
name = 'Time'
value = '' ).
co_ixml_element->set_attribute(
name = 'User'
value = '' ).
ENDMETHOD.
METHOD get_application_id.
SELECT SINGLE application_id FROM fdt_admn_0000s INTO rv_application_id
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ENDMETHOD.
METHOD set_field.
DATA:
lo_node_collection TYPE REF TO if_ixml_node_collection,
lo_node TYPE REF TO if_ixml_node,
lv_index TYPE i.
lo_node_collection = co_ixml_element->get_elements_by_tag_name(
namespace = 'FDTNS'
name = iv_name ).
lv_index = 0.
WHILE lv_index < lo_node_collection->get_length( ).
lo_node = lo_node_collection->get_item( lv_index ).
lo_node->set_value( iv_value ).
lv_index = lv_index + 1.
ENDWHILE.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA lv_ch_user TYPE fdt_admn_0000s-ch_user.
SELECT SINGLE ch_user FROM fdt_admn_0000s INTO lv_ch_user
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
rv_user = lv_ch_user.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA lv_is_local TYPE abap_bool.
DATA lt_application_id TYPE TABLE OF fdt_admn_0000s-application_id.
DATA ls_object_category_sel TYPE if_fdt_query=>s_object_category_sel.
DATA lv_failure TYPE abap_bool.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
lv_is_local = check_is_local( ).
SELECT application_id FROM fdt_admn_0000s INTO TABLE lt_application_id
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ls_object_category_sel-system_objects = 'X'.
TRY.
IF lv_is_local = abap_true.
cl_fdt_delete_handling=>mark_for_delete_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
iv_obj_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_logical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
iv_obj_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_physical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
ENDIF.
ENDIF.
ELSE.
cl_fdt_delete_handling=>mark_for_delete_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
iv_obj_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_logical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
iv_obj_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_physical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
ENDIF.
ENDIF.
ENDIF.
IF lv_failure = abap_true.
zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lo_dom_tree TYPE REF TO if_ixml_document.
DATA lv_is_local TYPE abap_bool.
DATA lt_message TYPE if_fdt_types=>t_message.
DATA lv_create TYPE abap_bool.
FIELD-SYMBOLS <ls_message> TYPE if_fdt_types=>s_message.
lo_dom_tree = io_xml->get_raw( ).
before_xml_deserialize(
EXPORTING
iv_package = iv_package
IMPORTING
ev_create = lv_create
ev_is_local = lv_is_local
CHANGING
co_dom_tree = lo_dom_tree ).
lo_dexc = cl_fdt_factory=>if_fdt_factory~get_instance( )->get_data_exchange( ).
TRY.
IF lv_is_local = abap_true. "Local Object
lo_dexc->import_xml(
EXPORTING
io_dom_tree = lo_dom_tree
iv_create = lv_create
iv_activate = abap_true
iv_simulate = abap_false
IMPORTING
et_message = lt_message ).
ELSE. "Transportable Object
lo_dexc->import_xml(
EXPORTING
io_dom_tree = lo_dom_tree
iv_create = lv_create
iv_activate = abap_true
iv_simulate = abap_false
iv_workbench_trrequest = iv_transport
IMPORTING
et_message = lt_message ).
ENDIF.
LOOP AT lt_message ASSIGNING <ls_message>.
ii_log->add(
iv_msg = <ls_message>-text
iv_type = <ls_message>-msgty ).
ENDLOOP.
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA lv_count TYPE i.
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
WHERE object_type = 'AP'
AND name = ms_item-obj_name
AND deleted = ''.
rv_bool = boolc( lv_count > 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA lo_local_version_output TYPE REF TO zcl_abapgit_xml_output.
DATA lo_local_version_input TYPE REF TO zcl_abapgit_xml_input.
CREATE OBJECT lo_local_version_output.
zif_abapgit_object~serialize( lo_local_version_output ).
CREATE OBJECT lo_local_version_input
EXPORTING
iv_xml = lo_local_version_output->zif_abapgit_xml_output~render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
ii_local = lo_local_version_input.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lo_instance TYPE REF TO if_fdt_admin_data.
DATA lt_version TYPE if_fdt_admin_data=>ts_version.
DATA lv_index TYPE sy-tabix.
FIELD-SYMBOLS <ls_version> LIKE LINE OF lt_version.
lv_application_id = get_application_id( ).
TRY.
cl_fdt_factory=>get_instance_generic(
EXPORTING
iv_id = lv_application_id
IMPORTING
eo_instance = lo_instance ).
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
lo_instance->get_versions( IMPORTING ets_version = lt_version ).
lv_index = lines( lt_version ).
READ TABLE lt_version ASSIGNING <ls_version> INDEX lv_index.
rv_active = boolc( <ls_version>-state = 'A' ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA lv_application_id TYPE string.
lv_application_id = get_application_id( ).
rv_is_locked = exists_a_lock_entry_for(
iv_lock_object = 'FDT_ENQUEUE_ID'
iv_argument = |$ST{ lv_application_id }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_root TYPE REF TO cx_root.
DATA lo_fdt_wd TYPE REF TO if_fdt_wd_factory.
lv_application_id = get_application_id( ).
IF lv_application_id IS NOT INITIAL.
TRY.
lo_fdt_wd = cl_fdt_wd_factory=>if_fdt_wd_factory~get_instance( ).
lo_fdt_wd->get_ui_execution( )->execute_workbench( iv_id = lv_application_id ).
CATCH cx_root INTO lx_root.
zcx_abapgit_exception=>raise_with_text( lx_root ).
ENDTRY.
ELSE.
zcx_abapgit_exception=>raise( 'Could not open BRF+ Workbench' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lv_xml_fdt0_application TYPE string.
DATA lo_xml_document TYPE REF TO if_ixml_document.
DATA lo_xml_element TYPE REF TO if_ixml_element.
lv_application_id = get_application_id( ).
lo_dexc = cl_fdt_factory=>if_fdt_factory~get_instance( )->get_data_exchange( ).
TRY.
lo_dexc->export_xml_application(
EXPORTING
iv_application_id = lv_application_id
iv_schema = if_fdt_data_exchange=>gc_xml_schema_type_external
iv_xml_version = if_fdt_data_exchange=>gc_xml_version
IMPORTING
ev_string = lv_xml_fdt0_application ).
lo_xml_document = cl_ixml_80_20=>parse_to_document( stream_string = lv_xml_fdt0_application ).
lo_xml_element = lo_xml_document->get_root_element( ).
filter_xml_serialize( CHANGING co_ixml_element = lo_xml_element ).
io_xml->set_raw( lo_xml_element ).
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
ENDCLASS. | 28.485915 | 102 | 0.613053 | {
"alnum_ratio": 0.558446698,
"alpha_token_ratio": 1.7000152045,
"avg_line_length": 28.5119887165,
"char_rep_ratio": 0.2066217955,
"max_line_length": 102,
"num_words": 1181,
"text_len": 20215,
"word_rep_ratio": 0.0836177474
} | 4,653,427,762,278,923,000 |
08de55b00bac1f2881477868b64fd8bf30191677 | 2,128 | abap | ABAP | src/apack/zcl_abapgit_apack_reader.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/apack/zcl_abapgit_apack_reader.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/apack/zcl_abapgit_apack_reader.clas.testclasses.abap | amit3kumar/ABAP_ALL | 67822ae13ffda6597a91bb5b39e428c39bc445a3 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | *"* use this source file for your ABAP unit test classes
CLASS ltcl_apack_manifest_reader DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
METHODS:
setup RAISING cx_static_check,
manifest_descriptor FOR TESTING RAISING cx_static_check,
verify_own_descriptor IMPORTING is_manifest_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor.
DATA: mo_manifest_reader TYPE REF TO zcl_abapgit_apack_reader.
ENDCLASS.
CLASS ltcl_apack_manifest_reader IMPLEMENTATION.
METHOD manifest_descriptor.
verify_own_descriptor( mo_manifest_reader->get_manifest_descriptor( ) ).
ENDMETHOD.
METHOD setup.
DATA: ls_apack_manifest_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor.
ls_apack_manifest_descriptor-group_id = ''.
ls_apack_manifest_descriptor-artifact_id = 'abapGit'.
ls_apack_manifest_descriptor-version = '1.42'.
ls_apack_manifest_descriptor-git_url = ''.
mo_manifest_reader = zcl_abapgit_apack_reader=>create_instance( '$TMP' ).
mo_manifest_reader->set_manifest_descriptor( ls_apack_manifest_descriptor ).
ENDMETHOD.
METHOD verify_own_descriptor.
cl_abap_unit_assert=>assert_not_initial( is_manifest_descriptor ).
cl_abap_unit_assert=>assert_equals( exp = ''
act = is_manifest_descriptor-group_id ).
cl_abap_unit_assert=>assert_equals( exp = 'abapGit'
act = is_manifest_descriptor-artifact_id ).
cl_abap_unit_assert=>assert_equals( exp = '1.42'
act = is_manifest_descriptor-version ).
" Repository type is added automatically by serializer later
cl_abap_unit_assert=>assert_initial( is_manifest_descriptor-repository_type ).
cl_abap_unit_assert=>assert_equals( exp = ''
act = is_manifest_descriptor-git_url ).
cl_abap_unit_assert=>assert_initial( is_manifest_descriptor-dependencies ).
ENDMETHOD.
ENDCLASS. | 45.276596 | 111 | 0.740132 | {
"alnum_ratio": 0.6779156328,
"alpha_token_ratio": 2.2591362126,
"avg_line_length": 43.8043478261,
"char_rep_ratio": 0.239780658,
"max_line_length": 111,
"num_words": 103,
"text_len": 2015,
"word_rep_ratio": 0
} | 757,304,700,187,930,600 |
A refined version of Github Code dataset in RedPajama & TheStack by Data-Juicer. Removing some "bad" samples from the original dataset to make it higher-quality.
This dataset is usually used to pretrain a Large Language Model.
Notice: Here is a small subset for previewing. The whole dataset is available here (About 232GB).
# global parameters
project_name: 'Data-Juicer-recipes-code-rp'
dataset_path: '/path/to/your/dataset' # path to your dataset directory or file
export_path: '/path/to/your/dataset.jsonl'
np: 50 # number of subprocess to process your dataset
open_tracer: true
# process schedule
# a list of several process operators with their arguments
process:
- clean_email_mapper:
- clean_links_mapper:
- fix_unicode_mapper:
- punctuation_normalization_mapper:
- whitespace_normalization_mapper:
- clean_copyright_mapper:
- alphanumeric_filter:
tokenization: False
min_ratio: 0.4
max_ratio: 0.8
- alphanumeric_filter:
tokenization: True
min_ratio: 1.5
max_ratio: 3
- average_line_length_filter:
min_len: 15
max_len: 100
- character_repetition_filter:
rep_len: 10
min_ratio: 0.05
max_ratio: 0.3
- maximum_line_length_filter:
min_len: 50
max_len: 500
- text_length_filter:
min_len: 300
- words_num_filter:
lang: en
tokenization: False
min_num: 30
max_num: 5000
- word_repetition_filter:
lang: en
tokenization: False
rep_len: 10
max_ratio: 0.1
- document_simhash_deduplicator:
tokenization: space
window_size: 6
lowercase: true
ignore_pattern: '\p{P}'
num_blocks: 6
hamming_distance: 4
# global parameters
project_name: 'Data-Juicer-recipes-the-stack'
dataset_path: '/path/to/your/dataset' # path to your dataset directory or file
export_path: '/path/to/your/dataset.jsonl'
text_key: 'content'
np: 50 # number of subprocess to process your dataset
open_tracer: true
# process schedule
# a list of several process operators with their arguments
process:
- clean_email_mapper:
- clean_links_mapper:
- fix_unicode_mapper:
- punctuation_normalization_mapper:
- whitespace_normalization_mapper:
- clean_copyright_mapper:
- alphanumeric_filter: # 18766
tokenization: false
min_ratio: 0.2 # < 3sigma (0.3791)
max_ratio: 0.9163 # 3sigma
- alphanumeric_filter: # 146432
tokenization: true
min_ratio: 0.546 # 3sigma
max_ratio: 3.65 # 3sigma
- average_line_length_filter: # for code
min_len: 10 # > 3sigma (0) -- 48790
max_len: 150 # < 3sigma (15603) -- 233275
- character_repetition_filter:
max_ratio: 0.36 # 3sigma -- 346875
- maximum_line_length_filter: # for code
max_len: 1000 # remove 256670 samples
- text_length_filter:
max_len: 96714 # 3sigma -- 190006
- words_num_filter:
min_num: 20 # remove 1504958 samples
max_num: 6640 # 3sigma -- remove 179847 samples
- word_repetition_filter:
rep_len: 10
max_ratio: 0.357 # 3sigma -- 598462
- document_simhash_deduplicator:
tokenization: space
window_size: 6
lowercase: true
ignore_pattern: '\p{P}'
num_blocks: 6
hamming_distance: 4
project_name: 'Data-Juicer-recipes-code'
dataset_path: '/path/to/your/dataset' # path to your dataset directory or file
export_path: '/path/to/your/dataset.jsonl' # path to your dataset result file
np: 50 # number of subprocess to process your dataset
open_tracer: true
# process schedule
# a list of several process operators with their arguments
process:
- document_simhash_deduplicator:
tokenization: space
window_size: 6
lowercase: true
ignore_pattern: '\p{P}'
num_blocks: 6
hamming_distance: 4