abapTimeMachine icon indicating copy to clipboard operation
abapTimeMachine copied to clipboard

Statistics: Commented lines: Distinguish commented code from comments

Open nununo opened this issue 3 years ago • 6 comments

nununo avatar Jun 07 '21 11:06 nununo

suggest pushing the history to git

larshp avatar Oct 25 '21 18:10 larshp

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.

nununo avatar Jan 03 '22 14:01 nununo

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

larshp avatar Jan 03 '22 15:01 larshp

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.

nununo avatar Jan 03 '22 16:01 nununo

yea 👍 organizations are difficult

larshp avatar Jan 03 '22 16:01 larshp

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.

nununo avatar Jun 17 '22 17:06 nununo