https://github.com/kucherenko/basta
Duplication detection tool (copy-paste detector), support over 150 programming languages
https://github.com/kucherenko/basta
code-quality copy-paste cpd duplication quality quality-measures
Last synced: about 1 year ago
JSON representation
Duplication detection tool (copy-paste detector), support over 150 programming languages
- Host: GitHub
- URL: https://github.com/kucherenko/basta
- Owner: kucherenko
- License: mit
- Created: 2017-08-29T16:50:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-06T10:27:28.000Z (over 8 years ago)
- Last Synced: 2025-03-25T13:02:24.987Z (about 1 year ago)
- Topics: code-quality, copy-paste, cpd, duplication, quality, quality-measures
- Language: TypeScript
- Homepage:
- Size: 1.08 MB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Basta
[](https://www.npmjs.com/package/basta)
[](https://www.npmjs.com/package/basta)
Duplication detection tool (copy-paste detector) for programming languages, support different type of programming languages like javascript, jsx, typescript, html, java, c, swift, php, go, python and [other 150 languages...](docs/FORMATS.md)
## Installation
```
npm install -g basta
```
or
```
yarn global add basta
```
## Usage
```
Usage: basta [options]
Basta is clone detection tool (copy/paste detector), support 100+ programming languages. Developed by Andrey Kucherenko.
Example usage: basta -t 10 /path/to/code
Options:
-V, --version output the version number
-l, --min-lines [number] min size of duplication in code lines (Default is 5)
-t, --threshold [number] threshold for duplication, in case duplications >= threshold basta will exit with error
-c, --config [string] path to config file (Default is .basta.json in )
-e, --exclude [string] glob pattern for files what should be excluded from duplication detection
-r, --reporter [string] reporter to use (Default is console)
-o, --output [string] reporter to use (Default is ./report/)
-b, --blame blame authors of duplications (get information about authors from git)
-s, --silent Do not write detection progress and result to a console
-d, --debug show debug information(options list and selected files)
--list show list of all supported formats
--dontSkipComments don't skip comments
-h, --help output usage information
```
If file `.basta.json` located in the root of project, values from the file will be used as defaults.
`.basta.json` should be correct json file:
```json
{
"exclude": [
"**/node_modules/**",
"**/*.min.js",
"**/*.!(vue|html)"
],
"path": "./fixtures/",
"threshold": 10,
"silent": true
}
```
## TODO
Basta tool is continuously improved, all plans are [here](TODO.md). Please feel free to add new feature requests.
## License
[The MIT License](LICENSE)