Code Comparison - Between Two Analysis of Same Code
How to Compare 2 Analyses of your Code
- Click on the ‘Comparison’ tab on the ribbon menu as shown below:
- The left section of the ‘Comparison’ tab allows you to compare 2 analyses of your code.
- In order to use this feature, your Visual Expert project must be analysed at least 2 times. These dropdowns contain the list of historical analyses.
- Select the analyses you need to compare.
- Select the required object in the Main View, and click on the ‘Compare 2 Analyses’ button in the ribbon menu.
You can choose any scope for your comparison
- You can compare only the objects of a given type.
In this case, select this type of object at the root of the treeview and VE will only compare the corresponding objects (PowerBuilder Windows in the example below, or stored procedures, tables, etc.).
- You can restrict the comparison to a specific object: select this object in the treeview and run the comparison
- You can compare all the objects of a given application: select this application in the section “application” of the treeview and run the comparison.
- You can compare all the objects of a given schema: select this schema in the treeview and run the comparison.
You can also select the "Compare 2 Analyses" macro in the Navigation bar.
Important: This option will not appear in the treeview until you properly configure the comparison (Please refer to point 1 to 3 above for more details).
While the Ribbon menu gives a quick access to comparison features, the navigation bar offers more comparison options:
Click the small wrench on the left to open the macro configurations. A popup will allow you to configure the result as per your need.
- Display a complete hierarchy
Allows you to see the result in a complete hierarchy including child objects and components.
- Display comments
Allows you to include comments in the result. This will help you to identify if the comments are added or modified between the two analyses.
- Show undefined elements
Allows you to include undefined elements in the result (these items are referenced in your code, but Visual Expert could not identify their nature, nor find their definition).
- Click on “Execute”, to instantly apply the changes and display the result without saving them.
- Click on “Save” to save the selection for future executions.
The comparison result is displayed in the Main View using different colour highlights:
You can configure multiple "pairs" of sets of code to be compared:
- Click Advanced Settings
- Select the code sets to be compared using the dropdowns
- Click on "+" to add them to the list.
- You can delete a "couple" by clicking on the red cross.
Watch this video tutorial to learn more about code comparison features in Visual Expert.
Also Compare References
Besides finding the changes made in the code of an object, you can also compare the references to this object. Visual Expert will show which references were added or removed to this object, between 2 code analyses.
To do this:
- In the ribbon menu, go to "Comparison".
- Select a previous code analysis to compare with the current one
- Select an object in the treeview
- In the navigation bar, click on "Compare references"