This topic explains how to generate an AI-suggested fix to a violation and replace your code with the generated code. To use this functionality, OpenAI must first be configured in the Parasoft Preferences. For details, see Configuring OpenAI Settings.
This feature depends on OpenAI, which may produce inaccurate information.
In the Findings view, right-click the finding you want to generate a fix for, then choose Fix [rule] with Generative AI
.AI-generated code and recommendations will appear in the AI Suggested Fix panel.
- To apply the AI-generated solution, copy the recommended code snippet using the Copy code option and replace the appropriate code section with it. If multiple snippets are returned, only the first code snippet is copied. You can also highlight a fragment of the suggested solution, and then copy and paste it using keyboard to the appropriate place.