Skip to main content

A SonarQube-like static analysis CLI for Python projects.

Project description

supersonar

supersonar is a lightweight, SonarQube-inspired static analysis CLI for multi-language repositories. It is designed for local use and CI pipelines via pip install.

Quick start

pip install .
supersonar scan . --format json

The scanner performs real code checks (AST + regex), including:

  • dynamic execution (eval/exec)
  • broad exception handlers
  • hardcoded secret-like assignments
  • TODO/FIXME markers
  • unresolved merge conflict markers

Python files use AST rules. Other file types use generic cross-language text rules.

CI usage

pip install supersonar
supersonar scan . \
  --format sarif \
  --out reports/supersonar.sarif \
  --fail-on high \
  --max-high 0 \
  --max-critical 0 \
  --coverage-xml coverage.xml \
  --min-coverage 80

Config (supersonar.toml)

[scan]
exclude = [".git", ".venv", "venv", "build", "dist", "__pycache__"]
include_extensions = [".py", ".java", ".js", ".ts", ".go", ".rs", ".cs", ".yaml", ".yml", ".json", ".toml"]
include_filenames = ["Dockerfile", "Jenkinsfile", "Makefile"]
max_file_size_kb = 1024
coverage_xml = "coverage.xml"

[quality_gate]
fail_on = "high"
max_issues = 200
max_high = 0
max_critical = 0
min_coverage = 80.0

[report]
format = "json"

Use CLI overrides when needed:

supersonar scan . --include-ext .java --include-ext .kt --include-file Dockerfile

Quality gates

  • fail_on: fail if any issue exists at/above severity
  • max_issues: fail if total issues exceed threshold
  • max_low, max_medium, max_high, max_critical: per-severity caps
  • min_coverage: minimum line coverage percentage from Cobertura XML

Generate coverage.xml in Python projects with:

python -m pip install coverage
coverage run -m pytest
coverage xml -o coverage.xml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

supersonar-0.3.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supersonar-0.3.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file supersonar-0.3.0.tar.gz.

File metadata

  • Download URL: supersonar-0.3.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for supersonar-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e34d12fba1f76b64e80df624d8f02cedfcba30ab627b7c10cd1162bf748f9fda
MD5 dea9990906d6e89e2dfaa21fe11495aa
BLAKE2b-256 4604821425390d96fb1be0d64e7d52b749ac4bddbf87d5e9bf6adc5505e7fb77

See more details on using hashes here.

File details

Details for the file supersonar-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: supersonar-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for supersonar-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73db35a0a5e4401525e8592c09d0165c2927e3cc558b0875ec8eff19e4969f50
MD5 f0b14ffe8371d03847dcca960a2b3fc3
BLAKE2b-256 c968a91a998e733f884c27db808ba0f41fbbe26f407e13a34841f4630105ee0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page