A GitLab Code Quality reporter for jscpd.
This uses the custom tool approach which is a subset of the Code Climate spec.
npm install jscpd-gitlab-reporter
jscpd [...options] --reporters gitlab /path/to/source
See the jspcd CLI docs for available options and configuration.
Add the following to your .gitlab-ci.yml
check:duplicates:
image: node:20.14.0-alpine3.20
stage: codequality
script:
- npm ci
- npx jscpd --reporters gitlab src/**/*
artifacts:
reports:
codequality: report/gl-codequality.json
Predefined GitLab CI variable is used to determine the relative file paths in the report. Defaults to the current working directory.
Specifies a custom report file path. Defaults to gl-codequality.json
in the jscpd output directory, which itself
defaults to report/
.
Merge the produced findings with an existing quality report if it already exists. Useful when utilising multiple tools
in the same GitLab job. Defaults to false
.
MIT | Based on the @jscpd/serif-reporter by Andrey Kucherenko