Suppression comments exported in the report
Hi everyone,
we use suppressions in a source code to avoid findings of some rule violations. It is done according to the user manual by usage of suppression begin/end comments:
// parasoft-begin-suppress
... code block ...
// parasoft-end-suppress
We use the field -suppression comment- for the justification of the suppression and we would like to have it as part of the export.
Can someone advise us on how to do that or is it even possible?
We have added "report.suppressed_msgs=true" to the .properties file but the export did not include suppression comments.
Comments
-
@tttvbl ,
Reports will only include information about violations that were actually suppressed as a result of applying directives from the comments. This is what "report.suppressed_msgs=true" does. There is unfortunately no mechanism to report suppression comments themselves.0 -
Hi Bogdan,
Thank you for your answer!So, if I understand correctly, there is no way to obtain comments on the suppressed rules in the Parasoft report. But is there any other way to export the suppression comments? For example, is it possible to generate a parasoft.suppress file from the in-code suppression comments?
0 -
@ttvbl,
actually, I may have misunderstood your question. What I meant is that that there is no mechanism to list suppression comments themselves that are inserted into the code.However, after the suppressions were applied to static analysis results for a current run, it is generally possible to have a list of suppressed violations in that run with their respective suppression comments.
First, even with the default report options, number of suppressions for a recent run would be listed in the summary table at the top of a report, for example:
Then, if you additionally add the option "report.suppressed_msgs=true" in your settings file, then you should get the following detailed information about violations that were suppressed in the static analysis run that the report is representing. For example, two violations that were suppressed in the current run would be listed in a report like this:
If it is otherwise, we can connect via our support channel to investigate it further.
0 -
@Bogdan Czwartkowski ,
Thank you for your answer!We can see the total number of suppressions in the summary table. We also see the suppressions in the 'Findings by File' part of the report, but the suppression comment is missing. If we take your example, we would not be able to see the text "It is OK to use C cast here".
Can you please tell us if this example of the suppression from our source code is correct:
/* parasoft-begin-suppress CERT_C-CON02-a * "Volatile used to ensure no compiler optimization interferes * with mutex pointer." */ *mutex = (volatile Tt_Bsp_Mutex)m; /* parasoft-end-suppress CERT_C-CON02-a */
Are there any special report.* settings needed? The only one that we use is "report.suppressed_msgs=true".
And yes, I would like to connect via support channel.
0