---
title: Quick start
description: Score a repository in four steps, from a coverage report to a gated branch.
---

1. **Run your tests with coverage on**

    Poly-crap reads the report; it never runs tests itself.
    [Coverage reports](/coverage) lists the command for each stack.

2. **Run poly-crap from the repository root**

    It finds a report at any of the
    [default locations](/coverage/auto-discovery) on its own:

    ```sh
    poly-crap
    ```

3. **Read the table**

    Each row is a function over the threshold, and the last column names the
    lines a test never reached:

    ```text
    CRAP results
      CRAP   CC  Coverage  Language  Symbol  Location    Uncovered
       6.0  4.0     50.0%  python    run     ./app.py:4  6-8
      1 more function not shown; adjust --min or --top to list them.
    1 of 2 functions exceeds CRAP threshold 5.0.
    Coverage scope: 1 analyzed file, 1 coverage source file, 1 matched, 0 source-only, 0 coverage-only.
    ```

    On a terminal, the score and coverage cells are colored by how bad they
    are, and the summary line is red while a function is over the threshold.

4. **Gate a branch**

    This scores only the functions the branch changed and exits `1` when one
    is over the threshold:

    ```sh
    poly-crap --diff-base main --fail-above
    ```

## Next steps

**[How the score works](/how-the-score-works)**

The CRAP formula and how to choose a threshold.

**[Reading the output](/output)**

Every column, the summary lines, and the machine formats.
