Skip to content
Back to skills

Polyspace Justify In Database

ASecurity

Records a review status and rationale on Polyspace findings directly in the results database (.psbf for Bug Finder, .pscp for Code Prover) and carries that review across re-runs. Use when the user asks to "set the status to Justified", "mark this as acceptable in the results", "record a rationale in the results database", or wants review decisions to survive re-running the analysis without editing the source. For justifying by annotating the source code instead, use polyspace-justify-in-code.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
documentationdatabasedocumentation

Works with

  • cli
  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 17, 2026

npx -y skills add zrwangems/dsh-zrwang-plugin --skill polyspace-justify-in-database --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polyspace Justify In Database?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polyspace Justify In Database
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zrwangems-polyspace-justify-in-database/badge)](https://www.skillsdirectory.com/skills/zrwangems-polyspace-justify-in-database)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: polyspace-justify-in-database
description: Records a review status and rationale on Polyspace findings directly in the results database (.psbf for Bug Finder, .pscp for Code Prover) and carries that review across re-runs. Use when the user asks to "set the status to Justified", "mark this as acceptable in the results", "record a rationale in the results database", or wants review decisions to survive re-running the analysis without editing the source. For justifying by annotating the source code instead, use polyspace-justify-in-code.
license: MathWorks BSD-3-Clause
metadata:
  author: MathWorks
  version: "1.3"
---
# How to Justify Findings in the Results Database

Record a **review status and rationale directly in the Polyspace results database** — `.psbf` for Bug Finder, `.pscp` for Code Prover — and preserve it when the code is re-analyzed. This is the database mechanism; for justifications written as comments in the source code, use `polyspace-justify-in-code` instead.

## When to Use
- Marking a triaged finding or check (a Bug Finder defect, or a Code Prover orange/intentional gray) as reviewed and acceptable, in the results.
- Recording the rationale for a decision without editing the source.
- Keeping review decisions from being lost when the analysis is re-run.

## When NOT to Use
- Writing the justification as an annotation in the source code — use `polyspace-justify-in-code`.
- Deciding *whether* a Bug Finder / as-you-code finding is a real defect or acceptable — review it first with `polyspace-review-findings`.
- Deciding *whether* a Code Prover check is acceptable — review it first with `review-polyspace-code-prover-results` (and `triage-orange-checks` for orange checks specifically).
- Fixing a real error in code — use `polyspace-fix-findings`.
- Justifying a Polyspace as You Code finding: that analysis produces no results database, and on an
  as-you-code-only installation the three tools this skill uses are not registered at all — they
  ship with Bug Finder or Code Prover. Use `polyspace-justify-in-code` there.

## Workflow

### Using the MCP tools

1. **Get the `result_id`** — from `get_polyspace_results_list` on the results file. Each entry of
   its `results` array carries the finding's number in a field named `id` (plus `family`, `check`,
   `file`, `line`, `status`); that `id` is the value to pass as `result_id` below.
2. **Set the status** — `add_review_information_to_result`:
   - `results_file`: the `.psbf` or `.pscp` path.
   - `result_id`: the finding to update.
   - `status`: one of `Justified`, `No action planned`, `Not a defect`, `To fix`, `To investigate`, `Unreviewed`, `Other`. Use `Justified` for an intentional/acceptable finding, `Not a defect` for a confirmed false alarm.
   - `comment`: the rationale (why it is acceptable). Always record one — a status without a reason is not a justification.
   - `severity` (optional): `High` / `Medium` / `Low` / `Unset`.
3. **Preserve across re-runs** — re-analysis produces a new results file. Run `transfer_polyspace_comments` from the old file (`from_results_file`) to the new one (`to_results_file`) so statuses and comments carry over. Both files must be the same product (`.psbf`→`.psbf` or `.pscp`→`.pscp`); `.payc` results are not supported.

### Code Prover: unreachable defensive code (gray `UNR`)

Justify an intentionally-unreachable gray check with `status: Justified` and a comment citing the evidence (e.g. the defensive guard is required by the coding standard), referencing the exact checker id (`UNR`, which the results database reports under the family `Run-time Check`; the documentation catalog spells that same family `RTE Check`). If the gray is *unintended* dead code, it is not a justification case — remove or refactor it (route to `polyspace-fix-findings`).

### Without the MCP server

**Setting a new status** *directly in the results database* requires the MCP tool `add_review_information_to_result` — there is no command-line equivalent. To justify the finding in the source code instead, invoke `polyspace-justify-in-code`.

**Transferring existing database comments across a re-run** *does* have a CLI equivalent. When a previous database already holds review decisions — for example, statuses a user set earlier in the Polyspace user interface — and a new run has produced a fresh database, import them with `polyspace-comments-import`. See `references/cli-usage.md` in this folder.

## Conventions
- Always attach a comment explaining *why* the finding is acceptable; the status alone is not auditable.
- Never mark a finding `Justified` before it has been reviewed (for Code Prover orange, before `triage-orange-checks`) — justify decisions, not guesses.
- Re-running the analysis starts a fresh database; transfer comments every time, or review work is lost.

---

Copyright 2026 The MathWorks, Inc.

---

Files in this skill

  • SKILL.md4.8 KB
  • manifest.yaml497 B
  • references/cli-usage.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in documentation →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.