Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to run without dependency resolution #276

Open
BlackmanCC opened this issue Jan 5, 2023 · 0 comments
Open

option to run without dependency resolution #276

BlackmanCC opened this issue Jan 5, 2023 · 0 comments

Comments

@BlackmanCC
Copy link
Contributor

I found out that the dependency resolution is quite slow and not needed in every use case.
There are many checks that do not rely in dependency resolution.
Because of this I would suggest to drop the dependency resolution if depth in config is 0.

You need to be careful with this, because there are checks that rely on the dependencies and do not work (correctly) if you turn it off.

I think there are 2 coding parts to change:

  1. ZCL_ABAPLINT_DEPS_FIND->CONSTRUCTOR

before

   ms_options = is_options.
   IF ms_options-depth IS INITIAL.
      ms_options-depth = 20.
    ENDIF.

    ms_types = prepare_supported_types( ).

    CREATE OBJECT mi_log TYPE zcl_abapgit_log.

after

   ms_options = is_options.
   ms_types = prepare_supported_types( ).

    CREATE OBJECT mi_log TYPE zcl_abapgit_log.
  1. ZCL_ABAPLINT_BACKEND->BUILD_DEPS

before

    DATA lt_files TYPE string_table.
    DATA lo_deps TYPE REF TO zcl_abaplint_deps.
    DATA lt_found TYPE zif_abapgit_definitions=>ty_files_tt.

    CREATE OBJECT lo_deps.
    lt_found = lo_deps->find(
      is_options     = ms_config
      iv_object_type = iv_object_type
      iv_object_name = iv_object_name ).

after

    DATA lt_files TYPE string_table.
    DATA lo_deps TYPE REF TO zcl_abaplint_deps.
    DATA lt_found TYPE zif_abapgit_definitions=>ty_files_tt.

    "Depth 0 means do not build deps
    "Be careful, because only some checks work without dependencies
    IF ms_config-depth = 0.
      rv_files = |[{ rv_files }]|.
      RETURN.
    ENDIF.

    CREATE OBJECT lo_deps.
    lt_found = lo_deps->find(
      is_options     = ms_config
      iv_object_type = iv_object_type
      iv_object_name = iv_object_name ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant