Summary: information about the Call Hierarchy feature introduced in CAST Imaging ≥ 2.12.
Introduction
Navigating through a large codebase is time-consuming, inefficient and prone to oversight as developers may need to manually search for method or function usages.
Call Hierarchy helps developers understand the flow of code execution by displaying the callers and callees of a selected element. By examining the call hierarchy of a particular element, developers can assess the potential impact of making changes to that element. They can determine which parts of the codebase rely on the selected element and understand the ripple effects that modifications may have on other components. They can identify methods or functions that are frequently called and extract them into reusable components or libraries.
Several similar features are available in the UI: Path Finder, Show Paths, Start Points, and End Points and Call Hierarchy - the basic differences are as follows:
- Show Paths (renamed as Highlight Path) displays all paths between the two selected objects based on callee links .
- Path Finder not only displays all paths between two selected objects using any link type, but also the shortest path. Additional filtering can also be applied to the results, for example, the ability to:
- choose the specific link types between the source and target objects
- choose the number of "hops" between the source and target objects
- Start Points and End Points displays the start points and end points linked to a selected element.
- Call Hierarchy displays a comprehensive call graph for a chosen element, showcasing its callers, callees, or both.
Accessing the feature
To access the Call Hierarchy feature, you must be working at Object level in any scope:
Right click an object in the view and select Call Hierarchy from the contextual menu - this object will then be designated the source object:
Using the feature
When the Call Hierarchy option is clicked, the following dialog box is displayed enabling you to configure how the feature will function:
≥ 2.17 | |
---|---|
≥ 2.13 | |
2.12 |
Item | Description |
---|---|
Information |
|
Select link type | Choose the type of links that will be taken into account by the Call Hierarchy feature:
|
Number of depths | Defines the maximum number of levels in the call graph. By default this is set to 4 and can be changed as required. Note that changing to above 10 can impact performance - the higher the number, the more objects need to be discovered, therefore impacting performance. |
Complete Call Graph | Available in ≥ 2.17. Select this option to choose the maximum depth available for the specific link type you have selected. If you have chosen Caller and Callee (the joint option), then the maximum depth chosen will be the higher of the two link types. |
Hide external objects | Not available in ≥ 2.17. By default in these releases, external objects and main object + sub objects are ALWAYS shown. Use these options to filter the type of objects in the results:
|
Main objects only |
Results
The example below shows a source object "authors" at the bottoms of the image and then varying levels of callers (those objects calling the source object):
Click to enlarge