jscpd-gitlab-reporter
v1.0.0
Published
Reporter for jscpd. Generate a report in CodeClimate format for use in GitLab Code Quality Reports.
Downloads
346
Maintainers
Readme
jscpd-gitlab-reporter
A GitLab Code Quality reporter for jscpd.
This uses the custom tool approach which is a subset of the Code Climate spec.
Getting started
Install
npm install jscpd-gitlab-reporter
Usage
jscpd [...options] --reporters gitlab /path/to/source
See the jspcd CLI docs for available options and configuration.
CI/CD Definition
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
Additional Configuration
CI_PROJECT_DIR
Predefined GitLab CI variable is used to determine the relative file paths in the report. Defaults to the current working directory.
CODE_QUALITY_REPORT
Specifies a custom report file path. Defaults to gl-codequality.json
in the jscpd output directory, which itself
defaults to report/
.
CODE_QUALITY_APPEND
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