Introduction
jsourceprofiler is a command-line Java profiler that measures the frequency of method invocations and code block executions in Java programs. It can be used to quickly identify hotspots in a Java program and to determine code coverage. The tool will parse and instrument source files automatically, compile them, run the program (with arguments), and generate an HTML report.
It was designed to be a command line tool that can easily be used in scripts, CI/CD pipelines, and automation. For Java/programming beginners, or users who are less familiar with the command line, a JavaFX tool-runner GUI was created (see JavaFx UI section).
The five main stages of the profiler are:

This profiler instruments source code directly (as opposed to commonly used bytecode instrumentation) by inserting counter-statements at the beginning of every executable code block. Libraries or frameworks are not instrumented, only the user's code is.
Blocks are found by parsing Java files with a recursive descent Scanner and Parser generated by the Coco/R tool using an attributed grammar (ATG). The ATG is tailored to the use-case of finding code blocks in a "fuzzy" way. (For details see Implementation Details section). This allows the grammar to be of minimal size and complexity and improves maintainability against the constantly updating and growing Java Language Specification.
Compilation and execution are done using the Java Development Kit (JDK) tools javac and java.
Build tools like Maven, Gradle, or Ant are currently not supported and may require manual intervention.
The report provides a structured and sorted overview over the most frequently invoked methods and other useful metrics for each class and its methods. It further allows detailed exploration of source files and shows coverage (with counts) of grouped statements regions.