GPS provides an interface with the GNAT software metrics generation tool
gnatmetric
.
The metrics can be computed for the entire project, one source file belonging to the project, or (when applicable) a specific entity in the source file, e.g. a subprogram.
The metrics generator can be invoked from two places inside GPS:
From a source file contextual menu, you have an option called Metrics for file that will generate the metrics for the current file.
From a project contextual menu (see The Project View), you have an option Metrics for project that will generate the metrics for all files in the project.
Each of these commands produces a new window in the left-side area, which shows the computed metrics as a hierarchical tree view. The metrics are arranged by files, and then by scopes inside the files in a nested fashion. Double-clicking on any of the files or scopes displayed will open the appropriate source location in the editor. Any errors encountered during metrics computation will be displayed in the Locations Window.