Ask HN: Source code (Java) parser and/or static analysis tool

2 points by fedeb95 ↗ HN
Hi HN, for some project of mine I need a library or set of them to do the following:

Parse a potentially large code base and count, starting from an entry point that may be a main method or just a user selected method, and count how many method calls are made at the same level. Then for each call do the same recursively.

In the end I'd like to count how many calls there are for each level. Optionally I'd also like to count loops and ifs.

I think a parser or a static analysis tool could be best for the job but given I need a very simple thing (I think) I'd like to know the faster thing to get started with that gets the job done.

Thanks in advance.

2 comments

[ 3.7 ms ] story [ 17.6 ms ] thread
thanks. I stumbled into that but hasn't find a good tutorial. I understand there's a book but I was looking for something free. I'll look into that, meanwhile, have you got other options?