Given an existing JSP project, I would like to get a feel for the complexity/size of the "view" portion of the project. Here's what I've done so far:
- Pulled the list of JSP's that have been compiled from the production server within the last x months (that eliminates 'dead' jsps).
- Wrote a quick scanner to find the JSP fragment files that are imported into the compiled pages.
- Pulled the size of the file and the timestamp off the file system.
So now I have a list of pages and the fragments imported into those pages, along with their size, and the last time they were compiled and changed.
But what I really need to know is how complicated the page is; some of these pages have a whole lot of Java code on them. It's a big project, so to go through each page and size it would be tedious and probably not that accurate.
I was going to write another scanner that measured the code between <% and %>, but I wondered if there was some kind of metrics generator out there that could already do that. I would like it to output how "big" the page was and how "big" the code on the page was. The point is to segregate the small, medium, big, and huge pages, so the absolute measurement is less important than the relative.
EDIT: Wrote another scanner to count number of JavaScript lines, Java (Scriptlet) lines, HTML lines, and instances of taglib useage. So by using the results of the scanner, I have some parameters that would indicate 'complexity'. Not real clean, but it's ok for now.