abapinho / abapTimeMachine

ABAP Time Machine provides a much needed way to look at past versions of code in a consistent way. It also provides a sort of git-blame for ABAP (shows the request and author that last modified each line of code).
MIT License
65 stars 12 forks source link

Statistics: Commented lines: Distinguish commented code from comments #73

Open nununo opened 3 years ago

larshp commented 2 years ago

suggest pushing the history to git

nununo commented 2 years ago

You mean... starting from the first version and artificially creating a commit on each new change? That could work, yes. But this would create a complex dependency on an external system. I like it that today abapTimeMachine is simple and straightforward to use.

For example, my current client has old and established habits and in order to introduce something new, that something must be proven to be simple, risk free and easy to understand by those who will both approve it and use it.

larshp commented 2 years ago

well, if the client runs SAP, the company is typically of a decent size.

I'd assume all companies of decent size already use git in their IT departments

nununo commented 2 years ago

Maybe. But my experience tells me that in most of these big organisations, this kind of changes is not always easy to implement (even if technically is very simple).

Regardless, if I were to do it, it would already have to be an optional advanced setting, because I really like it that abapTimeMachine is so simple and straightforward to use.

larshp commented 2 years ago

yea 👍 organizations are difficult

nununo commented 2 years ago

I could use something similar to what abapOpenChecks is doing in ZCL_AOC_CHECK_14 + ZCL_AOC_PARSER. But I'm trying to debug the code inspector checks and, for some strange reason, my breakpoints are ignored.

ZCL_AOC_PARSER-=>RUN() is calling this internal command submitting commented lines to find out if they're valid ABAP code:

SCAN ABAP-SOURCE it_code
  TOKENS INTO lt_tokens
  STATEMENTS INTO lt_statements
  WITH ANALYSIS.
IF sy-subrc <> 0.
  rs_result-match = abap_false.
  RETURN.
ENDIF.

But, since I want to find out how many commented lines are actually ABAP code, it seems that I need to send it one ABAP command at a time (which may be comprised of multiple lines) otherwise it returns false if at least one line is not valid ABAP code. I still didn't figure out a simple way to do this.