SARIF to Excel Formatter is a Python-based tool designed to transform SARIF (Static Analysis Results Interchange Format) reports into clean, readable, and professionally formatted Excel files. This tool simplifies the analysis of static code analysis results, making it easier to interpret, share, and report findings.
-
Dynamic Column Resizing: Automatically adjusts column widths based on the largest content for improved readability.
-
Text Wrapping for Large Fields: Ensures fields like
Message
andDetails
are legible by wrapping text and setting optimal column widths. -
Customizable Columns: Allows you to include specific fields like
Severity
,Path
,Page
,Line
, and more, with a user-friendly layout. -
Tool-Agnostic Compatibility: Works with any tool that outputs SARIF reports, including:
- Qodana
- CodeQL
- SonarQube
- ESLint
- GitHub Code Scanning
-
Excel Table Formatting: Outputs professional-grade Excel files with built-in table formatting for filtering and sorting.
Ensure the following dependencies are installed:
- Python 3.6+
- Required Python libraries:
pip install pandas openpyxl
-
Clone this repository:
git clone /~https://github.com/barkerbg001/sarif-to-excel.git
-
Navigate to the project directory:
cd sarif-to-excel
-
Install the dependencies:
pip install -r requirements.txt
Run the script with your SARIF file:
python main.py
- Provide the path to your SARIF file (e.g.,
qodana.sarif.json
).
- The formatted Excel file (
sarif_report.xlsx
) will be generated in the project directory.
Input (SARIF):
{
"version": "2.1.0",
"runs": [
{
"results": [
{
"ruleId": "EXAMPLE_RULE",
"message": { "text": "This is a test message." },
"locations": [
{
"physicalLocation": {
"artifactLocation": { "uri": "src/example.js" },
"region": { "startLine": 42 }
}
}
],
"level": "error"
}
]
}
]
}
Output (Excel):
Severity | Message | Details | Path | Page | Line |
---|---|---|---|---|---|
error | EXAMPLE_RULE | This is a test message. | src/example.js | example.js | 42 |
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add your message here"
- Push to your branch:
git push origin feature/your-feature
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- SARIF Specification
- Tools like Qodana, CodeQL, and SonarQube for inspiring this project.
For questions or suggestions, feel free to reach out:
- GitHub: barkerbg001