GPS provides an interface with the GNAT software metrics generation tool
gnatmetric
.
The metrics can be computed for the one source file, for the current project, or for the current project and its imported subprojects
The metrics generator can be invoked either from the Tools->Metrics
menu or from the contextual menu.
The Metrics
submenu is available from the Tools
global menu and
contains:
When relevant (depending on the context), right-clicking with your mouse will show metrics-related contextual menu entries.
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.
After having computed metrics, a new window in the left-side area is displayed showing 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.