# PVS-Studio

**Кастомный импортер в GitLab**: [pvs-studio.json](https://gitlab.cybercodereview.ru/cybercodereview/importers/-/blob/main/pvs-studio.json)

**Образ с интеграцией**: `registry.cybercodereview.ru/cybercodereview/security-images/pvs-studio:7.37`

**Запуск задания аудитора для C/C++/C# языков:**

```bash
echo '<license_name>
<license_code>
' > lic.lic
pvs-studio-analyzer trace -- cmake build ./$SEC_CODE_FOLDER
pvs-studio-analyzer analyze -f strace_out -l lic.lic -o report
plog-converter -t json -o /data/$REPORT_FILE_NAME report
```

**Запуск задания аудитора для Java языков:**

```bash
java -jar ~/.config/PVS-Studio-Java/7.37.94487/pvs-studio.jar  -s ./$SEC_CODE_FOLDER -o /data/$REPORT_FILE_NAME --license-key <license_code> --user-name <license_name>
```

Пример `Dockerfile` для сборки образа, способного запускать версии анализатора для всех языков:

```docker
FROM debian:bookworm-slim

ARG PVS_VER="7.37.94487.552-1"
ARG PVS_DOTNET_VER="7.37.94606.2558"
ARG PVS_CORE="7.37.94487"

RUN apt update -y && apt install -y wget gnupg ca-certificates unzip && apt clean && rm -rf /var/lib/apt/lists/*

RUN wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt | apt-key add -
RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
RUN wget -O /etc/apt/sources.list.d/viva64.list https://files.pvs-studio.com/etc/viva64.list
RUN wget "https://files.pvs-studio.com/java/pvsstudio-cores/${PVS_CORE}.zip"\
    -O ${PVS_CORE}.zip \
    && mkdir -p ~/.config/PVS-Studio-Java \
    && unzip ${PVS_CORE}.zip -d ~/.config/PVS-Studio-Java \
    && rm -rf ${PVS_CORE}.zip

RUN apt update -yq && apt install -yq dotnet-sdk-9.0 openjdk-17-jre maven pvs-studio=${PVS_VER} pvs-studio-dotnet=${PVS_DOTNET_VER} strace gcc cmake make && apt clean && rm -rf /var/lib/apt/lists/*
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybercodereview.ru/security-center/scanners/integracii/pvs-studio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
