You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-1Lines changed: 75 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,32 @@ Will output:
17
17
18
18
## Bubbles chart and complete report
19
19
20
-
If you want to get the HTMl report (with charts):
20
+
If you want to get the summary HTML report (with charts):
21
21
22
22
php ./bin/metrics.php --summary-html=/path/of/your/choice.html <folder or filename>
23
23
24
+
You can change the depth of the summary report with the `--level=<value>` option.
25
+
26
+
If you want to have a detailled view (file by file):
27
+
28
+
php ./bin/metrics.php --details-html=/path/of/your/choice.html <folder or filename>
29
+
30
+
## Informations about OOP model
31
+
32
+
If you want to get informations about OOP model (coupling, instability...), you should pass the `--oop` parameter:
33
+
34
+
php ./bin/metrics.php --oop <folder or filename>
35
+
36
+
Remember that this feature parse all files, extract declared classes, dependencies of each method... and is really *very slow*.
37
+
38
+
## Jenkins and PIC integration
39
+
40
+
You can easily export resut to XML with the `--summary-xml` option:
41
+
42
+
php ./bin/metrics.php --summary-xml=/path/of/your/choice.xml <folder or filename>
43
+
44
+
You will find a tutorial to [integrate PhpMetrics report to Jenkins here](blog.lepine.pro/industrialisation/indice-de-maintenabilite-dun-projet-php-et-jenkins) (in French).
45
+
24
46
### Read report
25
47
26
48
+ Each file is symbolized by a circle
@@ -86,6 +108,17 @@ Comment weight represents the impact of documentation in code.
86
108
perCM = commentLoc / loc
87
109
MIcw = 50 * sin(sqrt(2.4 * perCM))
88
110
111
+
## Coupling and instability
112
+
113
+
Coupling use two metrics:
114
+
115
+
+ Afferent coupling (CA): number of classes that your classes affects
116
+
+ Efferent coupling (CE) : number of classes used by your class
117
+
118
+
Instability concerns the risk of your class, according coupling:
119
+
120
+
I = CE / (CA + CE)
121
+
89
122
# Use it in code
90
123
91
124
## Halstead
@@ -113,6 +146,47 @@ $maintenability = new \MaintenabilityIndex\MaintenabilityIndex;
0 commit comments