https://github.com/parasoft/parasoft-report-transformer
https://github.com/parasoft/parasoft-report-transformer
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/parasoft/parasoft-report-transformer
- Owner: parasoft
- License: apache-2.0
- Created: 2024-06-21T06:45:44.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-08-18T17:48:09.000Z (5 months ago)
- Last Synced: 2025-08-18T19:30:34.837Z (5 months ago)
- Language: XSLT
- Size: 12.1 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Parasoft Report Transformer
The parasoft-report-transformer project is designed to transform Parasoft XML reports into other formats.
Supported formats:
- SARIF
## Build instructions
1. Navigate to the project root directory.
2. Run:
```
gradlew clean build
```
3. Find the distribution in build/distributions.
## Transform Parasoft Reports
### Transform Parasoft Static Analysis XML Report to SARIF Report
Run the *XMLToSARIF* script in *bin* folder with Parasoft XML report:
* For Windows:
```cmd
path\to\XMLToSARIF.bat -i [-o ] [-t ] [-p ]
```
* For Linux:
```shell
path/to/XMLToSARIF.sh -i [-o ] [-t ] [-p ]
```
#### Command line options:
| Parameter | Description |
|------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -i, --inputXmlReport (required) | The path to Parasoft XML report that you want to transform to SARIF report. |
| -o, --outputSarifReport (Optional) | The path to output SARIF report. If not specified, the SARIF report will be generated in the same directory as input XML report. |
| -t, --toolOrJavaHomeDir (Optional) | The path to Parasoft tools installation or Java home directory. If not specified, transformer will try to use Java from system environment variables. |
| -p, --projectRootPaths (Optional) | The absolute path to the project root directory, used to obtain relative file location paths. Use semicolons to separate multiple paths. If not specified, the file location paths will be absolute. |
If the XML reports generated by Parasoft Jtest, dotTEST, and C/C++test contain sufficient relevant information, the resulting SARIF reports will include files that were scanned during static analysis. For example:
```code
"runs" [
{
"tool": { ... }
"results": [
{
"ruleId": "APSC_DV.003215.MCH",
"level": "warning",
"message": {
"text": "This source file does not include a file header comment"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "file:/C:/workspace/project/example/src/main/java/Example.java"
}
}
}
]
},
{
"ruleId": "NAMING.UHN",
"level": "warning",
"message": {
"text": "Variable 'a' does not end with 'int'"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "file:/C:/workspace/project/demo/src/main/java/Demo.java"
}
}
}
],
"suppressions": [
{
"kind": "external",
"justification": "The reason of suppression."
}
]
}
],
"artifacts": [
{
"location": {
"uri": "file:/C:/workspace/project/example/src/main/java/Example.java"
}
},
{
"location": {
"uri": "file:/C:/workspace/project/demo/src/main/java/Demo.java"
}
}
]
}
]
```
For C/C++test Professional 2023.1 or earlier, to include sufficient relevant information in static analysis reports, the reports must be generated with the **Add absolute file paths to XML data** option enabled. You can enable this option on the command line by setting the `report.location_details=true` property or in the settings file.
For the `justification` property in the SARIF report indicates why a result was suppressed, when using C/C++test Professional, you must use version 2024.1 or later and include the command-line option `-property report.additional.report.dir=` when generating reports. Additionally, ensure you use XML reports from the specified directory for transformation.
For a file location path (uri property) in the SARIF report, if its project root path is specified in `-p` option, its relative path will be shown; otherwise, its absolute path will be shown. For example, when the value of `-p` option is *"C:/workspace/project/example"*:
```code
"runs" [
{
"tool": { ... }
"originalUriBaseIds": {
"PROJECTROOT-1": {
"uri": "file:/C:/workspace/project/example/"
}
},
"results": [
{
"ruleId": "APSC_DV.003215.MCH",
"level": "warning",
"message": {
"text": "This source file does not include a file header comment"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "src/main/java/Example.java"
"uriBaseId": "PROJECTROOT-1"
}
}
}
]
},
{
"ruleId": "NAMING.UHN",
"level": "warning",
"message": {
"text": "Variable 'a' does not end with 'int'"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "file:/C:/workspace/project/demo/src/main/java/Demo.java"
}
}
}
]
}
],
"artifacts": [
{
"location": {
"uri": "src/main/java/Example.java"
"uriBaseId": "PROJECTROOT-1"
}
},
{
"location": {
"uri": "file:/C:/workspace/project/demo/src/main/java/Demo.java"
}
}
]
}
]
```