abaplint-sci-client icon indicating copy to clipboard operation
abaplint-sci-client copied to clipboard

option to run without dependency resolution

Open BlackmanCC opened this issue 2 years ago • 0 comments

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 ).

BlackmanCC avatar Jan 05 '23 12:01 BlackmanCC