jscpd-sarif-reporter
Reporter for jscpd. Generate a report in SARIF format (https://github.com/oasis-tcs/sarif-spec).
Last updated 6 months ago by apk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install jscpd-sarif-reporter 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 4.2.5                                ...           latest (6 months ago)

14 Versions

  • 4.2.5                                ...           6 months ago
  • 4.2.4                                ...           6 months ago
  • 4.2.3                                ...           6 months ago
  • 4.2.2                                ...           6 months ago
  • 4.2.1                                ...           7 months ago
  • 4.2.0                                ...           7 months ago
  • 4.1.1                                ...           7 months ago
  • 4.1.0                                ...           7 months ago
  • 4.0.7                                ...           8 months ago
  • 4.0.6                                ...           10 months ago
  • 4.0.5                                ...           a year ago
  • 4.0.4                                ...           a year ago
  • 4.0.3                                ...           3 years ago
  • 4.0.2                                ...           3 years ago
Maintainers (1)
Downloads
Total 25
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 19
Dependencies (3)
Dev Dependencies (9)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE