@@ -62,19 +62,17 @@ class PHP_CodeCoverage_Report_HTML_Renderer_Dashboard extends PHP_CodeCoverage_R
6262 */
6363 public function render (PHP_CodeCoverage_Report_Node_Directory $ node , $ file )
6464 {
65- $ classes = $ node ->getClassesAndTraits ();
66- $ isRoot = $ node ->getParent () === null ;
67-
65+ $ classes = $ node ->getClassesAndTraits ();
6866 $ template = new Text_Template (
6967 $ this ->templatePath . 'dashboard.html ' , '{{ ' , '}} '
7068 );
7169
7270 $ this ->setCommonTemplateVariables ($ template , $ node );
7371
74- $ complexity = $ this ->complexity ($ classes, $ isRoot );
75- $ coverageDistribution = $ this ->coverageDistribution ($ classes, $ isRoot );
76- $ insufficientCoverage = $ this ->insufficientCoverage ($ classes, $ isRoot );
77- $ projectRisks = $ this ->projectRisks ($ classes, $ isRoot );
72+ $ complexity = $ this ->complexity ($ classes );
73+ $ coverageDistribution = $ this ->coverageDistribution ($ classes );
74+ $ insufficientCoverage = $ this ->insufficientCoverage ($ classes );
75+ $ projectRisks = $ this ->projectRisks ($ classes );
7876
7977 $ template ->setVar (
8078 array (
@@ -95,11 +93,10 @@ public function render(PHP_CodeCoverage_Report_Node_Directory $node, $file)
9593 /**
9694 * Returns the data for the Class/Method Complexity charts.
9795 *
98- * @param array $classes
99- * @param boolean $isRoot
96+ * @param array $classes
10097 * @return array
10198 */
102- protected function complexity (array $ classes, $ isRoot )
99+ protected function complexity (array $ classes )
103100 {
104101 $ result = array ('class ' => array (), 'method ' => array ());
105102
@@ -114,7 +111,7 @@ protected function complexity(array $classes, $isRoot)
114111 $ method ['ccn ' ],
115112 sprintf (
116113 '<a href="%s">%s</a> ' ,
117- $ this -> rebaseLink ( $ method ['link ' ], $ isRoot ) ,
114+ $ method ['link ' ],
118115 $ methodName
119116 )
120117 );
@@ -125,7 +122,7 @@ protected function complexity(array $classes, $isRoot)
125122 $ class ['ccn ' ],
126123 sprintf (
127124 '<a href="%s">%s</a> ' ,
128- $ this -> rebaseLink ( $ class ['link ' ], $ isRoot ) ,
125+ $ class ['link ' ],
129126 $ className
130127 )
131128 );
@@ -140,11 +137,10 @@ protected function complexity(array $classes, $isRoot)
140137 /**
141138 * Returns the data for the Class / Method Coverage Distribution chart.
142139 *
143- * @param array $classes
144- * @param boolean $isRoot
140+ * @param array $classes
145141 * @return array
146142 */
147- protected function coverageDistribution (array $ classes, $ isRoot )
143+ protected function coverageDistribution (array $ classes )
148144 {
149145 $ result = array (
150146 'class ' => array (
@@ -210,11 +206,10 @@ protected function coverageDistribution(array $classes, $isRoot)
210206 /**
211207 * Returns the classes / methods with insufficient coverage.
212208 *
213- * @param array $classes
214- * @param boolean $isRoot
209+ * @param array $classes
215210 * @return array
216211 */
217- protected function insufficientCoverage (array $ classes, $ isRoot )
212+ protected function insufficientCoverage (array $ classes )
218213 {
219214 $ leastTestedClasses = array ();
220215 $ leastTestedMethods = array ();
@@ -244,7 +239,7 @@ protected function insufficientCoverage(array $classes, $isRoot)
244239 foreach ($ leastTestedClasses as $ className => $ coverage ) {
245240 $ result ['class ' ] .= sprintf (
246241 ' <tr><td><a href="%s">%s</a></td><td class="text-right">%d%%</td></tr> ' . "\n" ,
247- $ this -> rebaseLink ( $ classes [$ className ]['link ' ], $ isRoot ) ,
242+ $ classes [$ className ]['link ' ],
248243 $ className ,
249244 $ coverage
250245 );
@@ -255,7 +250,7 @@ protected function insufficientCoverage(array $classes, $isRoot)
255250
256251 $ result ['method ' ] .= sprintf (
257252 ' <tr><td><a href="%s"><abbr title="%s">%s</a></a></td><td class="text-right">%d%%</td></tr> ' . "\n" ,
258- $ this -> rebaseLink ( $ classes [$ class ]['methods ' ][$ method ]['link ' ], $ isRoot ) ,
253+ $ classes [$ class ]['methods ' ][$ method ]['link ' ],
259254 $ methodName ,
260255 $ method ,
261256 $ coverage
@@ -268,11 +263,10 @@ protected function insufficientCoverage(array $classes, $isRoot)
268263 /**
269264 * Returns the project risks according to the CRAP index.
270265 *
271- * @param array $classes
272- * @param boolean $isRoot
266+ * @param array $classes
273267 * @return array
274268 */
275- protected function projectRisks (array $ classes, $ isRoot )
269+ protected function projectRisks (array $ classes )
276270 {
277271 $ classRisks = array ();
278272 $ methodRisks = array ();
@@ -304,7 +298,7 @@ protected function projectRisks(array $classes, $isRoot)
304298 foreach ($ classRisks as $ className => $ crap ) {
305299 $ result ['class ' ] .= sprintf (
306300 ' <tr><td><a href="%s">%s</a></td><td class="text-right">%d</td></tr> ' . "\n" ,
307- $ this -> rebaseLink ( $ classes [$ className ]['link ' ], $ isRoot ) ,
301+ $ classes [$ className ]['link ' ],
308302 $ className ,
309303 $ crap
310304 );
@@ -315,7 +309,7 @@ protected function projectRisks(array $classes, $isRoot)
315309
316310 $ result ['method ' ] .= sprintf (
317311 ' <tr><td><a href="%s"><abbr title="%s">%s</abbr></a></td><td class="text-right">%d</td></tr> ' . "\n" ,
318- $ this -> rebaseLink ( $ classes [$ class ]['methods ' ][$ method ]['link ' ], $ isRoot ) ,
312+ $ classes [$ class ]['methods ' ][$ method ]['link ' ],
319313 $ methodName ,
320314 $ method ,
321315 $ crap
@@ -333,15 +327,4 @@ protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node)
333327 $ node ->getName ()
334328 );
335329 }
336-
337- /**
338- * @param string $link
339- * @param boolean $isRoot
340- * @return string
341- * @since Method available since Release 2.0.12
342- */
343- private function rebaseLink ($ link , $ isRoot )
344- {
345- return $ isRoot ? $ link : substr ($ link , strpos ($ link , '/ ' ) + 1 );
346- }
347330}
0 commit comments