All Projects → kucherenko → Jscpd

kucherenko / Jscpd

Licence: mit
Copy/paste detector for programming source code.

Programming Languages

typescript
32286 projects
Vue
7211 projects
APL
13 projects
rust
11053 projects
java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jscpd

java-quality-checks
No description or website provided.
Stars: ✭ 33 (-98.62%)
Mutual labels:  code-quality, cpd, copy-paste
Codeclimate
Code Climate CLI
Stars: ✭ 2,273 (-5.17%)
Mutual labels:  quality, code-quality
elm-review
Analyzes Elm projects, to help find mistakes before your users find them.
Stars: ✭ 195 (-91.86%)
Mutual labels:  quality, code-quality
javascript-test-reporter
DEPRECATED Code Climate test reporter client for JavaScript projects
Stars: ✭ 68 (-97.16%)
Mutual labels:  quality, code-quality
codeclimate-duplication
Code Climate engine for code duplication analysis
Stars: ✭ 96 (-95.99%)
Mutual labels:  quality, code-quality
python-test-reporter
DEPRECATED Uploads Python test coverage data to Code Climate
Stars: ✭ 18 (-99.25%)
Mutual labels:  quality, code-quality
codeclimate-phpcodesniffer
Code Climate Engine for PHP Code Sniffer
Stars: ✭ 27 (-98.87%)
Mutual labels:  quality, code-quality
codeclimate-eslint
Code Climate Engine for ESLint
Stars: ✭ 86 (-96.41%)
Mutual labels:  quality, code-quality
static-code-analysis-plugin
A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Stars: ✭ 36 (-98.5%)
Mutual labels:  code-quality, cpd
Android Guidelines
Project Guidelines for the Android Buffer App
Stars: ✭ 760 (-68.29%)
Mutual labels:  quality, code-quality
State Of The Art Shitcode
💩State-of-the-art shitcode principles your project should follow to call it a proper shitcode
Stars: ✭ 2,207 (-7.93%)
Mutual labels:  code-quality
Yolo Powered robot vision
Stars: ✭ 133 (-94.45%)
Mutual labels:  detector
Detectem
detectem - detect software and its version on websites.
Stars: ✭ 152 (-93.66%)
Mutual labels:  detector
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (-93.49%)
Mutual labels:  code-quality
Cohesion
A tool for measuring Python class cohesion.
Stars: ✭ 129 (-94.62%)
Mutual labels:  quality
Detekt Intellij Plugin
detekt plugin for IntelliJ
Stars: ✭ 150 (-93.74%)
Mutual labels:  code-quality
Attractor
code complexity metrics visualization and exploration tool for ruby and javascript
Stars: ✭ 127 (-94.7%)
Mutual labels:  code-quality
Zpa
A parser and source code analyzer for PL/SQL and Oracle SQL.
Stars: ✭ 124 (-94.83%)
Mutual labels:  quality
Phpstan Banned Code
Detect banned code through PHPStan
Stars: ✭ 123 (-94.87%)
Mutual labels:  quality
Coveragechecker
Allows old code to use new standards
Stars: ✭ 159 (-93.37%)
Mutual labels:  quality

jscpd

npm jscpd license Travis npm

codecov FOSSA Status Backers on Open Collective Sponsors on Open Collective

NPM

Copy/paste detector for programming source code, supports 150+ formats.

Copy/paste is a common technical debt on a lot of projects. The jscpd gives the ability to find duplicated blocks implemented on more than 150 programming languages and digital formats of documents. The jscpd tool implements Rabin-Karp algorithm for searching duplications.

jscpd screenshot

Packages of jscpd

name version description
jscpd npm main package for jscpd (cli and API for detections included)
@jscpd/core npm core detection algorithm, can be used for detect duplication in different environments, one dependency to eventemmiter3
@jscpd/finder npm detector of duplication in files
@jscpd/tokenizer npm tool for tokenize programming source code
@jscpd/leveldb-store npm LevelDB store, used for big repositories, slower than default store
@jscpd/html-reporter npm Html reporter for jscpd
@jscpd/badge-reporter npm Badge reporter for jscpd

Installation

$ npm install -g jscpd

Usage

$ npx jscpd /path/to/source

or

$ jscpd /path/to/code

or

$ jscpd --pattern "src/**/*.js"

More information about cli here.

Programming API

For integration copy/paste detection to your application you can use programming API:

jscpd Promise API

import {IClone} from '@jscpd/core';
import {jscpd} from 'jscpd';

const clones: Promise<IClone[]> = jscpd(process.argv);

jscpd async/await API

import {IClone} from '@jscpd/core';
import {jscpd} from 'jscpd';
(async () => {
  const clones: IClone[] = await jscpd(['', '', __dirname + '/../fixtures', '-m', 'weak', '--silent']);
  console.log(clones);
})();

detectClones API

import {detectClones} from "jscpd";

(async () => {
  const clones = await detectClones({
    path: [
      __dirname + '/../fixtures'
    ],
    silent: true
  });
  console.log(clones);
})()

detectClones with persist store

import {detectClones} from "jscpd";
import {IMapFrame, MemoryStore} from "@jscpd/core";

(async () => {
  const store = new MemoryStore<IMapFrame>();

  await detectClones({
    path: [
      __dirname + '/../fixtures'
    ],
  }, store);

  await detectClones({
    path: [
      __dirname + '/../fixtures'
    ],
    silent: true
  }, store);
})()

In case of deep customisation of detection process you can build your own tool with @jscpd/core, @jscpd/finder and @jscpd/tokenizer.

Start contribution

  • Fork the repo kucherenko/jscpd
  • Clone forked version (git clone https://github.com/{your-id}/jscpd)
  • Install dependencies (yarn install)
  • Add your changes
  • Add tests and check it with yarn test
  • Create PR

Who uses jscpd

  • Github Super Linter is combination of multiple linters to install as a GitHub Action
  • Code-Inspector is a code analysis and technical debt management service.
  • Mega-Linter is a 100% open-source linters aggregator for CI (Github Action & other CI tools) or to run locally
  • vscode-jscpd VSCode Copy/Paste detector plugin.
  • Codacy automatically analyzes your source code and identifies issues as you go, helping you develop software more efficiently with fewer issues down the line.
  • Natural is a general natural language facility for nodejs. It offers a broad range of functionalities for natural language processing.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

ga tracker

License

MIT © Andrey Kucherenko

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].