Visualizing C-STAT output in Jenkins

Technical Note 210616






7/12/2021 10:17 AM


C-STAT messages can be retrieved either by running icstat from the command line or via the Embedded Workbench IDE.

However, it can be hard to determine which messages are ’new’, ’fixed’, or ’identical’ compared to a previous analysis.


This document describes how to use a plugin for Jenkins called Warnings Next Generation, which can compare a previous analysis in relation to ’new’, ’fixed’, or ’identical’ messages.

  • The Jenkins plugin supports many static analysis tools.
  • This plugin does not run C-STAT, it only visualizes its result.
  • It is also possible to sort, filter, and inspect each message of the source files directly in the browser.

Generating C-STAT output

The easiest way to run C-STAT in the Jenkins pipeline scripts is to first generate a commands file from IarBuild (requires version 9.x or later of IarBuild):

IarBuild <projectfile> -cstat_cmds <config>

This command places a cstatcommands.txt file in the <config>/C-STAT directory.

Then invoke icstat like this:

icstat --db cstat.db commands <config>/C-STAT/cstatcommands.txt <options>

The output of icstat is preferably saved to a log file so the Jenkins plugin can parse it.

Using the Warnings Next Generation plugin

The next step is to invoke the plugin:

recordIssues tools: [iarCstat(pattern: "<logfile>.txt")]

There are more examples of using the plugin in the official plugin documentation here.

You can generate the plugin commands from the Pipeline Syntax menu, available when viewing a Jenkins job. By choosing record Issues as Sample Step and IAR C-STAT as Tool, you can click on Generate Pipeline Script to get a command that mirrors the selected options.

Note: The plugin filters out identical messages. This means that typically the number of messages from the plugin will not match the number of messages in C-STAT, because C-STAT propagates header messages to all source files that includes that header.


The Warnings Next Generation plugin for Jenkins can be used to visualize the results of a C-STAT analysis. Thus, it becomes possible to determine trends for the number of messages.

All product names are trademarks or registered trademarks of their respective owners.

We do no longer support Internet Explorer. To get the best experience of, we recommend upgrading to a modern browser such as Chrome or Edge.