> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/prezero/static-analysis-sast/analyzing-applications/apex.md).

# Apex

This article shows you how to analyze your Apex code using Qwiet AI by Harness.

## Requirements <a href="#requirements" id="requirements"></a>

See [Prerequisites](broken://spaces/uPVBkglG6gsk2SsnsKgG/pages/0c1ezDgaUil5NxR4VnY3#language-support-and-requirements) for more information.

## Analyzing your Apex code <a href="#analyzing-your-apex-code" id="analyzing-your-apex-code"></a>

To analyze your Apex code, run:

```
sl analyze --app <name> --apex [<path>]
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

| Parameter      | Description                                                                    |
| -------------- | ------------------------------------------------------------------------------ |
| `--app <name>` | The name of the project/module to be analyzed (maximum length: 100 characters) |
| `--apex`       | The flag identifying the code as Apex                                          |
| `<path>`       | The path to the code to be analyzed                                            |

See the [CLI reference](broken://spaces/4t03gua31tHpZwtcczPO/pages/bfq0NtVB7O7f6pFvFzK3) for additional `sl analyze` options.

## Additional parameters <a href="#additional-parameters" id="additional-parameters"></a>

The analysis accepts additional parameters after a double hyphen `--`.

For example, the following ignores files listed in the referenced ignore list:

```
sl analyze --app <name> --apex . -- --ignore-list ignorelist.txt
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

Where `ignorelist.txt` contains one file path per line. For example:

```
./src/classes/Test1.cls
./src/classes/Test2.cls
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

| Parameter              | Description                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------- |
| `--ignore-list <path>` | Path to file containing a list of files to ignore, one path per line                                           |
| `--threads <num>`      | Sets the number of threads used for the analysis. Set to 0 to disable multi-threading processing. Default is 1 |

## Tagging results with your branch name <a href="#tagging-results-with-your-branch-name" id="tagging-results-with-your-branch-name"></a>

To include the branch name in your Qwiet AI by Harness results, allowing you to distinguish one set of results from another, add the following to your invocation of Qwiet:

```
sl analyze --tag branch=`git symbolic-ref --short HEAD`
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

If you're working in a GitHub environment (e.g., [GitHub Actions](https://github.com/features/actions)), you can also use `--tag branch=${{ github.head_ref }}` to populate your branch name.

If you don't provide a branch name, but Qwiet detects one available in your environment, it will use that name.
