|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* (c) Jean-François Lépine <https://twitter.com/Halleck45> |
|
5
|
|
|
* |
|
6
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
7
|
|
|
* file that was distributed with this source code. |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace Hal\Application\Rule; |
|
11
|
|
|
use Hal\Component\Result\ExportableInterface; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Rules |
|
16
|
|
|
* |
|
17
|
|
|
* @author Jean-François Lépine <https://twitter.com/Halleck45> |
|
18
|
|
|
*/ |
|
19
|
|
|
class DefaultRuleSet implements ExportableInterface { |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @inheritdoc |
|
23
|
|
|
*/ |
|
24
|
|
|
public function asArray() { |
|
25
|
|
|
return array( |
|
26
|
|
|
'cyclomaticComplexity' => array(10, 6, 2) |
|
27
|
|
|
, 'maintainabilityIndex' => array(0, 69, 85) |
|
28
|
|
|
, 'logicalLoc' => array(800, 400, 200) |
|
29
|
|
|
, 'volume' => array(1300, 1000, 300) |
|
30
|
|
|
, 'bugs' => array(0.35, 0.25, 0.15) |
|
31
|
|
|
, 'commentWeight' => array(36, 38, 41) |
|
32
|
|
|
, 'vocabulary' => array(51, 34, 27) |
|
33
|
|
|
, 'difficulty' => array(18, 15, 5.8) |
|
34
|
|
|
, 'instability' => array(1, .95, .45) |
|
35
|
|
|
, 'afferentCoupling' => array(20, 15, 9) |
|
36
|
|
|
, 'efferentCoupling' => array(15, 11, 7) |
|
37
|
|
|
, 'myerDistance' => array(10, 5, 2) |
|
38
|
|
|
, 'lcom' => array(3, 2, 1.5) |
|
39
|
|
|
); |
|
40
|
|
|
} |
|
41
|
|
|
} |