Skip to content

Commit e1aee11

Browse files
committed
Add README and LICENSE
1 parent 2b3e74b commit e1aee11

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Code Climate, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

+67
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
11
# codeclimate-duplication
2+
3+
`codeclimate-duplication` is an engine that wraps [flay] and supports Ruby,
4+
Python, JavaScript, and PHP. You can run it in the command line using the Code
5+
Climate CLI, or on our [hosted analysis platform][codeclimate].
6+
7+
[codeclimate]: https://codeclimate.com/dashboard
8+
9+
## Installation
10+
11+
1. If you haven't already, [install the Code Climate CLI][cli]
12+
2. Run `codeclimate engines:enable duplication`. This command both installs the
13+
engine and enables it in your `.codeclimate.yml` file.
14+
3. You're ready to analyze! Browse into your project's folder and run
15+
`codeclimate analyze`.
16+
17+
[cli]: https://github.com/codeclimate/codeclimate
18+
19+
## Configuring
20+
21+
You can add the following to your `.codeclimate.yml` to get started with the
22+
duplication engine.
23+
24+
```yaml
25+
engines:
26+
duplication:
27+
enabled: true
28+
config:
29+
languages:
30+
YOUR_LANGUAGE:
31+
```
32+
33+
This will tell Code Climate to run the duplication engine with `YOUR_LANGUAGE`.
34+
You can also specify a `paths` array under `YOUR_LANGUAGE` which use Ruby's
35+
[`Dir.glob`][glob] format.
36+
37+
For example, all JavaScript and JSX files:
38+
39+
```yaml
40+
engines:
41+
duplication:
42+
enabled: true
43+
config:
44+
languages:
45+
javascript:
46+
paths:
47+
- "**/*.js"
48+
- "**/*.jsx"
49+
```
50+
51+
[glob]: http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob
52+
53+
You can also specify the mass threshold which is what determines how much "mass"
54+
a block of code needs before it's checked for duplication. This varies from
55+
language to language with higher numbers needing more mass to trigger a check
56+
and lower numbers needing less mass.
57+
58+
For example you could tell the engine to check only very large blocks of code:
59+
60+
```
61+
engines:
62+
duplication:
63+
enabled: true
64+
config:
65+
languages:
66+
javascript:
67+
mass_threshold: 300
68+
```

0 commit comments

Comments
 (0)