Skip to content

Code Duplication: Resolvers, regex validation, auth patterns #27

Description

@MagPasulke

Code Duplication

1. Resolver classes are nearly identical

  • \src/bo/zasis_cl_customlogic_resolver.clas.abap\
  • \src/bo/zasis_cl_ev_producer_resolver.clas.abap\

Both follow the exact same flow: to_upper → check_implements → CREATE OBJECT → CAST. Only interface name and cast target differ. Could be generalized into a base class or generic resolver.

2. Regex validation duplicated in RAP behavior

File: \src/bo/zbp_asis_i_ruleset.clas.locals_imp.abap\

  • \checkIsValidRegex\ (lines 15-41)
  • \precheck_update\ (lines 86-100)

Same regex validation logic implemented twice with slightly different exception handling.

3. Authorization check boilerplate

File: \src/auth/zasis_cl_auth_checker.clas.abap\

Methods \check_read, \check_execute, \check_create, \check_change\ all follow the identical pattern. Could be one private method with an activity parameter.

4. RAP global authorization — 3 near-identical blocks

File: \src/bo/zbp_asis_i_ruleset.clas.locals_imp.abap:150-205\

Create/update/delete authorization blocks differ only in %create/%update/%delete field and activity value (01/02/06).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions