` ).
254 | ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top(
255 | io_repo = mo_repo
256 | iv_show_commit = abap_false
257 | iv_interactive_branch = abap_false ) ).
258 | ri_html->add( `
` ).
259 |
260 | ri_html->add( _render_issues( ) ).
261 |
262 | ri_html->add( _render_footer( ) ).
263 |
264 | ENDMETHOD.
265 |
266 |
267 | METHOD _get_issues.
268 |
269 | DATA:
270 | lo_annotations TYPE REF TO zcl_abaplint_abapgit_ext_annot,
271 | ls_annotation TYPE zcl_abaplint_abapgit_ext_annot=>ty_annotation,
272 | lt_annotations TYPE zcl_abaplint_abapgit_ext_annot=>ty_annotations,
273 | lo_issue TYPE REF TO zcl_abaplint_abapgit_ext_issue,
274 | ls_issue TYPE zcl_abaplint_abapgit_ext_issue=>ty_issue.
275 |
276 | CREATE OBJECT lo_annotations
277 | EXPORTING
278 | iv_url = mo_repo->get_url( )
279 | iv_check_run = mv_check_run.
280 |
281 | lt_annotations = lo_annotations->get( ).
282 |
283 | LOOP AT lt_annotations INTO ls_annotation.
284 |
285 | CREATE OBJECT lo_issue
286 | EXPORTING
287 | is_annotation = ls_annotation.
288 |
289 | ls_issue = lo_issue->get( ).
290 |
291 | INSERT ls_issue INTO TABLE rt_issues.
292 |
293 | ENDLOOP.
294 |
295 | SORT rt_issues BY obj_type obj_name obj_subtype line url title.
296 |
297 | ENDMETHOD.
298 |
299 |
300 | METHOD _render_footer.
301 |
302 | DATA lv_url TYPE string.
303 |
304 | lv_url = zcl_abaplint_abapgit_ext_exit=>get_instance( )->get_last_url( ).
305 |
306 | CREATE OBJECT ri_html TYPE zcl_abapgit_html.
307 |
308 | IF lines( mt_issues ) = 0.
309 |
310 | ri_html->add( '' ).
311 | ri_html->add( ri_html->icon( 'check' ) ).
312 | ri_html->add( 'No abaplint findings' ).
313 | ri_html->add( '
' ).
314 |
315 | ELSEIF lines( mt_issues ) < mv_count_total.
316 |
317 | ri_html->add( '' ).
318 | ri_html->add( ri_html->icon( 'exclamation-triangle' ) ).
319 | ri_html->add( |First { lines( mt_issues ) } of { mv_count_total } findings shown in list. | ).
320 | ri_html->add_a(
321 | iv_txt = 'Show more...'
322 | iv_act = |{ zif_abapgit_definitions=>c_action-url }?url={ lv_url }| ).
323 | ri_html->add( '
' ).
324 |
325 | ENDIF.
326 |
327 | ENDMETHOD.
328 |
329 |
330 | METHOD _render_issue.
331 |
332 | DATA:
333 | ls_mtdkey TYPE seocpdkey,
334 | lv_class TYPE string,
335 | lv_icon TYPE string,
336 | lv_jump_type TYPE tadir-object,
337 | lv_jump_name TYPE tadir-obj_name,
338 | lv_obj_text TYPE string,
339 | lv_obj_link TYPE string,
340 | lv_msg_text TYPE string,
341 | lv_msg_link TYPE string,
342 | lv_msg_code TYPE string,
343 | lv_rest TYPE string.
344 |
345 | CREATE OBJECT ri_html TYPE zcl_abapgit_html.
346 |
347 | CASE is_issue-level.
348 | WHEN 'failure'.
349 | lv_class = 'ci-error'.
350 | lv_icon = ri_html->icon(
351 | iv_name = 'exclamation-circle/red'
352 | iv_hint = 'Failure' ).
353 | WHEN 'warning'.
354 | lv_class = 'ci-warning'.
355 | lv_icon = ri_html->icon(
356 | iv_name = 'exclamation-triangle/yellow'
357 | iv_hint = 'Warning' ).
358 | WHEN OTHERS.
359 | lv_class = 'ci-info'.
360 | ENDCASE.
361 |
362 | " Default jump is to source
363 | lv_jump_type = 'PROG'.
364 | lv_jump_name = is_issue-program.
365 |
366 | CASE is_issue-obj_type.
367 | WHEN 'CLAS'.
368 | CASE to_lower( is_issue-obj_subtype ).
369 | WHEN zif_abapgit_oo_object_fnc=>c_parts-locals_def.
370 | lv_obj_text = |CLAS { is_issue-obj_name } : Local Definitions|.
371 | WHEN zif_abapgit_oo_object_fnc=>c_parts-locals_imp.
372 | lv_obj_text = |CLAS { is_issue-obj_name } : Local Implementations|.
373 | WHEN zif_abapgit_oo_object_fnc=>c_parts-macros.
374 | lv_obj_text = |CLAS { is_issue-obj_name } : Macros|.
375 | WHEN zif_abapgit_oo_object_fnc=>c_parts-testclasses.
376 | lv_obj_text = |CLAS { is_issue-obj_name } : Test Classes|.
377 | WHEN OTHERS.
378 | cl_oo_classname_service=>get_method_by_include(
379 | EXPORTING
380 | incname = is_issue-program
381 | RECEIVING
382 | mtdkey = ls_mtdkey
383 | EXCEPTIONS
384 | class_not_existing = 1
385 | method_not_existing = 2
386 | OTHERS = 3 ).
387 | IF sy-subrc = 0.
388 | lv_obj_text = |CLAS { is_issue-obj_name }->{ ls_mtdkey-cpdname }|.
389 | ELSE.
390 | lv_obj_text = |CLAS { is_issue-obj_name }|.
391 | ENDIF.
392 | ENDCASE.
393 | WHEN 'FUGR'.
394 | lv_obj_text = |FUGR { is_issue-obj_name } { is_issue-obj_subtype }|.
395 | WHEN OTHERS.
396 | lv_obj_text = |{ is_issue-obj_type } { is_issue-obj_name }|.
397 | lv_jump_type = is_issue-obj_type.
398 | lv_jump_name = is_issue-obj_name.
399 | ENDCASE.
400 |
401 | lv_msg_text = escape(
402 | val = is_issue-title
403 | format = cl_abap_format=>e_html_text ).
404 |
405 | lv_msg_code = reverse( is_issue-url ).
406 | SPLIT lv_msg_code AT '/' INTO lv_msg_code lv_rest.
407 | lv_msg_code = reverse( lv_msg_code ).
408 |
409 | lv_msg_link = ri_html->a(
410 | iv_txt = lv_msg_code
411 | iv_act = |{ zif_abapgit_definitions=>c_action-url }?url={ is_issue-url }|
412 | iv_class = 'url' ).
413 |
414 | lv_obj_text = |{ lv_obj_text } [ @{ is_issue-line } ]|.
415 | lv_obj_link = |{ c_action-jump_edit }?type={ lv_jump_type }&name={ lv_jump_name }&line={ is_issue-line }|.
416 |
417 | ri_html->add( |' ).
476 | ri_html->add( '
' ).
477 | ri_html->add( '' ).
478 | ri_html->add( '' ).
479 | ri_html->add( ' | ' ).
480 | ri_html->add( ' | ' ).
481 | ri_html->add( '
' ).
482 | ri_html->add( '' ).
483 |
484 | LOOP AT is_issue-source INTO lv_source FROM is_issue-line - c_lines_before TO is_issue-line + c_lines_after.
485 | lv_line = sy-tabix.
486 | lv_source = lo_highlighter->process_line( lv_source ).
487 | ri_html->add( '' ).
488 | IF lv_line = is_issue-line.
489 | CASE is_issue-level.
490 | WHEN 'failure'.
491 | lv_class = 'diff_del'. "red
492 | WHEN 'warning'.
493 | lv_class = 'diff_upd'. "yellow
494 | WHEN OTHERS.
495 | lv_class = 'diff_ins'. "green
496 | ENDCASE.
497 | ELSE.
498 | lv_class = 'diff_others'.
499 | ENDIF.
500 | ri_html->add( || { lv_line } | { lv_source } | | ).
501 | ri_html->add( '
' ).
502 | ENDLOOP.
503 | IF sy-subrc <> 0.
504 | ri_html->add( '' ).
505 | ri_html->add( '| 0 | ' ).
506 | ri_html->add( 'Source location does not exist (anymore) | ' ).
507 | ri_html->add( '
' ).
508 | ENDIF.
509 |
510 | ri_html->add( '
' ).
511 | ri_html->add( '
' ).
512 |
513 | ENDMETHOD.
514 | ENDCLASS.
515 |
--------------------------------------------------------------------------------
/abaplint.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": [
3 | {
4 | "files": "/src/**/*.*",
5 | "folder": "/deps",
6 | "url": "https://github.com/abaplint/deps"
7 | },
8 | {
9 | "files": "/src/**/*.*",
10 | "folder": "/deps2",
11 | "url": "https://github.com/abapGit/abapGit"
12 | }
13 | ],
14 | "global": {
15 | "exclude": [],
16 | "files": "/src/**/*.*",
17 | "noIssues": [],
18 | "skipGeneratedBOPFInterfaces": false,
19 | "skipGeneratedFunctionGroups": false,
20 | "skipGeneratedGatewayClasses": false,
21 | "skipGeneratedPersistentClasses": false,
22 | "skipGeneratedProxyClasses": false,
23 | "skipGeneratedProxyInterfaces": false,
24 | "skipIncludesWithoutMain": false,
25 | "useApackDependencies": false
26 | },
27 | "rules": {
28 | "7bit_ascii": {
29 | "exclude": [],
30 | "severity": "Error"
31 | },
32 | "abapdoc": {
33 | "checkLocal": false,
34 | "classDefinition": false,
35 | "exclude": [".*"],
36 | "interfaceDefinition": false,
37 | "severity": "Error"
38 | },
39 | "allowed_object_naming": {
40 | "exclude": [],
41 | "severity": "Error"
42 | },
43 | "allowed_object_types": {
44 | "allowed": [
45 | "CLAS",
46 | "DEVC",
47 | "INTF",
48 | "W3MI"
49 | ],
50 | "exclude": [],
51 | "severity": "Error"
52 | },
53 | "ambiguous_statement": {
54 | "exclude": [],
55 | "severity": "Error"
56 | },
57 | "avoid_use": {
58 | "break": true,
59 | "defaultKey": true,
60 | "define": true,
61 | "describeLines": true,
62 | "exclude": [],
63 | "severity": "Error",
64 | "skipQuickFix": false,
65 | "statics": true,
66 | "testSeams": true
67 | },
68 | "begin_end_names": {
69 | "exclude": [],
70 | "severity": "Error"
71 | },
72 | "begin_single_include": {
73 | "exclude": [],
74 | "severity": "Error"
75 | },
76 | "call_transaction_authority_check": {
77 | "exclude": [],
78 | "severity": "Error"
79 | },
80 | "chain_mainly_declarations": {
81 | "check": true,
82 | "clear": true,
83 | "definitions": true,
84 | "exclude": [],
85 | "free": true,
86 | "hide": true,
87 | "include": true,
88 | "move": true,
89 | "refresh": true,
90 | "severity": "Error",
91 | "sort": true,
92 | "unassign": true,
93 | "write": true
94 | },
95 | "check_abstract": {
96 | "exclude": [],
97 | "severity": "Error"
98 | },
99 | "check_comments": {
100 | "allowEndOfLine": true,
101 | "exclude": [],
102 | "severity": "Error"
103 | },
104 | "check_ddic": {
105 | "exclude": [],
106 | "severity": "Error"
107 | },
108 | "check_include": {
109 | "exclude": [],
110 | "severity": "Error"
111 | },
112 | "check_subrc": {
113 | "assign": true,
114 | "authorityCheck": true,
115 | "exclude": [],
116 | "find": true,
117 | "insertDatabase": true,
118 | "modifyDatabase": true,
119 | "openDataset": true,
120 | "readTable": true,
121 | "selectSingle": true,
122 | "selectTable": true,
123 | "severity": "Error",
124 | "updateDatabase": true
125 | },
126 | "check_syntax": {
127 | "exclude": [],
128 | "severity": "Error"
129 | },
130 | "check_text_elements": {
131 | "exclude": [],
132 | "severity": "Error"
133 | },
134 | "check_transformation_exists": {
135 | "exclude": [],
136 | "severity": "Error"
137 | },
138 | "class_attribute_names": {
139 | "constants": "^C_.+$",
140 | "exclude": [],
141 | "ignoreExceptions": true,
142 | "ignoreInterfaces": false,
143 | "ignoreLocal": true,
144 | "ignoreNames": [],
145 | "ignorePatterns": [],
146 | "instance": "^M._.+$",
147 | "patternKind": "required",
148 | "severity": "Error",
149 | "statics": "^G._.+$"
150 | },
151 | "cloud_types": {
152 | "exclude": [],
153 | "severity": "Error"
154 | },
155 | "colon_missing_space": {
156 | "exclude": [],
157 | "severity": "Error"
158 | },
159 | "commented_code": {
160 | "allowIncludeInFugr": true,
161 | "exclude": [],
162 | "severity": "Warning"
163 | },
164 | "constructor_visibility_public": {
165 | "exclude": [],
166 | "severity": "Error"
167 | },
168 | "contains_tab": {
169 | "exclude": [],
170 | "severity": "Error",
171 | "spaces": 1
172 | },
173 | "cyclic_oo": {
174 | "exclude": [],
175 | "severity": "Error",
176 | "skip": [],
177 | "skipTestclasses": true,
178 | "skipSharedMemory": true
179 | },
180 | "cyclomatic_complexity": {
181 | "exclude": [],
182 | "max": 20,
183 | "severity": "Error"
184 | },
185 | "dangerous_statement": {
186 | "deleteDynpro": true,
187 | "deleteReport": true,
188 | "deleteTextpool": true,
189 | "dynamicSQL": true,
190 | "exclude": [],
191 | "execSQL": true,
192 | "exportDynpro": true,
193 | "generateDynpro": true,
194 | "generateReport": true,
195 | "generateSubroutine": true,
196 | "insertReport": true,
197 | "kernelCall": true,
198 | "severity": "Error",
199 | "systemCall": true
200 | },
201 | "db_operation_in_loop": {
202 | "exclude": [],
203 | "severity": "Error"
204 | },
205 | "definitions_top": {
206 | "exclude": [],
207 | "severity": "Error"
208 | },
209 | "description_empty": {
210 | "exclude": [],
211 | "severity": "Error"
212 | },
213 | "double_space": {
214 | "afterColon": true,
215 | "endParen": true,
216 | "exclude": [],
217 | "keywords": true,
218 | "severity": "Error",
219 | "startParen": true
220 | },
221 | "downport": {
222 | "exclude": [],
223 | "severity": "Error"
224 | },
225 | "empty_line_in_statement": {
226 | "allowChained": false,
227 | "exclude": [],
228 | "severity": "Error"
229 | },
230 | "empty_statement": {
231 | "exclude": [],
232 | "severity": "Error"
233 | },
234 | "empty_structure": {
235 | "at": true,
236 | "case": true,
237 | "do": true,
238 | "exclude": [],
239 | "if": true,
240 | "loop": true,
241 | "select": true,
242 | "severity": "Error",
243 | "try": true,
244 | "when": true,
245 | "while": true
246 | },
247 | "exit_or_check": {
248 | "allowCheck": false,
249 | "allowExit": false,
250 | "exclude": [],
251 | "severity": "Error"
252 | },
253 | "exporting": {
254 | "exclude": [],
255 | "severity": "Error"
256 | },
257 | "forbidden_identifier": {
258 | "check": [],
259 | "exclude": [],
260 | "severity": "Error"
261 | },
262 | "forbidden_pseudo_and_pragma": {
263 | "exclude": [],
264 | "ignoreGlobalClassDefinition": false,
265 | "ignoreGlobalInterface": false,
266 | "pragmas": [],
267 | "pseudo": [],
268 | "severity": "Error"
269 | },
270 | "forbidden_void_type": {
271 | "check": [
272 | "^stringtab$",
273 | "^char[0-9]+$",
274 | "^int4$",
275 | "^rs_c_true$",
276 | "^rs_c_false$",
277 | "^flag$",
278 | "^sydatum$",
279 | "^syindex$",
280 | "^sytabix$",
281 | "^syuzeit$"
282 | ],
283 | "exclude": [],
284 | "severity": "Error"
285 | },
286 | "form_tables_obsolete": {
287 | "exclude": [],
288 | "severity": "Error"
289 | },
290 | "fully_type_constants": {
291 | "checkData": true,
292 | "exclude": [],
293 | "severity": "Error"
294 | },
295 | "function_module_recommendations": {
296 | "exclude": [],
297 | "recommendations": [
298 | {
299 | "name": "SUBST_GET_FILE_LIST",
300 | "replace": "see note 1686357"
301 | },
302 | {
303 | "name": "ROUND",
304 | "replace": "use built in function: round()"
305 | },
306 | {
307 | "name": "SO_NEW_DOCUMENT_ATT_SEND_API1",
308 | "replace": "use CL_BCS"
309 | },
310 | {
311 | "name": "ECATT_CONV_XSTRING_TO_STRING",
312 | "replace": "use CL_BINARY_CONVERT"
313 | },
314 | {
315 | "name": "SCMS_STRING_TO_XSTRING",
316 | "replace": "use CL_BINARY_CONVERT"
317 | },
318 | {
319 | "name": "JOB_CREATE",
320 | "replace": "use CL_BP_ABAP_JOB"
321 | },
322 | {
323 | "name": "JOB_SUBMIT",
324 | "replace": "use CL_BP_ABAP_JOB"
325 | },
326 | {
327 | "name": "GUI_DOWNLOAD",
328 | "replace": "use CL_GUI_FRONTEND_SERVICES"
329 | },
330 | {
331 | "name": "GUI_UPLOAD",
332 | "replace": "use CL_GUI_FRONTEND_SERVICES"
333 | },
334 | {
335 | "name": "WS_FILENAME_GET",
336 | "replace": "use CL_GUI_FRONTEND_SERVICES"
337 | },
338 | {
339 | "name": "F4_FILENAME",
340 | "replace": "use CL_GUI_FRONTEND_SERVICES"
341 | },
342 | {
343 | "name": "SAPGUI_PROGRESS_INDICATOR",
344 | "replace": "use CL_PROGRESS_INDICATOR"
345 | },
346 | {
347 | "name": "GUID_CREATE",
348 | "replace": "use CL_SYSTEM_UUID"
349 | },
350 | {
351 | "name": "SSFC_BASE64_DECODE",
352 | "replace": "use class CL_HTTP_UTILITY methods"
353 | },
354 | {
355 | "name": "SSFC_BASE64_ENCODE",
356 | "replace": "use class CL_HTTP_UTILITY methods"
357 | },
358 | {
359 | "name": "SCMS_BASE64_DECODE_STR",
360 | "replace": "use class CL_HTTP_UTILITY methods"
361 | },
362 | {
363 | "name": "POPUP_TO_DECIDE",
364 | "replace": "use POPUP_TO_CONFIRM"
365 | },
366 | {
367 | "name": "REUSE_ALV_GRID_DISPLAY",
368 | "replace": "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID"
369 | },
370 | {
371 | "name": "CALCULATE_HASH_FOR_RAW",
372 | "replace": "use CL_ABAP_HMAC"
373 | },
374 | {
375 | "name": "FUNCTION_EXISTS",
376 | "replace": "surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead"
377 | }
378 | ],
379 | "severity": "Error"
380 | },
381 | "functional_writing": {
382 | "exclude": [],
383 | "ignoreExceptions": true,
384 | "severity": "Error"
385 | },
386 | "global_class": {
387 | "exclude": [],
388 | "severity": "Error"
389 | },
390 | "identical_conditions": {
391 | "exclude": [],
392 | "severity": "Error"
393 | },
394 | "identical_contents": {
395 | "exclude": [".*"],
396 | "severity": "Error"
397 | },
398 | "identical_descriptions": {
399 | "exclude": [],
400 | "severity": "Error"
401 | },
402 | "identical_form_names": {
403 | "exclude": [],
404 | "severity": "Error"
405 | },
406 | "if_in_if": {
407 | "exclude": [".*"],
408 | "severity": "Error"
409 | },
410 | "implement_methods": {
411 | "exclude": [],
412 | "severity": "Error"
413 | },
414 | "in_statement_indentation": {
415 | "blockStatements": 2,
416 | "exclude": [".*"],
417 | "ignoreExceptions": true,
418 | "severity": "Error"
419 | },
420 | "indentation": {
421 | "alignTryCatch": false,
422 | "exclude": [],
423 | "globalClassSkipFirst": false,
424 | "ignoreExceptions": true,
425 | "ignoreGlobalClassDefinition": false,
426 | "ignoreGlobalInterface": false,
427 | "selectionScreenBlockIndentation": false,
428 | "severity": "Error"
429 | },
430 | "inline_data_old_versions": {
431 | "exclude": [],
432 | "severity": "Error"
433 | },
434 | "intf_referencing_clas": {
435 | "allow": [],
436 | "exclude": [],
437 | "severity": "Error"
438 | },
439 | "keep_single_parameter_on_one_line": {
440 | "exclude": [],
441 | "length": 120,
442 | "severity": "Error"
443 | },
444 | "keyword_case": {
445 | "exclude": [],
446 | "ignoreExceptions": true,
447 | "ignoreFunctionModuleName": false,
448 | "ignoreGlobalClassBoundaries": false,
449 | "ignoreGlobalClassDefinition": false,
450 | "ignoreGlobalInterface": false,
451 | "ignoreKeywords": [],
452 | "ignoreLowerClassImplmentationStatement": true,
453 | "severity": "Error",
454 | "style": "upper"
455 | },
456 | "line_break_multiple_parameters": {
457 | "count": 1,
458 | "exclude": [],
459 | "severity": "Error"
460 | },
461 | "line_break_style": {
462 | "exclude": [],
463 | "severity": "Error"
464 | },
465 | "line_length": {
466 | "exclude": [],
467 | "length": 120,
468 | "severity": "Error"
469 | },
470 | "line_only_punc": {
471 | "exclude": [],
472 | "ignoreExceptions": true,
473 | "severity": "Error"
474 | },
475 | "local_class_naming": {
476 | "exception": "^LCX_.+$",
477 | "exclude": [],
478 | "ignoreNames": [],
479 | "ignorePatterns": [],
480 | "local": "^LCL_.+$",
481 | "patternKind": "required",
482 | "severity": "Error",
483 | "test": "^LTCL_.+$"
484 | },
485 | "local_testclass_consistency": {
486 | "exclude": [],
487 | "severity": "Error"
488 | },
489 | "local_variable_names": {
490 | "exclude": [],
491 | "expectedConstant": "^LC_.+$",
492 | "expectedData": "^L._.+$",
493 | "expectedFS": "^