jscpd-sarif-reporter

Reporter for jscpd. Generate a report in SARIF format (https://github.com/oasis-tcs/sarif-spec).

MIT 14 个版本
安装
npm install jscpd-sarif-reporter
yarn add jscpd-sarif-reporter
pnpm add jscpd-sarif-reporter
bun add jscpd-sarif-reporter
README

@jscpd/sarif-reporter

SARIF reporter for jscpd — generates Static Analysis Results Interchange Format output for integration with GitHub Code Scanning and other SARIF-compatible tools.

Each detected clone is reported as a warning-level SARIF result with precise file locations (line and column). If the overall duplication percentage exceeds the configured --threshold, an additional error-level result is emitted under the duplications-threshold rule.

Output file: <output-dir>/jscpd-sarif.json

Installation

npm install @jscpd/sarif-reporter

Usage

jscpd --reporters sarif --output ./reports /path/to/source

GitHub Code Scanning integration

Upload the SARIF output to GitHub to surface duplication findings inline in pull requests:

# .github/workflows/jscpd.yml
name: Code duplication check
on: [push, pull_request]

jobs:
  jscpd:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run jscpd
        run: npx jscpd --reporters sarif --output ./reports .

      - name: Upload SARIF to GitHub Code Scanning
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: ./reports/jscpd-sarif.json

Results appear in the Security → Code scanning tab of your repository and as inline annotations on pull request diffs.

License

MIT © Andrey Kucherenko

版本列表
4.2.5 2026-06-07
4.2.4 2026-05-25
4.2.3 2026-05-17
4.2.2 2026-05-15
4.2.1 2026-05-15
4.2.0 2026-05-14
4.1.1 2026-05-12
4.1.0 2026-05-09
4.0.7 2026-04-10
4.0.6 2026-01-30
4.0.5 2026-01-11
4.0.4 2026-01-11
4.0.3 2024-05-28
4.0.2 2024-05-28