Package detail

gulp-jscpd

yannickcr3.5k0.0.8

Gulp plugin for the copy/paste detector jscpd

cpd, pmd, analyze, quality

readme

gulp-jscpd

Maintenance Status NPM version Build Status Dependency Status Coverage Status Code Climate

Gulp plugin for the copy/paste detector jscpd.

Installation

$ npm install gulp-jscpd

Usage

var gulp  = require('gulp');
var jscpd = require('gulp-jscpd');

gulp.task('jscpd', function() {
  return gulp.src('**/*.js')
    .pipe(jscpd({
      'min-lines': 10,
      verbose    : true
    }));
});

Options

min-lines

Type: Number

Min size of duplication in code lines, default to 5.

min-tokens

Type: Number

Min size of duplication in code tokens, default to 70.

reporter

Type: String

Reporter name or path to the custom reporter, default to xml.

languages

Type: Array

List of languages which scan for duplicates, default to ['javascript', 'typescript', 'jsx', 'haxe', 'coffeescript', 'ruby', 'php', 'python', 'css', 'java', 'csharp', 'go', 'clike', 'htmlmixed'].

output

Type: String

Path to report XML file, default to null (no report file).

verbose

Type: Boolean

Show full info about copies, default to false.

debug

Type: Boolean

Show debug information (options list and selected files), default to false.

silent

Type: Boolean

Don't print a report summary, default to false.

failOnError

Type: Boolean

Don't throw an error in case of duplicated occurrences (useful for CI), default to true.

Tests

Run tests using mocha

$ npm test

Code Coverage

Output a code coverage report in coverage.html

$ npm run coverage

Code Style

Check the code style with JSCS

$ npm run checkstyle

License

gulp-jscpd is licensed under the MIT License.

changelog

0.0.8 / 2017-06-04

  • add xsl-href option (#7 @riddla)
  • add failOnError option (#9 @aruiz14)
  • update jscpd to 0.6.11
  • update dependencies

0.0.7 / 2016-05-03

  • update jscpd to 0.6.1 (#6)

0.0.6 / 2015-11-02

  • fix jscpd dependency to 0.4.2 (#5)

0.0.5 / 2015-09-13

  • add the silent option (#3 @noodny)
  • add support for the reporter option
  • update jscpd (#4)
  • update dependencies

0.0.4 / 2015-05-01

  • silent the warning if .cpd.yaml is missing (#1)
  • update dependencies

0.0.3 / 2014-06-17

  • improve output messages

0.0.2 / 2014-06-16

  • add tests
  • fix line numbers for the second file

0.0.1 / 2014-06-15

  • initial release