This job runs the static code analysis using [Infer#](https://github.com/microsoft/infersharp). On big projects this analysis can take quite some time and use a good amount of memory and disk space. Set a runner size and timeout fitting for your project.
It uses the following variables:
| Input / Variable | Description | Default value |
| `infersharp-enabled` / `DOTNET_INFERSHARP_ENABLED` | Set to true to enable [Infer#](https://github.com/microsoft/infersharp) static analysis. | `false` |
| `infersharp-image` / `DOTNET_INFERSHARP_IMAGE` | Infersharp Docker image to use for running the tests | `mcr.microsoft.com/infersharp:latest`<br/>[](https://to-be-continuous.gitlab.io/doc/secu/trivy-DOTNET_INFERSHARP_IMAGE) |
| `infersharp-opts` / `DOTNET_INFERSHARP_OPTS` | Additional [Infer options](https://fbinfer.com/docs/man-infer-run/#OPTIONS) to pass to the analysis. | `""` (empty) |
| `infersharp-blocklist` / `DOTNET_INFERSHARP_BLOCKLIST` | Space-separated list of partial path patterns to filter findings from SARIF output (e.g., suppress test framework false positives). | `Microsoft.TestPlatform xunit nunit MSTest testhost testlogger` |
**Output artifacts:**
The infer# SARIF report is retained as original, filtered using the block-list, and then converted to GitLab SAST and Code Quality formats for reporting depending upon the available Gitlab features.
This job creates a Software Bill Of Materials (SBOM) for the project, libraries and executables using [CycloneDX cdxgen](https://github.com/CycloneDX/cdxgen).
"description":"Set to true to enable [Infersharp](https://github.com/microsoft/infersharp) analysis. Produces both complete and filtered SARIF reports; filtered version is used for GitLab SAST/Code Quality reporting.",
"enable_with":"DOTNET_INFERSHARP_ENABLED",
"variables":[
{
"name":"DOTNET_INFERSHARP_IMAGE",
"description":"Infersharp Docker image to use for running the tests",
"default":"mcr.microsoft.com/infersharp:latest"
},
{
"name":"DOTNET_INFERSHARP_OPTS",
"description":"Additional [Infer options](https://fbinfer.com/docs/man-infer-run/#OPTIONS) to pass to the analysis.",
"advanced":true
},
{
"name":"DOTNET_INFERSHARP_BLOCKLIST",
"description":"Space-separated list of partial path patterns to filter findings from SARIF output (e.g., suppress test framework false positives).",