Skip to content

JSON report

sh
slopometer . --json

Standard output carries the report and nothing else, so piping into a parser always succeeds. Errors and progress go to standard error.

Shape

json
{
  "root": "/path/analyzed",
  "config_source": { "source": "defaults" },
  "languages": { "rust": { "files": 52, "lines": 11591 } },
  "unclassified_files": 3,
  "findings": [
    {
      "rule": "rust/unwrap-in-library",
      "category": "rust",
      "severity": "high",
      "confidence": "confirmed",
      "origin": "engine",
      "path": "src/lib.rs",
      "span": { "start_line": 904, "start_column": 13, "end_line": 904 },
      "message": "the failure path is unhandled here"
    }
  ],
  "diagnostics": [],
  "scores": {
    "categories": {
      "rust": {
        "outcome": "scored",
        "score": 99,
        "breakdown": {
          "relevant_lines": 11591,
          "weighted_density": 0.26,
          "half_density": 28.1,
          "tiers": [
            {
              "severity": "low",
              "count": 3,
              "weight_total": 3.0,
              "density_contribution": 0.26
            }
          ],
          "excluded_unconfirmed": 1
        }
      }
    },
    "overall": 98,
    "grade": { "label": "excellent", "min": 90, "max": 100 },
    "weights": { "rust": 1.0, "doc": 1.0, "filler": 1.0 }
  }
}

Fields worth knowing

confidence is confirmed or unconfirmed. Only confirmed findings reach the scores; unconfirmed ones are present so a reader can still act on them.

origin is engine for the analyzer's own detectors. It exists so that findings from any future external source stay distinguishable without the report shape changing.

outcome on a category is scored, low-confidence, or not-applicable. The last two carry no score, and mean different things: too little code to measure, versus nothing to measure.

breakdown is always present in JSON, whether or not --explain was passed. The terminal report is a view; the JSON is the record.

Dual licensed under MIT or Apache-2.0.