Giter Club home page Giter Club logo

gulp-jscpd's Introduction

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.

gulp-jscpd's People

Contributors

noodny avatar riddla avatar yannickcr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-jscpd's Issues

Outdated dependencies & node version warning

Please update outdated dependencies:

$ npm outdated
Package              Current  Wanted  Latest  Location
jscpd                  0.3.6   0.3.6   0.4.0  jscpd
through2               1.1.1   1.1.1   2.0.0  through2

jscpd seems to be crucial, as version 0.3.6 currently produces warning in newest node:

npm WARN engine [email protected]: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.7","npm":"2.14.2"})

Broken dependency

Hi there ;)

in package.json there is:

    "jscpd": "^0.4.2",

it would be better if it was:

    "jscpd": "0.4.2",

or even:

    "jscpd": "0.4.3",

Now, because of ^ npm downloads version "0.5.0" which has different api so 'gulp-jscpd' throws while executed:

module.js:338
    throw err;
    ^

Error: Cannot find module 'jscpd/src/tokenizer/TokenizerFactory'
  at Function.Module._resolveFilename (module.js:336:15)
  at Function.Module._load (module.js:286:25)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/jstrojewski/Projects/swingdev/globality-client/node_modules/gulp-jscpd/lib/gulp-jscpd.js:10:24)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Object.<anonymous> (/Users/jstrojewski/Projects/swingdev/globality-client/gulp/jscpd.js:4:13)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at requireDir (/Users/jstrojewski/Projects/swingdev/globality-client/node_modules/require-dir/index.js:116:33)
  at Object.<anonymous> (/Users/jstrojewski/Projects/swingdev/globality-client/Gulpfile.js:6:23)
  at Module._compile (module.js:434:26)
  at Object.Module._extensions..js (module.js:452:10)
  at Module.load (module.js:355:32)
  at Function.Module._load (module.js:310:12)
  at Module.require (module.js:365:17)
  at require (module.js:384:17)
  at Liftoff.handleArguments (/Users/jstrojewski/local/lib/node_modules/gulp/bin/gulp.js:116:3)
  at Liftoff.<anonymous> (/Users/jstrojewski/local/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16)
  at module.exports (/Users/jstrojewski/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)
  at Liftoff.<anonymous> (/Users/jstrojewski/local/lib/node_modules/gulp/node_modules/liftoff/index.js:185:9)
  at /Users/jstrojewski/local/lib/node_modules/gulp/node_modules/liftoff/index.js:159:9
  at /Users/jstrojewski/local/lib/node_modules/gulp/node_modules/v8flags/index.js:79:12
  at /Users/jstrojewski/local/lib/node_modules/gulp/node_modules/v8flags/index.js:35:7
  at doNTCallback0 (node.js:407:9)
  at process._tickCallback (node.js:336:13)
  at Function.Module.runMain (module.js:477:11)
  at startup (node.js:117:18)
  at node.js:951:3

So please change package.json not to use ^ or update library so it works with jscpd 0.5.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.