@abaplint/core 2.105.5 → 2.105.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +6 -6
  2. package/build/abaplint.d.ts +2 -8
  3. package/build/src/abap/5_syntax/expressions/new_object.js +6 -0
  4. package/build/src/abap/5_syntax/statements/assign.js +3 -3
  5. package/build/src/abap/5_syntax/statements/concatenate.js +2 -2
  6. package/build/src/abap/5_syntax/statements/create_object.js +4 -1
  7. package/build/src/abap/flow/flow_graph.js +7 -7
  8. package/build/src/lsp/help.js +7 -7
  9. package/build/src/objects/neptune_api.js +1 -0
  10. package/build/src/registry.js +1 -1
  11. package/build/src/rules/7bit_ascii.js +4 -4
  12. package/build/src/rules/abapdoc.js +11 -6
  13. package/build/src/rules/align_parameters.js +40 -40
  14. package/build/src/rules/allowed_object_naming.js +2 -1
  15. package/build/src/rules/ambiguous_statement.js +6 -6
  16. package/build/src/rules/avoid_use.js +10 -10
  17. package/build/src/rules/begin_end_names.js +4 -4
  18. package/build/src/rules/begin_single_include.js +12 -12
  19. package/build/src/rules/call_transaction_authority_check.js +3 -3
  20. package/build/src/rules/cds_comment_style.js +4 -4
  21. package/build/src/rules/cds_legacy_view.js +4 -4
  22. package/build/src/rules/chain_mainly_declarations.js +4 -4
  23. package/build/src/rules/change_if_to_case.js +8 -8
  24. package/build/src/rules/check_abstract.js +2 -2
  25. package/build/src/rules/check_comments.js +4 -4
  26. package/build/src/rules/check_include.js +3 -3
  27. package/build/src/rules/check_subrc.js +8 -8
  28. package/build/src/rules/classic_exceptions_overlap.js +10 -10
  29. package/build/src/rules/commented_code.js +1 -1
  30. package/build/src/rules/constructor_visibility_public.js +4 -4
  31. package/build/src/rules/contains_tab.js +2 -2
  32. package/build/src/rules/cyclic_oo.js +4 -4
  33. package/build/src/rules/dangerous_statement.js +1 -1
  34. package/build/src/rules/definitions_top.js +6 -6
  35. package/build/src/rules/downport.js +82 -82
  36. package/build/src/rules/easy_to_find_messages.js +6 -6
  37. package/build/src/rules/empty_line_in_statement.js +2 -2
  38. package/build/src/rules/exit_or_check.js +3 -3
  39. package/build/src/rules/expand_macros.js +5 -5
  40. package/build/src/rules/exporting.js +1 -1
  41. package/build/src/rules/forbidden_identifier.js +1 -1
  42. package/build/src/rules/forbidden_void_type.js +2 -2
  43. package/build/src/rules/fully_type_itabs.js +1 -1
  44. package/build/src/rules/functional_writing.js +17 -17
  45. package/build/src/rules/global_class.js +8 -8
  46. package/build/src/rules/identical_conditions.js +13 -10
  47. package/build/src/rules/identical_contents.js +14 -14
  48. package/build/src/rules/identical_descriptions.js +6 -6
  49. package/build/src/rules/if_in_if.js +35 -35
  50. package/build/src/rules/implement_methods.js +3 -3
  51. package/build/src/rules/in_statement_indentation.js +11 -11
  52. package/build/src/rules/intf_referencing_clas.js +3 -3
  53. package/build/src/rules/line_break_style.js +2 -2
  54. package/build/src/rules/line_length.js +1 -1
  55. package/build/src/rules/line_only_punc.js +1 -1
  56. package/build/src/rules/local_variable_names.js +2 -2
  57. package/build/src/rules/main_file_contents.js +4 -4
  58. package/build/src/rules/many_parentheses.js +10 -10
  59. package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
  60. package/build/src/rules/max_one_statement.js +5 -5
  61. package/build/src/rules/method_length.js +2 -2
  62. package/build/src/rules/method_overwrites_builtin.js +4 -4
  63. package/build/src/rules/nesting.js +1 -1
  64. package/build/src/rules/no_chained_assignment.js +1 -1
  65. package/build/src/rules/no_external_form_calls.js +2 -2
  66. package/build/src/rules/no_inline_in_optional_branches.js +11 -11
  67. package/build/src/rules/no_prefixes.js +6 -6
  68. package/build/src/rules/no_public_attributes.js +1 -1
  69. package/build/src/rules/no_yoda_conditions.js +4 -4
  70. package/build/src/rules/nrob_consistency.js +2 -2
  71. package/build/src/rules/obsolete_statement.js +51 -51
  72. package/build/src/rules/omit_parameter_name.js +3 -3
  73. package/build/src/rules/omit_receiving.js +13 -13
  74. package/build/src/rules/parser_702_chaining.js +2 -2
  75. package/build/src/rules/parser_error.js +2 -2
  76. package/build/src/rules/parser_missing_space.js +1 -1
  77. package/build/src/rules/prefer_inline.js +16 -16
  78. package/build/src/rules/prefer_is_not.js +9 -9
  79. package/build/src/rules/prefer_raise_exception_new.js +5 -5
  80. package/build/src/rules/prefer_returning_to_exporting.js +1 -1
  81. package/build/src/rules/prefer_xsdbool.js +2 -2
  82. package/build/src/rules/reduce_procedural_code.js +17 -17
  83. package/build/src/rules/remove_descriptions.js +4 -4
  84. package/build/src/rules/rfc_error_handling.js +9 -9
  85. package/build/src/rules/select_add_order_by.js +5 -5
  86. package/build/src/rules/select_performance.js +5 -5
  87. package/build/src/rules/select_single_full_key.js +2 -2
  88. package/build/src/rules/sicf_consistency.js +2 -2
  89. package/build/src/rules/space_before_dot.js +2 -2
  90. package/build/src/rules/sql_value_conversion.js +6 -6
  91. package/build/src/rules/start_at_tab.js +1 -1
  92. package/build/src/rules/strict_sql.js +6 -6
  93. package/build/src/rules/sy_modification.js +3 -3
  94. package/build/src/rules/tabl_enhancement_category.js +2 -2
  95. package/build/src/rules/type_form_parameters.js +2 -2
  96. package/build/src/rules/unnecessary_pragma.js +29 -29
  97. package/build/src/rules/unnecessary_return.js +11 -11
  98. package/build/src/rules/unused_methods.js +11 -11
  99. package/build/src/rules/unused_variables.js +12 -12
  100. package/build/src/rules/use_bool_expression.js +8 -8
  101. package/build/src/rules/use_line_exists.js +6 -6
  102. package/build/src/rules/use_new.js +4 -4
  103. package/build/src/rules/when_others_last.js +6 -6
  104. package/package.json +70 -70
@@ -23,25 +23,25 @@ class PreferInline {
23
23
  key: "prefer_inline",
24
24
  title: "Prefer Inline Declarations",
25
25
  shortDescription: `Prefer inline to up-front declarations.`,
26
- extendedInformation: `EXPERIMENTAL
27
-
28
- Activates if language version is v740sp02 or above.
29
-
30
- Variables must be local(METHOD or FORM).
31
-
32
- No generic or void typed variables. No syntax errors.
33
-
34
- First position used must be a full/pure write.
35
-
36
- Move statment is not a cast(?=)
37
-
26
+ extendedInformation: `EXPERIMENTAL
27
+
28
+ Activates if language version is v740sp02 or above.
29
+
30
+ Variables must be local(METHOD or FORM).
31
+
32
+ No generic or void typed variables. No syntax errors.
33
+
34
+ First position used must be a full/pure write.
35
+
36
+ Move statment is not a cast(?=)
37
+
38
38
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
39
39
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
40
- badExample: `DATA foo TYPE i.
41
- foo = 2.
42
- DATA percentage TYPE decfloat34.
40
+ badExample: `DATA foo TYPE i.
41
+ foo = 2.
42
+ DATA percentage TYPE decfloat34.
43
43
  percentage = ( comment_number / abs_statement_number ) * 100.`,
44
- goodExample: `DATA(foo) = 2.
44
+ goodExample: `DATA(foo) = 2.
45
45
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
46
46
  };
47
47
  }
@@ -21,18 +21,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
21
21
  key: "prefer_is_not",
22
22
  title: "Prefer IS NOT to NOT IS",
23
23
  shortDescription: `Prefer IS NOT to NOT IS`,
24
- extendedInformation: `
25
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
26
-
24
+ extendedInformation: `
25
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
26
+
27
27
  "if not is_valid( )." examples are skipped`,
28
28
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
29
- goodExample: `IF variable IS NOT INITIAL.
30
- IF variable NP 'TODO*'.
31
- IF variable <> 42.
29
+ goodExample: `IF variable IS NOT INITIAL.
30
+ IF variable NP 'TODO*'.
31
+ IF variable <> 42.
32
32
  IF variable CO 'hello'.`,
33
- badExample: `IF NOT variable IS INITIAL.
34
- IF NOT variable CP 'TODO*'.
35
- IF NOT variable = 42.
33
+ badExample: `IF NOT variable IS INITIAL.
34
+ IF NOT variable CP 'TODO*'.
35
+ IF NOT variable = 42.
36
36
  IF NOT variable CA 'hello'.`,
37
37
  };
38
38
  }
@@ -20,14 +20,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
20
20
  key: "prefer_raise_exception_new",
21
21
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
22
22
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
23
- extendedInformation: `
24
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
25
-
23
+ extendedInformation: `
24
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
25
+
26
26
  From 752 and up`,
27
27
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
28
28
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
29
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
30
- EXPORTING
29
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
30
+ EXPORTING
31
31
  previous = exception.`,
32
32
  };
33
33
  }
@@ -20,7 +20,7 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
20
20
  key: "prefer_returning_to_exporting",
21
21
  title: "Prefer RETURNING to EXPORTING",
22
22
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
23
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
23
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
24
24
  https://docs.abapopenchecks.org/checks/44/`,
25
25
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
26
26
  };
@@ -21,8 +21,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
21
21
  key: "prefer_xsdbool",
22
22
  title: "Prefer xsdbool over boolc",
23
23
  shortDescription: `Prefer xsdbool over boolc`,
24
- extendedInformation: `Activates if language version is v740sp08 or above.
25
-
24
+ extendedInformation: `Activates if language version is v740sp08 or above.
25
+
26
26
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
27
27
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
28
28
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -24,26 +24,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
24
24
  key: "reduce_procedural_code",
25
25
  title: "Reduce procedural code",
26
26
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
27
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
28
-
29
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
30
-
27
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
28
+
29
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
30
+
31
31
  Comments are not counted as statements.`,
32
32
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
33
- badExample: `FORM foo.
34
- DATA lv_bar TYPE i.
35
- lv_bar = 2 + 2.
36
- IF lv_bar = 4.
37
- WRITE 'hello world'.
38
- ENDIF.
39
- DATA lv_bar TYPE i.
40
- lv_bar = 2 + 2.
41
- IF lv_bar = 4.
42
- WRITE 'hello world'.
43
- ENDIF.
33
+ badExample: `FORM foo.
34
+ DATA lv_bar TYPE i.
35
+ lv_bar = 2 + 2.
36
+ IF lv_bar = 4.
37
+ WRITE 'hello world'.
38
+ ENDIF.
39
+ DATA lv_bar TYPE i.
40
+ lv_bar = 2 + 2.
41
+ IF lv_bar = 4.
42
+ WRITE 'hello world'.
43
+ ENDIF.
44
44
  ENDFORM.`,
45
- goodExample: `FORM foo.
46
- NEW zcl_global_class( )->run_logic( ).
45
+ goodExample: `FORM foo.
46
+ NEW zcl_global_class( )->run_logic( ).
47
47
  ENDFORM.`,
48
48
  };
49
49
  }
@@ -26,10 +26,10 @@ class RemoveDescriptions {
26
26
  return {
27
27
  key: "remove_descriptions",
28
28
  title: "Remove descriptions",
29
- shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
30
-
31
- Class descriptions are required, see rule description_empty.
32
-
29
+ shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.
30
+
31
+ Class descriptions are required, see rule description_empty.
32
+
33
33
  Consider using ABAP Doc for documentation.`,
34
34
  tags: [],
35
35
  };
@@ -22,16 +22,16 @@ class RFCErrorHandling extends _abap_rule_1.ABAPRule {
22
22
  tags: [_irule_1.RuleTag.SingleFile],
23
23
  shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,
24
24
  extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,
25
- badExample: `
26
- CALL FUNCTION 'ZRFC'
25
+ badExample: `
26
+ CALL FUNCTION 'ZRFC'
27
27
  DESTINATION lv_rfc.`,
28
- goodExample: `
29
- CALL FUNCTION 'ZRFC'
30
- DESTINATION lv_rfc
31
- EXCEPTIONS
32
- system_failure = 1 MESSAGE msg
33
- communication_failure = 2 MESSAGE msg
34
- resource_failure = 3
28
+ goodExample: `
29
+ CALL FUNCTION 'ZRFC'
30
+ DESTINATION lv_rfc
31
+ EXCEPTIONS
32
+ system_failure = 1 MESSAGE msg
33
+ communication_failure = 2 MESSAGE msg
34
+ resource_failure = 3
35
35
  OTHERS = 4.`,
36
36
  };
37
37
  }
@@ -25,11 +25,11 @@ class SelectAddOrderBy {
25
25
  key: "select_add_order_by",
26
26
  title: "SELECT add ORDER BY",
27
27
  shortDescription: `SELECTs add ORDER BY clause`,
28
- extendedInformation: `
29
- This will make sure that the SELECT statement returns results in the same sequence on different databases
30
-
31
- add ORDER BY PRIMARY KEY if in doubt
32
-
28
+ extendedInformation: `
29
+ This will make sure that the SELECT statement returns results in the same sequence on different databases
30
+
31
+ add ORDER BY PRIMARY KEY if in doubt
32
+
33
33
  If the target is a sorted/hashed table, no issue is reported`,
34
34
  tags: [_irule_1.RuleTag.SingleFile],
35
35
  };
@@ -34,14 +34,14 @@ class SelectPerformance {
34
34
  key: "select_performance",
35
35
  title: "SELECT performance",
36
36
  shortDescription: `Various checks regarding SELECT performance.`,
37
- extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
38
-
37
+ extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE
38
+
39
39
  SELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,
40
40
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],
41
- badExample: `SELECT field1, field2 FROM table
42
- INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
41
+ badExample: `SELECT field1, field2 FROM table
42
+ INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.
43
43
  ENDSELECT.`,
44
- goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
44
+ goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS
45
45
  INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,
46
46
  };
47
47
  }
@@ -20,8 +20,8 @@ class SelectSingleFullKey {
20
20
  key: "select_single_full_key",
21
21
  title: "Detect SELECT SINGLE which are possibily not unique",
22
22
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
23
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
24
-
23
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
24
+
25
25
  If the statement contains a JOIN it is not checked`,
26
26
  pseudoComment: "EC CI_NOORDER",
27
27
  tags: [],
@@ -24,8 +24,8 @@ class SICFConsistency {
24
24
  key: "sicf_consistency",
25
25
  title: "SICF consistency",
26
26
  shortDescription: `Checks the validity of ICF services`,
27
- extendedInformation: `* Class defined in handler must exist
28
- * Class must not have any syntax errors
27
+ extendedInformation: `* Class defined in handler must exist
28
+ * Class must not have any syntax errors
29
29
  * Class must implement interface IF_HTTP_EXTENSION`,
30
30
  };
31
31
  }
@@ -29,8 +29,8 @@ class SpaceBeforeDot extends _abap_rule_1.ABAPRule {
29
29
  key: "space_before_dot",
30
30
  title: "Space before dot",
31
31
  shortDescription: `Checks for extra spaces before dots at the ends of statements`,
32
- extendedInformation: `
33
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
32
+ extendedInformation: `
33
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent
34
34
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,
35
35
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
36
36
  badExample: `WRITE bar .`,
@@ -18,12 +18,12 @@ class SQLValueConversion {
18
18
  key: "sql_value_conversion",
19
19
  title: "Implicit SQL Value Conversion",
20
20
  shortDescription: `Ensure types match when selecting from database`,
21
- extendedInformation: `
22
- * Integer to CHAR conversion
23
- * Integer to NUMC conversion
24
- * NUMC to Integer conversion
25
- * CHAR to Integer conversion
26
- * Source field longer than database field, CHAR -> CHAR
21
+ extendedInformation: `
22
+ * Integer to CHAR conversion
23
+ * Integer to NUMC conversion
24
+ * NUMC to Integer conversion
25
+ * CHAR to Integer conversion
26
+ * Source field longer than database field, CHAR -> CHAR
27
27
  * Source field longer than database field, NUMC -> NUMC`,
28
28
  tags: [],
29
29
  };
@@ -20,7 +20,7 @@ class StartAtTab extends _abap_rule_1.ABAPRule {
20
20
  key: "start_at_tab",
21
21
  title: "Start at tab",
22
22
  shortDescription: `Checks that statements start at tabstops.`,
23
- extendedInformation: `Reports max 100 issues per file
23
+ extendedInformation: `Reports max 100 issues per file
24
24
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,
25
25
  tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
26
26
  badExample: ` WRITE a.`,
@@ -22,12 +22,12 @@ class StrictSQL extends _abap_rule_1.ABAPRule {
22
22
  key: "strict_sql",
23
23
  title: "Strict SQL",
24
24
  shortDescription: `Strict SQL`,
25
- extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
26
-
27
- https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
28
-
29
- Also see separate rule sql_escape_host_variables
30
-
25
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
26
+
27
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
28
+
29
+ Also see separate rule sql_escape_host_variables
30
+
31
31
  Activates from v750 and up`,
32
32
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix],
33
33
  };
@@ -19,11 +19,11 @@ class SyModification extends _abap_rule_1.ABAPRule {
19
19
  key: "sy_modification",
20
20
  title: "Modification of SY fields",
21
21
  shortDescription: `Finds modification of sy fields`,
22
- extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
23
-
22
+ extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
23
+
24
24
  Changes to SY-TVAR* fields are not reported`,
25
25
  tags: [_irule_1.RuleTag.SingleFile],
26
- badExample: `sy-uname = 2.
26
+ badExample: `sy-uname = 2.
27
27
  sy = sy.`,
28
28
  };
29
29
  }
@@ -17,8 +17,8 @@ class TABLEnhancementCategory {
17
17
  key: "tabl_enhancement_category",
18
18
  title: "TABL enhancement category must be set",
19
19
  shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,
20
- extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
21
-
20
+ extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.
21
+
22
22
  You may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,
23
23
  tags: [],
24
24
  };
@@ -21,9 +21,9 @@ class TypeFormParameters extends _abap_rule_1.ABAPRule {
21
21
  title: "Type FORM parameters",
22
22
  shortDescription: `Checks for untyped FORM parameters`,
23
23
  tags: [_irule_1.RuleTag.SingleFile],
24
- badExample: `FORM foo USING bar.
24
+ badExample: `FORM foo USING bar.
25
25
  ENDFORM.`,
26
- goodExample: `FORM foo USING bar TYPE string.
26
+ goodExample: `FORM foo USING bar TYPE string.
27
27
  ENDFORM.`,
28
28
  };
29
29
  }
@@ -27,38 +27,38 @@ class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
27
27
  key: "unnecessary_pragma",
28
28
  title: "Unnecessary Pragma",
29
29
  shortDescription: `Finds pragmas which can be removed`,
30
- extendedInformation: `* NO_HANDLER with handler
31
-
32
- * NEEDED without definition
33
-
34
- * NO_TEXT without texts
35
-
36
- * SUBRC_OK where sy-subrc is checked
37
-
30
+ extendedInformation: `* NO_HANDLER with handler
31
+
32
+ * NEEDED without definition
33
+
34
+ * NO_TEXT without texts
35
+
36
+ * SUBRC_OK where sy-subrc is checked
37
+
38
38
  NO_HANDLER inside macros are not checked`,
39
39
  tags: [_irule_1.RuleTag.SingleFile],
40
- badExample: `TRY.
41
- ...
42
- CATCH zcx_abapgit_exception ##NO_HANDLER.
43
- RETURN. " it has a handler
44
- ENDTRY.
45
- MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
46
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
47
- IF sy-subrc <> 0.
40
+ badExample: `TRY.
41
+ ...
42
+ CATCH zcx_abapgit_exception ##NO_HANDLER.
43
+ RETURN. " it has a handler
44
+ ENDTRY.
45
+ MESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.
46
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.
47
+ IF sy-subrc <> 0.
48
48
  ENDIF.`,
49
- goodExample: `TRY.
50
- ...
51
- CATCH zcx_abapgit_exception.
52
- RETURN.
53
- ENDTRY.
54
- MESSAGE w125(zbar) WITH c_foo INTO message.
55
- SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
56
- IF sy-subrc <> 0.
57
- ENDIF.
58
-
59
- DATA: BEGIN OF blah ##NEEDED,
60
- test1 TYPE string,
61
- test2 TYPE string,
49
+ goodExample: `TRY.
50
+ ...
51
+ CATCH zcx_abapgit_exception.
52
+ RETURN.
53
+ ENDTRY.
54
+ MESSAGE w125(zbar) WITH c_foo INTO message.
55
+ SELECT SINGLE * FROM tadir INTO @DATA(sdfs).
56
+ IF sy-subrc <> 0.
57
+ ENDIF.
58
+
59
+ DATA: BEGIN OF blah ##NEEDED,
60
+ test1 TYPE string,
61
+ test2 TYPE string,
62
62
  END OF blah.`,
63
63
  };
64
64
  }
@@ -22,18 +22,18 @@ class UnnecessaryReturn extends _abap_rule_1.ABAPRule {
22
22
  shortDescription: `Finds unnecessary RETURN statements`,
23
23
  extendedInformation: `Finds unnecessary RETURN statements`,
24
24
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
25
- badExample: `FORM hello1.
26
- WRITE 'world'.
27
- RETURN.
28
- ENDFORM.
29
-
30
- FORM foo.
31
- IF 1 = 2.
32
- RETURN.
33
- ENDIF.
25
+ badExample: `FORM hello1.
26
+ WRITE 'world'.
27
+ RETURN.
28
+ ENDFORM.
29
+
30
+ FORM foo.
31
+ IF 1 = 2.
32
+ RETURN.
33
+ ENDIF.
34
34
  ENDFORM.`,
35
- goodExample: `FORM hello2.
36
- WRITE 'world'.
35
+ goodExample: `FORM hello2.
36
+ WRITE 'world'.
37
37
  ENDFORM.`,
38
38
  };
39
39
  }
@@ -56,17 +56,17 @@ class UnusedMethods {
56
56
  key: "unused_methods",
57
57
  title: "Unused methods",
58
58
  shortDescription: `Checks for unused methods`,
59
- extendedInformation: `Checks private and protected methods.
60
-
61
- Unused methods are not reported if the object contains parser or syntax errors.
62
-
63
- Skips:
64
- * methods FOR TESTING
65
- * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
66
- * class_constructor + constructor methods
67
- * event handlers
68
- * methods that are redefined
69
- * INCLUDEs
59
+ extendedInformation: `Checks private and protected methods.
60
+
61
+ Unused methods are not reported if the object contains parser or syntax errors.
62
+
63
+ Skips:
64
+ * methods FOR TESTING
65
+ * methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
66
+ * class_constructor + constructor methods
67
+ * event handlers
68
+ * methods that are redefined
69
+ * INCLUDEs
70
70
  `,
71
71
  tags: [],
72
72
  pragma: "##CALLED",
@@ -66,23 +66,23 @@ class UnusedVariables {
66
66
  key: "unused_variables",
67
67
  title: "Unused variables",
68
68
  shortDescription: `Checks for unused variables and constants`,
69
- extendedInformation: `Skips event parameters.
70
-
71
- Note that this currently does not work if the source code uses macros.
72
-
73
- Unused variables are not reported if the object contains parser or syntax errors.
74
-
69
+ extendedInformation: `Skips event parameters.
70
+
71
+ Note that this currently does not work if the source code uses macros.
72
+
73
+ Unused variables are not reported if the object contains parser or syntax errors.
74
+
75
75
  Errors found in INCLUDES are reported for the main program.`,
76
76
  tags: [_irule_1.RuleTag.Quickfix],
77
77
  pragma: "##NEEDED",
78
78
  pseudoComment: "EC NEEDED",
79
- badExample: `DATA: BEGIN OF blah1,
80
- test TYPE string,
81
- test2 TYPE string,
79
+ badExample: `DATA: BEGIN OF blah1,
80
+ test TYPE string,
81
+ test2 TYPE string,
82
82
  END OF blah1.`,
83
- goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
84
- test TYPE string,
85
- test2 TYPE string,
83
+ goodExample: `DATA: BEGIN OF blah2 ##NEEDED,
84
+ test TYPE string,
85
+ test2 TYPE string,
86
86
  END OF blah2.`,
87
87
  };
88
88
  }
@@ -27,15 +27,15 @@ class UseBoolExpression extends _abap_rule_1.ABAPRule {
27
27
  shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,
28
28
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
29
29
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
30
- badExample: `IF line IS INITIAL.
31
- has_entries = abap_false.
32
- ELSE.
33
- has_entries = abap_true.
34
- ENDIF.
35
-
30
+ badExample: `IF line IS INITIAL.
31
+ has_entries = abap_false.
32
+ ELSE.
33
+ has_entries = abap_true.
34
+ ENDIF.
35
+
36
36
  DATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,
37
- goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
38
-
37
+ goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).
38
+
39
39
  DATA(fsdf) = xsdbool( foo <> bar ).`,
40
40
  };
41
41
  }
@@ -22,15 +22,15 @@ class UseLineExists extends _abap_rule_1.ABAPRule {
22
22
  key: "use_line_exists",
23
23
  title: "Use line_exists",
24
24
  shortDescription: `Use line_exists, from 740sp02 and up`,
25
- extendedInformation: `
26
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
27
-
25
+ extendedInformation: `
26
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at
27
+
28
28
  Not reported if the READ TABLE statement contains BINARY SEARCH.`,
29
29
  tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
30
- badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
31
- IF sy-subrc = 0.
30
+ badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.
31
+ IF sy-subrc = 0.
32
32
  ENDIF.`,
33
- goodExample: `IF line_exists( my_table[ key = 'A' ] ).
33
+ goodExample: `IF line_exists( my_table[ key = 'A' ] ).
34
34
  ENDIF.`,
35
35
  };
36
36
  }
@@ -23,10 +23,10 @@ class UseNew extends _abap_rule_1.ABAPRule {
23
23
  key: "use_new",
24
24
  title: "Use NEW",
25
25
  shortDescription: `Checks for deprecated CREATE OBJECT statements.`,
26
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
27
-
28
- If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
29
-
26
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object
27
+
28
+ If the target variable is referenced in the CREATE OBJECT statement, no errors are issued
29
+
30
30
  Applicable from v740sp02 and up`,
31
31
  badExample: `CREATE OBJECT ref.`,
32
32
  goodExample: `ref = NEW #( ).`,
@@ -21,13 +21,13 @@ class WhenOthersLast extends _abap_rule_1.ABAPRule {
21
21
  title: "WHEN OTHERS last",
22
22
  shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,
23
23
  tags: [_irule_1.RuleTag.SingleFile],
24
- badExample: `CASE bar.
25
- WHEN OTHERS.
26
- WHEN 2.
24
+ badExample: `CASE bar.
25
+ WHEN OTHERS.
26
+ WHEN 2.
27
27
  ENDCASE.`,
28
- goodExample: `CASE bar.
29
- WHEN 2.
30
- WHEN OTHERS.
28
+ goodExample: `CASE bar.
29
+ WHEN 2.
30
+ WHEN OTHERS.
31
31
  ENDCASE.`,
32
32
  };
33
33
  }