Main Content

Troubleshoot Failed Analysis or Unexpected Results in Polyspace as You Code

Issue

After installing and configuring Polyspace as You Code in your IDE, you should see analysis results as source code markers within a few seconds of starting the analysis (slightly longer for C++ files). If you do not see results, it could mean that the analysis did not find any issue or the analysis failed to complete or even failed to start.

If you run Polyspace as You Code on each save, some of the runs might fail because a file does not compile yet. If you do not see results despite successful compilation, you might have to investigate further and change the analysis options or extension settings. (Note that you can enable the checker File does not compile (Polyspace Bug Finder) so that you always see at least one result, even when the file does not compile.)

Possible Solutions

If you do not see results, first confirm that the analysis reached completion. If the analysis completed but did not find any issue, on the IDE pane that shows the full list of results, you see a status message indicating completion. For instance, in Visual Studio®, on the Polyspace Results List pane, you see this message:

Message showing zero findings in Visual Studio

If the analysis failed to complete, you also see a status message indicating failure. For further diagnosis, check the analysis log within the IDE. For instance, in Visual Studio, open the Output pane, select Polyspace from the Show output from drop-down list, and check the messages. You might have to scroll up a bit to see the root cause of the failure.

For more information on how to follow analysis progress in specific IDEs, see:

Check if Build Analysis is Outdated

The most common cause of an analysis failure is a compilation error. If a file compiles with your compiler but fails with Polyspace, it means that the analysis requires more information to emulate your compiler. In the most common scenario, the error indicates that you have to reanalyze your build.

If you specify in your extension settings that the analysis must use options extracted from a build command, a build task or a JSON compilation database, you must analyze your build command first and then run Polyspace as You Code. The build analysis must run on a command or task that performs a full build of your project or workspace and not an incremental build.

If you add a new file to your project or workspace but forget to rerun build analysis, you might see compilation errors when trying to analyze the new file. The most common error is that include files cannot be found. To fix the issue, simply rerun your build analysis and then run Polyspace as You Code. For details, see Analyzing Build in Polyspace as You Code (Polyspace Bug Finder).

Check for Mistakes in Options File

If you specify an options file in your extension settings, the analysis appends options from this file to the underlying run command. If an option is incorrectly written, for example, refers to a nonexistent file or uses an incorrect argument, the analysis can fail.

You can see all errors and warnings related to options in the analysis log. To see a more detailed log, use the analysis option -no-quiet. You can enter this option in the same options file that contains your other options. See Options Files for Polyspace Analysis (Polyspace Bug Finder).

Check for Incorrect Path to Analysis Engine

In Visual Studio Code, you can change the extension setting that points to the Polyspace® installation folder. If you enter an incorrect path in this setting, the Polyspace as You Code extension fails to start. You see a message indicating that the internal server, Polyspace Connector, attempted to start and then failed.

Check that the installation folder that you provided in your extension settings indeed contains a Polyspace installation. The path must contain a subfolder polyspace\bin, that contains the polyspace-bug-finder-access executable.

Related Topics