-
Notifications
You must be signed in to change notification settings - Fork 16
/
jsinspect.cli.txt
40 lines (31 loc) · 2.98 KB
/
jsinspect.cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
JSINSPECT
ALTERNATIVES ==> #See jscpd
VERSION ==> #0.12.6
#Reports duplicated code
#Uses AST with Babylon, including plugins for JSX|Flow and recent ES syntax
#Duplicated code is:
# - NUM identical AST nodes
# - identical means: same NODE.type, same VAR names, same VAL values
CONFIG ==> #Can be:
# - ./.jsinspectrc JSON_FILE
# - jsinspect --config JSON_FILE
#Where JSON_FILE uses same options as CLI flags, but camelCased
jsinspect FILE|DIR... #Exit code of non-0 when found duplicated code
#Only analyze .js|.jsx
--ignore REGEX #Ignore FILE|DIR... matching REGEX
#Always implied: node_modules, bower_components, test, spec
--reporter REPORTER #Among:
# - default (def): CLI-friendly
# - json: OBJ_ARR: id STR, instances OBJ_ARR: path STR, lines [NUM, NUM2], code STR
# - pmd (XML)
--no-color #
--truncate NUM #Shorten reported snippet (def: 100, 0 to disable)
--min-instances NUM #How many times duplication must happen to report it
#Def: 2
--threshold NUM #Report any set of NUM AST nodes that are identical.
#Lower for more matches.
#Def: 30
--no-identifiers #Do not check VAR names, i.e. report duplicated even if VAR names are different
--no-literals #Do not check VAL values, i.e. report duplicated even if values are different