Inspecting configuration resources

Guidewire Studio analyzes your configuration resources to identify various errors and style-related issues in your project code. Studio performs this analysis by applying inspections to your project files, and then reports any issues found.

Studio provides many inspections for analyzing the code in your configuration resources. The available inspections include the following:

  • Anonymous classes that can be replaced with block expressions
  • Getter and setter methods that can be replaced with class properties
  • Missing Gosudoc comments
  • Hardcoded labels in PCF files
  • Empty loop bodies
Inspections are applied to your code in the following ways:
  • Automatically, as you edit your code in the Gosu editor
  • By explicitly running inspections by on one or more files
  • By running inspections from the command line

See also

View inspection settings

View the descriptions of code inspections, and set whether an inspection is enabled.

About this task

Guidewire Studio provides many inspections for analyzing the Gosu code in your configuration resources. Most of the Gosu code inspections are listed under the Gosu group in the inspections list.

Procedure

  1. In Guidewire Studio, click File > Settings.
  2. In the Settings dialog, navigate to Editor > Inspections.
  3. You can do one of the following:
    • To view the description of an inspection, click on it.
    • To change whether an inspection is enabled, set or clear the check box next to it.

What to do next

See also

Run inspections in Guidewire Studio

Run code inspections in Guidewire Studio to identify certain coding errors and style issues.

About this task

In Guidewire Studio, run code inspections on one or more files, or on the entire project.

Procedure

  1. In Guidewire Studio, open the desired file, or select the desired files or folders in the Project tool window.
  2. You can do one of the following:
    • To run all inspections, click Analyze > Inspect Code.
    • To run a particular inspection, click Analyze > Run Inspection by Name.

What to do next

See also

Run inspections only on modified files

Create a new inspection profile that is defined to run inspections only on files that you have modified, or new files that you have added.

About this task

Base your new profile on the default profile, and then modify its settings.

Procedure

  1. In Guidewire Studio, click File > Settings.
  2. In the Settings dialog, navigate to Editor > Inspections.
  3. In the Profile drop-down list, click Project Default.
  4. Click Show Scheme Actions, and then click Duplicate.
  5. Type a name for the profile, and then press Enter.
  6. Click an inspection to include in the new profile.
  7. To enable the inspection, set the check box next to it.
  8. Next to Severity, click In All Scopes, and then click ClientModified.
  9. Repeat from step 6 to include all desired inspections in the profile. Also unset the check box next to any inspections to remove from the profile.

What to do next

See also

Run inspections from the command line

Run code inspections from the command line as part of your build or QA process.

Before you begin

You cannot run inspections from the command line while Guidewire Studio is running. Exit Studio before running inspections from the command line.

About this task

Run code inspections on your project from the command line without running Guidewire Studio.

Procedure

On the command line, run the following command:
gwb inspect

What to do next

The results of the inspections are stored as XML files in your PolicyCenter/inspection_results directory. You can view the inspection results within Guidewire Studio, or you can import them into your own tools.

See also

View command line inspection results

After running inspections from the command line, view the inspection results.

About this task

Command line inspection results are stored as XML files. Guidewire Studio provides a viewer that lets you to browse the inspection results in a more readable format. In Studio, you can also click within the results to go directly to the highlighted code.

Procedure

  1. In Guidewire Studio, click Analyze > View Offline Inspection Results.
  2. In the Select Path dialog, navigate to your PolicyCenter installation folder, and then click the inspection_results folder.
  3. Click OK.
  4. View the inspection results in the Inspection Results tool window.

What to do next

See also