20.3.  Collaboration between Sonargraph and IDE

As of version 11.1, Sonargraph offers a close integration with the Eclipse plugin to make it easier to fix issues right away when analyzing the code base in Sonargraph. And also vice-versa, making it easy to investigate dependencies using Sonargraph's advanced visualizations when coding in the IDE.

NOTE

The integration is currently only implemented for the Eclipse plugin!

Interactions

  • Connect / Disconnect Connect / Disconnect: If selected, the application listens to incoming selection requests.

  • Send Selection Request Send Selection Request: Information about the current selection is sent.

  • Reveal Selection Request Reveal Selection Request:

    Sonargraph -> IDE: The matching element is highlighted in the 'Package Explorer' or 'Project Explorer' in Eclipse and if
    the selection has been within a source file in Sonargraph, the editor is opened automatically in Eclipse and the matching 
    line is selected.
        
    IDE -> Sonargraph: The matching element(s) are selected in the 'Navigation' view. From there the appropriate 
    visualization can be opened via the context menu.

NOTE

The following preconditions must be fulfilled for the integration to work:

  • The same Sonargraph system must be opened in Sonargraph and the IDE.

  • The receiving application must be 'connected', i.e. must listen to incoming selection requests.

NOTE

You need to manually trigger a refresh (F5) in Sonargraph after changing code in the IDE.

Configuration

Default ports for listening to selection requests are 42420 (Sonargraph) and 42421 (IDE). This can be changed via a preference page in Sonargraph or via the menu "Sonargraph""Configure Remote Selection..." in Eclipse.

NOTE

The configuration is shared between the two applications, so that ports need to be configured only once. Just re-connect in the other application to activate the new configuration.

Sample Use Cases

Fixing a Detected Issue in the IDE
Fixing a Detected Issue in the IDE
Figure 20.10. Fixing a Detected Issue in the IDE

Selecting Elements for Inspection in Sonargraph
Selecting Elements for Inspection in Sonargraph
Figure 20.11. Selecting Elements for Inspection in Sonargraph