-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcpd.config.php.dist
More file actions
72 lines (52 loc) · 2.45 KB
/
Copy pathphpcpd.config.php.dist
File metadata and controls
72 lines (52 loc) · 2.45 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
declare(strict_types=1);
use Systemsdk\PhpCPD\Config\Config;
return Config::make()
/*
* -------------------------------------------------------------------------
* REQUIRED SETTINGS
* -------------------------------------------------------------------------
*/
// Directories to scan (Required unless provided via CLI arguments)
->withDirectories(['src', 'tests'])
/*
* -------------------------------------------------------------------------
* DEFAULT SETTINGS (Can be safely removed if you are fine with the defaults)
* -------------------------------------------------------------------------
*/
// Suffixes of files to parse (Default: ['.php'])
->withSuffixes(['.php'])
// Paths or path segments to exclude from analysis (Default: [])
->exclude([])
// Minimum number of identical lines to be considered a clone (Default: 5)
->withMinLines(5)
// Minimum number of identical tokens to be considered a clone (Default: 70)
->withMinTokens(70)
// Select which algorithm to use: useRabinKarpAlgorithm() or useSuffixTreeAlgorithm() (Default: Rabin-Karp)
->useRabinKarpAlgorithm()
// Distance in number of edits between two clones (Only for suffix-tree; Default: 0)
->withEditDistance(0)
// Minimum equality at start of clone (Only for suffix-tree; Default: 10)
->withHeadEquality(10)
// Fuzz variable names (Default: false)
->withFuzzy(false)
// Return a success exit code (0) even if no files were found (Default: false)
->withIgnoreNoFiles(false)
// Print detailed results to the CLI (Default: false)
->withVerbose(false)
// Disable all output except file logs and error messages (Default: false)
->withQuiet(false)
// Fail only if the percentage of duplicated lines exceeds this threshold (Default: 0.0)
->withMaxPercentage(0.0)
// Always exit with 0, regardless of violations found (Default: false)
->withIgnoreViolationsOnExit(false)
/*
* -------------------------------------------------------------------------
* REPORT GENERATION (Optional)
* Uncomment the following lines to generate reports in various formats
* -------------------------------------------------------------------------
*/
// ->withPmdCpdXmlLogfile('reports/phpcpd/phpcpd-report-v1.xml')
// ->withJsonLogfile('reports/phpcpd/phpcpd-report.json')
// ->withSarifLogfile('reports/phpcpd/phpcpd-report.sarif')
;