Skip to content

Commit

Permalink
remove some chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp committed Apr 12, 2024
1 parent 7130aca commit 8b6758e
Show file tree
Hide file tree
Showing 92 changed files with 345 additions and 345 deletions.
2 changes: 1 addition & 1 deletion abaplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"slow_parameter_passing": true,
"static_call_via_instance": true,
"superfluous_value": true,
"unnecessary_chaining": false,
"unnecessary_chaining": true,
"unnecessary_pragma": true,
"unsecure_fae": true,
"use_class_based_exceptions": true,
Expand Down
8 changes: 4 additions & 4 deletions src/integer/zcl_abappgp_binary_integer.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ CLASS zcl_abappgp_binary_integer IMPLEMENTATION.

METHOD constructor.

DATA: lo_int TYPE REF TO zcl_abappgp_integer.
DATA lo_int TYPE REF TO zcl_abappgp_integer.

IF go_two IS INITIAL.
CREATE OBJECT go_two
Expand Down Expand Up @@ -131,7 +131,7 @@ CLASS zcl_abappgp_binary_integer IMPLEMENTATION.

METHOD from_string.

DATA: lo_integer TYPE REF TO zcl_abappgp_integer.
DATA lo_integer TYPE REF TO zcl_abappgp_integer.


lo_integer = zcl_abappgp_integer=>from_string( iv_string ).
Expand Down Expand Up @@ -159,7 +159,7 @@ CLASS zcl_abappgp_binary_integer IMPLEMENTATION.

METHOD mod_2.

DATA: lv_length TYPE i.
DATA lv_length TYPE i.

lv_length = strlen( mv_data ) - 1.

Expand Down Expand Up @@ -187,7 +187,7 @@ CLASS zcl_abappgp_binary_integer IMPLEMENTATION.

METHOD shift_right.

DATA: lv_length TYPE i.
DATA lv_length TYPE i.

ASSERT iv_times >= 1.

Expand Down
48 changes: 24 additions & 24 deletions src/integer/zcl_abappgp_binary_integer.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CLASS ltcl_and DEFINITION FOR TESTING
and2 FOR TESTING,
and3 FOR TESTING.

METHODS:
METHODS
test IMPORTING iv_op1 TYPE string
iv_op2 TYPE string
RETURNING VALUE(rv_result) TYPE string.
Expand All @@ -33,7 +33,7 @@ CLASS ltcl_and IMPLEMENTATION.

METHOD and1.

DATA: lv_result TYPE string.
DATA lv_result TYPE string.

lv_result = test( iv_op1 = '16'
iv_op2 = '16' ).
Expand All @@ -46,7 +46,7 @@ CLASS ltcl_and IMPLEMENTATION.

METHOD and2.

DATA: lv_result TYPE string.
DATA lv_result TYPE string.

lv_result = test( iv_op1 = '32'
iv_op2 = '16' ).
Expand All @@ -59,7 +59,7 @@ CLASS ltcl_and IMPLEMENTATION.

METHOD and3.

DATA: lv_result TYPE string.
DATA lv_result TYPE string.

lv_result = test( iv_op1 = '48'
iv_op2 = '16' ).
Expand All @@ -79,10 +79,10 @@ CLASS ltcl_mod DEFINITION FOR TESTING
FINAL.

PRIVATE SECTION.
METHODS:
METHODS
mod1 FOR TESTING.

METHODS:
METHODS
test IMPORTING iv_str TYPE string
RETURNING VALUE(rv_result) TYPE i.

Expand All @@ -92,7 +92,7 @@ CLASS ltcl_mod IMPLEMENTATION.

METHOD test.

DATA: lo_binary TYPE REF TO zcl_abappgp_binary_integer.
DATA lo_binary TYPE REF TO zcl_abappgp_binary_integer.


lo_binary = zcl_abappgp_binary_integer=>from_string( iv_str ).
Expand All @@ -102,7 +102,7 @@ CLASS ltcl_mod IMPLEMENTATION.

METHOD mod1.

DATA: lv_result TYPE i.
DATA lv_result TYPE i.

lv_result = test( '3' ).

Expand All @@ -121,10 +121,10 @@ CLASS ltcl_shift_right DEFINITION FOR TESTING
FINAL.

PRIVATE SECTION.
METHODS:
METHODS
shift1 FOR TESTING.

METHODS:
METHODS
test IMPORTING iv_str TYPE string
RETURNING VALUE(rv_str) TYPE string.

Expand All @@ -134,7 +134,7 @@ CLASS ltcl_shift_right IMPLEMENTATION.

METHOD test.

DATA: lo_binary TYPE REF TO zcl_abappgp_binary_integer.
DATA lo_binary TYPE REF TO zcl_abappgp_binary_integer.


lo_binary = zcl_abappgp_binary_integer=>from_string( iv_str ).
Expand All @@ -145,7 +145,7 @@ CLASS ltcl_shift_right IMPLEMENTATION.

METHOD shift1.

DATA: lv_result TYPE string.
DATA lv_result TYPE string.

lv_result = test( '16' ).

Expand All @@ -169,15 +169,15 @@ CLASS ltcl_identity DEFINITION FOR TESTING
identity3 FOR TESTING,
identity4 FOR TESTING.

METHODS: test IMPORTING iv_input TYPE string.
METHODS test IMPORTING iv_input TYPE string.

ENDCLASS. "ltcl_Get

CLASS ltcl_identity IMPLEMENTATION.

METHOD test.

DATA: lo_binary TYPE REF TO zcl_abappgp_binary_integer.
DATA lo_binary TYPE REF TO zcl_abappgp_binary_integer.


lo_binary = zcl_abappgp_binary_integer=>from_string( iv_input ).
Expand Down Expand Up @@ -222,7 +222,7 @@ CLASS ltcl_to_binary_string DEFINITION FOR TESTING
get7 FOR TESTING,
get8 FOR TESTING.

METHODS: test IMPORTING iv_str TYPE string
METHODS test IMPORTING iv_str TYPE string
RETURNING VALUE(rv_binary) TYPE string.

ENDCLASS. "ltcl_Get
Expand All @@ -231,7 +231,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD test.

DATA: lo_binary TYPE REF TO zcl_abappgp_binary_integer.
DATA lo_binary TYPE REF TO zcl_abappgp_binary_integer.


lo_binary = zcl_abappgp_binary_integer=>from_string( iv_str ).
Expand All @@ -241,7 +241,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get1.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '16' ).

Expand All @@ -253,7 +253,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get2.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '1234' ).

Expand All @@ -265,7 +265,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get3.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '1' ).

Expand All @@ -277,7 +277,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get4.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '8191' ).

Expand All @@ -289,7 +289,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get5.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '8192' ).

Expand All @@ -301,7 +301,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get6.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '8193' ).

Expand All @@ -313,7 +313,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get7.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '9000' ).

Expand All @@ -325,7 +325,7 @@ CLASS ltcl_to_binary_string IMPLEMENTATION.

METHOD get8.

DATA: lv_binary TYPE string.
DATA lv_binary TYPE string.

lv_binary = test( '10000' ).

Expand Down
28 changes: 14 additions & 14 deletions src/integer/zcl_abappgp_integer.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ CLASS zcl_abappgp_integer DEFINITION
PROTECTED SECTION.

TYPES ty_split TYPE i .
TYPES:
TYPES
ty_split_tt TYPE STANDARD TABLE OF ty_split WITH DEFAULT KEY .

DATA mv_negative TYPE abap_bool .
Expand Down Expand Up @@ -413,7 +413,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD divide_by_10.

DATA: lv_int TYPE i.
DATA lv_int TYPE i.


DO iv_times DIV gv_length TIMES.
Expand Down Expand Up @@ -716,7 +716,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD from_high_length.

DATA: lv_str TYPE string.
DATA lv_str TYPE string.


ASSERT iv_count >= 1.
Expand All @@ -732,7 +732,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD from_low_length.

DATA: lv_str TYPE string.
DATA lv_str TYPE string.


ASSERT iv_count >= 1.
Expand All @@ -750,7 +750,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD from_string.

DATA: lv_str TYPE string.
DATA lv_str TYPE string.


lv_str = iv_integer.
Expand Down Expand Up @@ -810,7 +810,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD is_eq.

DATA: lv_index TYPE i.
DATA lv_index TYPE i.

FIELD-SYMBOLS: <lv_op1> LIKE LINE OF mt_split,
<lv_op2> LIKE LINE OF mt_split.
Expand Down Expand Up @@ -945,7 +945,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD is_one.

DATA: lv_value LIKE LINE OF mt_split.
DATA lv_value LIKE LINE OF mt_split.


IF lines( mt_split ) <> 1 OR mv_negative = abap_true.
Expand All @@ -970,7 +970,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD is_two.

FIELD-SYMBOLS: <lv_value> LIKE LINE OF mt_split.
FIELD-SYMBOLS <lv_value> LIKE LINE OF mt_split.


IF lines( mt_split ) <> 1 OR mv_negative = abap_true.
Expand All @@ -986,7 +986,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD is_zero.

DATA: lv_value TYPE ty_split.
DATA lv_value TYPE ty_split.


IF lines( mt_split ) <> 1.
Expand Down Expand Up @@ -1135,7 +1135,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD mod_2.

DATA: lv_value TYPE ty_split.
DATA lv_value TYPE ty_split.

* only the first digit is relevant for calculating MOD2
READ TABLE mt_split INDEX 1 INTO lv_value. "#EC CI_SUBRC
Expand Down Expand Up @@ -1280,7 +1280,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD multiply_10.

DATA: lv_int TYPE i.
DATA lv_int TYPE i.


ro_result = me.
Expand Down Expand Up @@ -1314,7 +1314,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD multiply_int.

DATA: lv_str TYPE string.
DATA lv_str TYPE string.


ASSERT iv_integer >= 0.
Expand Down Expand Up @@ -1484,7 +1484,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD split_at.

DATA: lv_split TYPE ty_split.
DATA lv_split TYPE ty_split.


CREATE OBJECT eo_low.
Expand Down Expand Up @@ -1613,7 +1613,7 @@ CLASS ZCL_ABAPPGP_INTEGER IMPLEMENTATION.

METHOD to_string.

DATA: lv_int TYPE string.
DATA lv_int TYPE string.

LOOP AT mt_split INTO lv_int.
CONDENSE lv_int.
Expand Down
Loading

0 comments on commit 8b6758e

Please sign in to comment.