@abaplint/core 2.119.66 → 2.120.0

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 (138) hide show
  1. package/README.md +6 -6
  2. package/build/abaplint.d.ts +2 -2
  3. package/build/src/abap/5_syntax/_current_scope.js +1 -1
  4. package/build/src/abap/5_syntax/expressions/_check_offset_length.js +59 -0
  5. package/build/src/abap/5_syntax/expressions/method_call_param.js +4 -0
  6. package/build/src/abap/5_syntax/expressions/method_parameters.js +20 -6
  7. package/build/src/abap/5_syntax/statements/catch.js +17 -1
  8. package/build/src/config.js +1 -1
  9. package/build/src/lsp/help.js +10 -10
  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 +4 -4
  13. package/build/src/rules/add_test_attributes.js +20 -20
  14. package/build/src/rules/align_parameters.js +40 -40
  15. package/build/src/rules/align_type_expressions.js +28 -28
  16. package/build/src/rules/ambiguous_statement.js +7 -7
  17. package/build/src/rules/avoid_use.js +10 -10
  18. package/build/src/rules/begin_end_names.js +4 -4
  19. package/build/src/rules/begin_single_include.js +13 -13
  20. package/build/src/rules/call_transaction_authority_check.js +3 -3
  21. package/build/src/rules/cds_association_name.js +6 -6
  22. package/build/src/rules/cds_comment_style.js +4 -4
  23. package/build/src/rules/cds_field_order.js +12 -12
  24. package/build/src/rules/cds_legacy_view.js +4 -4
  25. package/build/src/rules/cds_naming.js +7 -7
  26. package/build/src/rules/chain_mainly_declarations.js +4 -4
  27. package/build/src/rules/change_if_to_case.js +8 -8
  28. package/build/src/rules/check_abstract.js +2 -2
  29. package/build/src/rules/check_comments.js +4 -4
  30. package/build/src/rules/check_include.js +4 -4
  31. package/build/src/rules/check_subrc.js +8 -8
  32. package/build/src/rules/class_attribute_names.js +6 -6
  33. package/build/src/rules/classic_exceptions_overlap.js +10 -10
  34. package/build/src/rules/commented_code.js +1 -1
  35. package/build/src/rules/constructor_visibility_public.js +10 -10
  36. package/build/src/rules/contains_tab.js +2 -2
  37. package/build/src/rules/cyclic_oo.js +4 -4
  38. package/build/src/rules/dangerous_statement.js +1 -1
  39. package/build/src/rules/db_operation_in_loop.js +9 -9
  40. package/build/src/rules/definitions_top.js +6 -6
  41. package/build/src/rules/downport.js +92 -92
  42. package/build/src/rules/easy_to_find_messages.js +6 -6
  43. package/build/src/rules/empty_event.js +6 -6
  44. package/build/src/rules/empty_line_in_statement.js +2 -2
  45. package/build/src/rules/empty_structure.js +6 -6
  46. package/build/src/rules/exit_or_check.js +7 -7
  47. package/build/src/rules/expand_macros.js +5 -5
  48. package/build/src/rules/exporting.js +1 -1
  49. package/build/src/rules/forbidden_identifier.js +1 -1
  50. package/build/src/rules/forbidden_void_type.js +2 -2
  51. package/build/src/rules/form_tables_obsolete.js +2 -2
  52. package/build/src/rules/fully_type_itabs.js +2 -2
  53. package/build/src/rules/function_module_recommendations.js +2 -2
  54. package/build/src/rules/functional_writing.js +17 -17
  55. package/build/src/rules/global_class.js +10 -10
  56. package/build/src/rules/identical_conditions.js +12 -12
  57. package/build/src/rules/identical_contents.js +14 -14
  58. package/build/src/rules/identical_descriptions.js +6 -6
  59. package/build/src/rules/identical_move.js +2 -2
  60. package/build/src/rules/if_in_if.js +35 -35
  61. package/build/src/rules/implement_methods.js +3 -3
  62. package/build/src/rules/implicit_start_of_selection.js +4 -4
  63. package/build/src/rules/in_statement_indentation.js +11 -11
  64. package/build/src/rules/indentation.js +16 -16
  65. package/build/src/rules/index.js +1 -0
  66. package/build/src/rules/inline_data_old_versions.js +1 -1
  67. package/build/src/rules/intf_referencing_clas.js +3 -3
  68. package/build/src/rules/invalid_table_index.js +2 -2
  69. package/build/src/rules/line_break_style.js +2 -2
  70. package/build/src/rules/line_length.js +2 -2
  71. package/build/src/rules/line_only_punc.js +1 -1
  72. package/build/src/rules/local_class_naming.js +2 -2
  73. package/build/src/rules/local_variable_names.js +6 -6
  74. package/build/src/rules/macro_naming.js +2 -2
  75. package/build/src/rules/main_file_contents.js +4 -4
  76. package/build/src/rules/many_parentheses.js +10 -10
  77. package/build/src/rules/max_one_method_parameter_per_line.js +7 -7
  78. package/build/src/rules/max_one_statement.js +5 -5
  79. package/build/src/rules/method_length.js +2 -2
  80. package/build/src/rules/method_overwrites_builtin.js +12 -12
  81. package/build/src/rules/method_parameter_names.js +4 -4
  82. package/build/src/rules/mix_returning.js +8 -8
  83. package/build/src/rules/nesting.js +1 -1
  84. package/build/src/rules/no_aliases.js +5 -5
  85. package/build/src/rules/no_chained_assignment.js +1 -1
  86. package/build/src/rules/no_comments_between_methods.js +12 -12
  87. package/build/src/rules/no_external_form_calls.js +2 -2
  88. package/build/src/rules/no_inline_in_optional_branches.js +12 -12
  89. package/build/src/rules/no_macros.js +4 -4
  90. package/build/src/rules/no_prefixes.js +6 -6
  91. package/build/src/rules/no_public_attributes.js +7 -7
  92. package/build/src/rules/no_yoda_conditions.js +4 -4
  93. package/build/src/rules/nrob_consistency.js +2 -2
  94. package/build/src/rules/obsolete_statement.js +51 -51
  95. package/build/src/rules/omit_parameter_name.js +3 -3
  96. package/build/src/rules/omit_receiving.js +13 -13
  97. package/build/src/rules/parser_702_chaining.js +2 -2
  98. package/build/src/rules/parser_error.js +2 -2
  99. package/build/src/rules/parser_missing_space.js +1 -1
  100. package/build/src/rules/prefer_inline.js +16 -16
  101. package/build/src/rules/prefer_is_not.js +9 -9
  102. package/build/src/rules/prefer_raise_exception_new.js +5 -5
  103. package/build/src/rules/prefer_returning_to_exporting.js +4 -4
  104. package/build/src/rules/prefer_xsdbool.js +2 -2
  105. package/build/src/rules/preferred_compare_operator.js +2 -2
  106. package/build/src/rules/prefix_is_current_class.js +6 -6
  107. package/build/src/rules/reduce_procedural_code.js +17 -17
  108. package/build/src/rules/redundant_conversion.js +253 -0
  109. package/build/src/rules/remove_descriptions.js +4 -4
  110. package/build/src/rules/rfc_error_handling.js +7 -7
  111. package/build/src/rules/select_add_order_by.js +5 -5
  112. package/build/src/rules/select_performance.js +5 -5
  113. package/build/src/rules/select_single_full_key.js +2 -2
  114. package/build/src/rules/selection_screen_texts_missing.js +2 -2
  115. package/build/src/rules/sicf_consistency.js +2 -2
  116. package/build/src/rules/slow_parameter_passing.js +16 -16
  117. package/build/src/rules/space_before_dot.js +2 -2
  118. package/build/src/rules/sql_escape_host_variables.js +1 -1
  119. package/build/src/rules/sql_value_conversion.js +6 -6
  120. package/build/src/rules/start_at_tab.js +1 -1
  121. package/build/src/rules/static_call_via_instance.js +4 -4
  122. package/build/src/rules/strict_sql.js +6 -6
  123. package/build/src/rules/sy_modification.js +6 -6
  124. package/build/src/rules/tabl_enhancement_category.js +2 -2
  125. package/build/src/rules/tables_declared_locally.js +2 -2
  126. package/build/src/rules/type_form_parameters.js +2 -2
  127. package/build/src/rules/unnecessary_pragma.js +29 -29
  128. package/build/src/rules/unnecessary_return.js +11 -11
  129. package/build/src/rules/unused_macros.js +6 -6
  130. package/build/src/rules/unused_methods.js +12 -12
  131. package/build/src/rules/unused_variables.js +12 -12
  132. package/build/src/rules/use_bool_expression.js +8 -8
  133. package/build/src/rules/use_class_based_exceptions.js +8 -8
  134. package/build/src/rules/use_line_exists.js +7 -7
  135. package/build/src/rules/use_new.js +4 -4
  136. package/build/src/rules/when_others_last.js +6 -6
  137. package/build/src/rules/xml_consistency.js +3 -3
  138. package/package.json +72 -72
@@ -55,19 +55,19 @@ class NoCommentsBetweenMethods extends _abap_rule_1.ABAPRule {
55
55
  title: "No comments between methods in global classes",
56
56
  shortDescription: `It's not possible to have comments between methods in global classes.`,
57
57
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Syntax],
58
- badExample: `CLASS zcl_foo IMPLEMENTATION.
59
- METHOD first.
60
- ENDMETHOD.
61
- " comment
62
- METHOD second.
63
- ENDMETHOD.
58
+ badExample: `CLASS zcl_foo IMPLEMENTATION.
59
+ METHOD first.
60
+ ENDMETHOD.
61
+ " comment
62
+ METHOD second.
63
+ ENDMETHOD.
64
64
  ENDCLASS.`,
65
- goodExample: `CLASS zcl_foo IMPLEMENTATION.
66
- METHOD first.
67
- ENDMETHOD.
68
-
69
- METHOD second.
70
- ENDMETHOD.
65
+ goodExample: `CLASS zcl_foo IMPLEMENTATION.
66
+ METHOD first.
67
+ ENDMETHOD.
68
+
69
+ METHOD second.
70
+ ENDMETHOD.
71
71
  ENDCLASS.`,
72
72
  };
73
73
  }
@@ -53,8 +53,8 @@ class NoExternalFormCalls extends _abap_rule_1.ABAPRule {
53
53
  key: "no_external_form_calls",
54
54
  title: "No external FORM calls",
55
55
  shortDescription: `Detect external form calls`,
56
- badExample: `PERFORM foo IN PROGRAM bar.
57
-
56
+ badExample: `PERFORM foo IN PROGRAM bar.
57
+
58
58
  PERFORM foo(bar).`,
59
59
  tags: [_irule_1.RuleTag.SingleFile],
60
60
  };
@@ -54,17 +54,17 @@ class NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {
54
54
  key: "no_inline_in_optional_branches",
55
55
  title: "Don't declare inline in optional branches",
56
56
  shortDescription: `Don't declare inline in optional branches`,
57
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
58
-
59
- Considered optional branches:
60
- * inside IF/ELSEIF/ELSE
61
- * inside LOOP
62
- * inside WHILE
63
- * inside CASE/WHEN, CASE TYPE OF
64
- * inside DO
65
- * inside SELECT loops
66
-
67
- Not considered optional branches:
57
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches
58
+
59
+ Considered optional branches:
60
+ * inside IF/ELSEIF/ELSE
61
+ * inside LOOP
62
+ * inside WHILE
63
+ * inside CASE/WHEN, CASE TYPE OF
64
+ * inside DO
65
+ * inside SELECT loops
66
+
67
+ Not considered optional branches:
68
68
  * TRY/CATCH/CLEANUP`,
69
69
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
70
70
  };
@@ -80,7 +80,7 @@ Not considered optional branches:
80
80
  const release = this.reg.getConfig().getRelease();
81
81
  if (release === version_1.Release.v700
82
82
  || release === version_1.Release.v702
83
- || this.reg.getConfig().getOpenABAP()) {
83
+ || this.reg.getConfig().isOpenABAP()) {
84
84
  return [];
85
85
  }
86
86
  const struc = file.getStructure();
@@ -52,12 +52,12 @@ class NoMacros extends _abap_rule_1.ABAPRule {
52
52
  key: "no_macros",
53
53
  title: "No macros",
54
54
  shortDescription: `Checks that macros are not used`,
55
- extendedInformation: `Macros reduce readability and are difficult to debug, use methods or form routines instead.
56
-
55
+ extendedInformation: `Macros reduce readability and are difficult to debug, use methods or form routines instead.
56
+
57
57
  https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenmacros_guidl.htm`,
58
58
  tags: [_irule_1.RuleTag.SingleFile],
59
- badExample: `DEFINE _macro.
60
- WRITE 'hello'.
59
+ badExample: `DEFINE _macro.
60
+ WRITE 'hello'.
61
61
  END-OF-DEFINITION.`,
62
62
  goodExample: `WRITE 'hello'.`,
63
63
  };
@@ -77,12 +77,12 @@ class NoPrefixes extends _abap_rule_1.ABAPRule {
77
77
  key: "no_prefixes",
78
78
  title: "No Prefixes",
79
79
  shortDescription: `Dont use hungarian notation`,
80
- extendedInformation: `
81
- Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
82
- allowing all types to become voided, abaplint will then provide less precise syntax errors.
83
-
84
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
85
-
80
+ extendedInformation: `
81
+ Note: not prefixing TYPES will require changing the errorNamespace in the abaplint configuration,
82
+ allowing all types to become voided, abaplint will then provide less precise syntax errors.
83
+
84
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-encodings-esp-hungarian-notation-and-prefixes
85
+
86
86
  https://github.com/SAP/styleguides/blob/main/clean-abap/sub-sections/AvoidEncodings.md`,
87
87
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
88
88
  badExample: `DATA lv_foo TYPE i.`,
@@ -27,17 +27,17 @@ class NoPublicAttributes extends _abap_rule_1.ABAPRule {
27
27
  return {
28
28
  key: "no_public_attributes",
29
29
  title: "No public attributes",
30
- shortDescription: `Checks that classes and interfaces don't contain any public attributes.
30
+ shortDescription: `Checks that classes and interfaces don't contain any public attributes.
31
31
  Exceptions are excluded from this rule.`,
32
32
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,
33
33
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
34
- badExample: `CLASS zcl_foo DEFINITION PUBLIC.
35
- PUBLIC SECTION.
36
- DATA counter TYPE i.
34
+ badExample: `CLASS zcl_foo DEFINITION PUBLIC.
35
+ PUBLIC SECTION.
36
+ DATA counter TYPE i.
37
37
  ENDCLASS.`,
38
- goodExample: `CLASS zcl_foo DEFINITION PUBLIC.
39
- PRIVATE SECTION.
40
- DATA counter TYPE i.
38
+ goodExample: `CLASS zcl_foo DEFINITION PUBLIC.
39
+ PRIVATE SECTION.
40
+ DATA counter TYPE i.
41
41
  ENDCLASS.`,
42
42
  };
43
43
  }
@@ -57,13 +57,13 @@ class NoYodaConditions extends _abap_rule_1.ABAPRule {
57
57
  key: "no_yoda_conditions",
58
58
  title: "No Yoda conditions",
59
59
  shortDescription: `Finds Yoda conditions and reports issues`,
60
- extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
61
-
60
+ extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions
61
+
62
62
  Conditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,
63
63
  tags: [_irule_1.RuleTag.SingleFile],
64
- badExample: `IF 0 <> sy-subrc.
64
+ badExample: `IF 0 <> sy-subrc.
65
65
  ENDIF.`,
66
- goodExample: `IF sy-subrc <> 0.
66
+ goodExample: `IF sy-subrc <> 0.
67
67
  ENDIF.`,
68
68
  };
69
69
  }
@@ -50,8 +50,8 @@ class NROBConsistency {
50
50
  key: "nrob_consistency",
51
51
  title: "Number range consistency",
52
52
  shortDescription: `Consistency checks for number ranges`,
53
- extendedInformation: `Issue reported if percentage warning is over 50%
54
-
53
+ extendedInformation: `Issue reported if percentage warning is over 50%
54
+
55
55
  Issue reported if the referenced domain is not found(taking error namespace into account)`,
56
56
  tags: [_irule_1.RuleTag.SingleFile],
57
57
  };
@@ -126,58 +126,58 @@ class ObsoleteStatement extends _abap_rule_1.ABAPRule {
126
126
  title: "Obsolete statements",
127
127
  shortDescription: `Checks for usages of certain obsolete statements`,
128
128
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
129
- extendedInformation: `
130
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
131
-
132
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
133
-
134
- SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
135
-
136
- IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
137
-
138
- WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
139
-
140
- FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
141
-
142
- TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
143
-
144
- LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
145
-
146
- COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
147
-
148
- OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
149
-
150
- PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
151
-
152
- RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
153
-
154
- PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
155
-
156
- MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
157
-
158
- SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
159
- SELECT COUNT(*) is considered okay
160
-
161
- FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
162
-
163
- SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
164
-
165
- CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
166
-
167
- POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
168
-
169
- OCCURENCES: check for OCCURENCES vs OCCURRENCES
170
-
129
+ extendedInformation: `
130
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs
131
+
132
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements
133
+
134
+ SET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm
135
+
136
+ IS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm
137
+
138
+ WITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm
139
+
140
+ FIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm
141
+
142
+ TYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
143
+
144
+ LOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm
145
+
146
+ COMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm
147
+
148
+ OCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm
149
+
150
+ PARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm
151
+
152
+ RANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm
153
+
154
+ PACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm
155
+
156
+ MOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm
157
+
158
+ SELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm
159
+ SELECT COUNT(*) is considered okay
160
+
161
+ FREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm
162
+
163
+ SORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm
164
+
165
+ CALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm
166
+
167
+ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm
168
+
169
+ OCCURENCES: check for OCCURENCES vs OCCURRENCES
170
+
171
171
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
172
- badExample: `REFRESH itab.
173
-
174
- COMPUTE foo = 2 + 2.
175
-
176
- MULTIPLY lv_foo BY 2.
177
-
178
- INTERFACE intf LOAD.
179
-
180
- IF foo IS SUPPLIED.
172
+ badExample: `REFRESH itab.
173
+
174
+ COMPUTE foo = 2 + 2.
175
+
176
+ MULTIPLY lv_foo BY 2.
177
+
178
+ INTERFACE intf LOAD.
179
+
180
+ IF foo IS SUPPLIED.
181
181
  ENDIF.`,
182
182
  };
183
183
  }
@@ -56,9 +56,9 @@ class OmitParameterName {
56
56
  key: "omit_parameter_name",
57
57
  title: "Omit parameter name",
58
58
  shortDescription: `Omit the parameter name in single parameter calls`,
59
- extendedInformation: `
60
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
61
-
59
+ extendedInformation: `
60
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls
61
+
62
62
  EXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,
63
63
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
64
64
  badExample: `method( param = 2 ).`,
@@ -54,20 +54,20 @@ class OmitReceiving extends _abap_rule_1.ABAPRule {
54
54
  shortDescription: `Omit RECEIVING`,
55
55
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,
56
56
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
57
- badExample: `
58
- upload_pack(
59
- EXPORTING
60
- io_client = lo_client
61
- iv_url = iv_url
62
- iv_deepen_level = iv_deepen_level
63
- it_hashes = lt_hashes
64
- RECEIVING
57
+ badExample: `
58
+ upload_pack(
59
+ EXPORTING
60
+ io_client = lo_client
61
+ iv_url = iv_url
62
+ iv_deepen_level = iv_deepen_level
63
+ it_hashes = lt_hashes
64
+ RECEIVING
65
65
  rt_objects = et_objects ).`,
66
- goodExample: `
67
- et_objects = upload_pack(
68
- io_client = lo_client
69
- iv_url = iv_url
70
- iv_deepen_level = iv_deepen_level
66
+ goodExample: `
67
+ et_objects = upload_pack(
68
+ io_client = lo_client
69
+ iv_url = iv_url
70
+ iv_deepen_level = iv_deepen_level
71
71
  it_hashes = lt_hashes ).`,
72
72
  };
73
73
  }
@@ -53,8 +53,8 @@ class Parser702Chaining extends _abap_rule_1.ABAPRule {
53
53
  return {
54
54
  key: "parser_702_chaining",
55
55
  title: "Parser Error, bad chaining on 702",
56
- shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
57
- this rule finds these and reports errors.
56
+ shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,
57
+ this rule finds these and reports errors.
58
58
  Only active on target version 702 and below.`,
59
59
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
60
60
  };
@@ -19,8 +19,8 @@ class ParserError {
19
19
  return {
20
20
  key: "parser_error",
21
21
  title: "Parser error",
22
- shortDescription: `Checks for syntax not recognized by abaplint.
23
-
22
+ shortDescription: `Checks for syntax not recognized by abaplint.
23
+
24
24
  See recognized syntax at https://syntax.abaplint.org`,
25
25
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
26
26
  };
@@ -54,7 +54,7 @@ class ParserMissingSpace extends _abap_rule_1.ABAPRule {
54
54
  return {
55
55
  key: "parser_missing_space",
56
56
  title: "Parser Error, missing space",
57
- shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
57
+ shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.
58
58
  This rule makes sure the spaces are consistently required across the language.`,
59
59
  tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],
60
60
  badExample: `IF ( foo = 'bar').`,
@@ -57,25 +57,25 @@ class PreferInline {
57
57
  key: "prefer_inline",
58
58
  title: "Prefer Inline Declarations",
59
59
  shortDescription: `Prefer inline to up-front declarations.`,
60
- extendedInformation: `EXPERIMENTAL
61
-
62
- Activates if language version is v740sp02 or above.
63
-
64
- Variables must be local(METHOD or FORM).
65
-
66
- No generic or void typed variables. No syntax errors.
67
-
68
- First position used must be a full/pure write.
69
-
70
- Move statment is not a cast(?=)
71
-
60
+ extendedInformation: `EXPERIMENTAL
61
+
62
+ Activates if language version is v740sp02 or above.
63
+
64
+ Variables must be local(METHOD or FORM).
65
+
66
+ No generic or void typed variables. No syntax errors.
67
+
68
+ First position used must be a full/pure write.
69
+
70
+ Move statment is not a cast(?=)
71
+
72
72
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,
73
73
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],
74
- badExample: `DATA foo TYPE i.
75
- foo = 2.
76
- DATA percentage TYPE decfloat34.
74
+ badExample: `DATA foo TYPE i.
75
+ foo = 2.
76
+ DATA percentage TYPE decfloat34.
77
77
  percentage = ( comment_number / abs_statement_number ) * 100.`,
78
- goodExample: `DATA(foo) = 2.
78
+ goodExample: `DATA(foo) = 2.
79
79
  DATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,
80
80
  };
81
81
  }
@@ -54,18 +54,18 @@ class PreferIsNot extends _abap_rule_1.ABAPRule {
54
54
  key: "prefer_is_not",
55
55
  title: "Prefer IS NOT to NOT IS",
56
56
  shortDescription: `Prefer IS NOT to NOT IS`,
57
- extendedInformation: `
58
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
59
-
57
+ extendedInformation: `
58
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is
59
+
60
60
  "if not is_valid( )." examples are skipped`,
61
61
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
62
- goodExample: `IF variable IS NOT INITIAL.
63
- IF variable NP 'TODO*'.
64
- IF variable <> 42.
62
+ goodExample: `IF variable IS NOT INITIAL.
63
+ IF variable NP 'TODO*'.
64
+ IF variable <> 42.
65
65
  IF variable CO 'hello'.`,
66
- badExample: `IF NOT variable IS INITIAL.
67
- IF NOT variable CP 'TODO*'.
68
- IF NOT variable = 42.
66
+ badExample: `IF NOT variable IS INITIAL.
67
+ IF NOT variable CP 'TODO*'.
68
+ IF NOT variable = 42.
69
69
  IF NOT variable CA 'hello'.`,
70
70
  };
71
71
  }
@@ -54,14 +54,14 @@ class PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {
54
54
  key: "prefer_raise_exception_new",
55
55
  title: "Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE",
56
56
  shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,
57
- extendedInformation: `
58
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
59
-
57
+ extendedInformation: `
58
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type
59
+
60
60
  From 752 and up`,
61
61
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Upport],
62
62
  goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,
63
- badExample: `RAISE EXCEPTION TYPE cx_generation_error
64
- EXPORTING
63
+ badExample: `RAISE EXCEPTION TYPE cx_generation_error
64
+ EXPORTING
65
65
  previous = exception.`,
66
66
  };
67
67
  }
@@ -53,12 +53,12 @@ class PreferReturningToExporting extends _abap_rule_1.ABAPRule {
53
53
  key: "prefer_returning_to_exporting",
54
54
  title: "Prefer RETURNING to EXPORTING",
55
55
  shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,
56
- extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
56
+ extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting
57
57
  https://docs.abapopenchecks.org/checks/44/`,
58
58
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
59
- badExample: `CLASS lcl DEFINITION.
60
- PUBLIC SECTION.
61
- METHODS test EXPORTING ev_foo TYPE i.
59
+ badExample: `CLASS lcl DEFINITION.
60
+ PUBLIC SECTION.
61
+ METHODS test EXPORTING ev_foo TYPE i.
62
62
  ENDCLASS.`,
63
63
  };
64
64
  }
@@ -54,8 +54,8 @@ class PreferXsdbool extends _abap_rule_1.ABAPRule {
54
54
  key: "prefer_xsdbool",
55
55
  title: "Prefer xsdbool over boolc",
56
56
  shortDescription: `Prefer xsdbool over boolc`,
57
- extendedInformation: `Activates if language version is v740sp08 or above.
58
-
57
+ extendedInformation: `Activates if language version is v740sp08 or above.
58
+
59
59
  https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,
60
60
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
61
61
  badExample: `DATA(sdf) = boolc( 1 = 2 ).`,
@@ -60,9 +60,9 @@ class PreferredCompareOperator extends _abap_rule_1.ABAPRule {
60
60
  title: "Preferred compare operator",
61
61
  shortDescription: `Configure undesired operator variants`,
62
62
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],
63
- badExample: `IF foo EQ bar.
63
+ badExample: `IF foo EQ bar.
64
64
  ENDIF.`,
65
- goodExample: `IF foo = bar.
65
+ goodExample: `IF foo = bar.
66
66
  ENDIF.`,
67
67
  };
68
68
  }
@@ -67,13 +67,13 @@ class PrefixIsCurrentClass extends _abap_rule_1.ABAPRule {
67
67
  // eslint-disable-next-line max-len
68
68
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-self-reference-me-when-calling-an-instance-attribute-or-method`,
69
69
  tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
70
- badExample: `METHOD run.
71
- zcl_current=>helper( ).
72
- me->do_work( ).
70
+ badExample: `METHOD run.
71
+ zcl_current=>helper( ).
72
+ me->do_work( ).
73
73
  ENDMETHOD.`,
74
- goodExample: `METHOD run.
75
- helper( ).
76
- do_work( ).
74
+ goodExample: `METHOD run.
75
+ helper( ).
76
+ do_work( ).
77
77
  ENDMETHOD.`,
78
78
  };
79
79
  }
@@ -57,26 +57,26 @@ class ReduceProceduralCode extends _abap_rule_1.ABAPRule {
57
57
  key: "reduce_procedural_code",
58
58
  title: "Reduce procedural code",
59
59
  shortDescription: `Checks FORM and FUNCTION-MODULE have few statements`,
60
- extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
61
-
62
- https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
63
-
60
+ extendedInformation: `Delegate logic to a class method instead of using FORM or FUNCTION-MODULE.
61
+
62
+ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-object-orientation-to-procedural-programming
63
+
64
64
  Comments are not counted as statements.`,
65
65
  tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
66
- badExample: `FORM foo.
67
- DATA lv_bar TYPE i.
68
- lv_bar = 2 + 2.
69
- IF lv_bar = 4.
70
- WRITE 'hello world'.
71
- ENDIF.
72
- DATA lv_bar TYPE i.
73
- lv_bar = 2 + 2.
74
- IF lv_bar = 4.
75
- WRITE 'hello world'.
76
- ENDIF.
66
+ badExample: `FORM foo.
67
+ DATA lv_bar TYPE i.
68
+ lv_bar = 2 + 2.
69
+ IF lv_bar = 4.
70
+ WRITE 'hello world'.
71
+ ENDIF.
72
+ DATA lv_bar TYPE i.
73
+ lv_bar = 2 + 2.
74
+ IF lv_bar = 4.
75
+ WRITE 'hello world'.
76
+ ENDIF.
77
77
  ENDFORM.`,
78
- goodExample: `FORM foo.
79
- NEW zcl_global_class( )->run_logic( ).
78
+ goodExample: `FORM foo.
79
+ NEW zcl_global_class( )->run_logic( ).
80
80
  ENDFORM.`,
81
81
  };
82
82
  }