7.12.  Examining the Source Code

Anywhere in the Sonargraph workbench you have the option of double clicking (or right clicking + "Show In Source View") on an element to show the source code of the clicked element if that is available.

Source View
Figure 7.56. Source View

"Find Text" feature can be invoked with Ctrl-F (Command + F on Mac). If more than one occurrence of the search string is found, press F3 to jump to the next search result. In the Script view (see Chapter 10, Extending the Static Analysis ) and Architecture File view the search feature offers also "replace" and "replace all" to ease content edition.

Regular expressions can be used for advanced match and replace use cases. Line-breaks in the replacement text can be specified with \R. The implementation uses standard Java regular expression API and also allows using capturing groups. More details can be found at the JavaDoc of java.util.regex.Pattern and JavaDoc of Capturing Groups .

As you move around the mouse cursor through the source code, you can see that some elements (names of fields, methods, types and so forth) are being underlined. By pressing Ctrl (Command on Mac) and clicking on this 'hyper linked' elements you navigate to the definition of the element which might be defined in the same source file or another.

Hyperlinking and Find Text Features in Source View
Figure 7.57. Hyperlinking and Find Text Features in Source View