1<!DOCTYPE html> 2<html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Dashboard for %s</title> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <link href="css/bootstrap.min.css" rel="stylesheet"> 8 <link href="css/nv.d3.min.css" rel="stylesheet"> 9 <link href="css/style.css" rel="stylesheet"> 10 <!--[if lt IE 9]> 11 <script src="js/html5shiv.min.js"></script> 12 <script src="js/respond.min.js"></script> 13 <![endif]--> 14 </head> 15 <body> 16 <header> 17 <div class="container"> 18 <div class="row"> 19 <div class="col-md-12"> 20 <ol class="breadcrumb"> 21 <li><a href="index.html">%s</a></li> 22 <li class="active">(Dashboard)</li> 23 24 </ol> 25 </div> 26 </div> 27 </div> 28 </header> 29 <div class="container"> 30 <div class="row"> 31 <div class="col-md-12"> 32 <h2>Classes</h2> 33 </div> 34 </div> 35 <div class="row"> 36 <div class="col-md-6"> 37 <h3>Coverage Distribution</h3> 38 <div id="classCoverageDistribution" style="height: 300px;"> 39 <svg></svg> 40 </div> 41 </div> 42 <div class="col-md-6"> 43 <h3>Complexity</h3> 44 <div id="classComplexity" style="height: 300px;"> 45 <svg></svg> 46 </div> 47 </div> 48 </div> 49 <div class="row"> 50 <div class="col-md-6"> 51 <h3>Insufficient Coverage</h3> 52 <div class="scrollbox"> 53 <table class="table"> 54 <thead> 55 <tr> 56 <th>Class</th> 57 <th class="text-right">Coverage</th> 58 </tr> 59 </thead> 60 <tbody> 61 <tr><td><a href="source_with_class_and_anonymous_function.php.html#3">CoveredClassWithAnonymousFunctionInStaticMethod</a></td><td class="text-right">87%</td></tr> 62 63 </tbody> 64 </table> 65 </div> 66 </div> 67 <div class="col-md-6"> 68 <h3>Project Risks</h3> 69 <div class="scrollbox"> 70 <table class="table"> 71 <thead> 72 <tr> 73 <th>Class</th> 74 <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th> 75 </tr> 76 </thead> 77 <tbody> 78 79 </tbody> 80 </table> 81 </div> 82 </div> 83 </div> 84 <div class="row"> 85 <div class="col-md-12"> 86 <h2>Methods</h2> 87 </div> 88 </div> 89 <div class="row"> 90 <div class="col-md-6"> 91 <h3>Coverage Distribution</h3> 92 <div id="methodCoverageDistribution" style="height: 300px;"> 93 <svg></svg> 94 </div> 95 </div> 96 <div class="col-md-6"> 97 <h3>Complexity</h3> 98 <div id="methodComplexity" style="height: 300px;"> 99 <svg></svg> 100 </div> 101 </div> 102 </div> 103 <div class="row"> 104 <div class="col-md-6"> 105 <h3>Insufficient Coverage</h3> 106 <div class="scrollbox"> 107 <table class="table"> 108 <thead> 109 <tr> 110 <th>Method</th> 111 <th class="text-right">Coverage</th> 112 </tr> 113 </thead> 114 <tbody> 115 <tr><td><a href="source_with_class_and_anonymous_function.php.html#5"><abbr title="CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous">runAnonymous</abbr></a></td><td class="text-right">66%</td></tr> 116 117 </tbody> 118 </table> 119 </div> 120 </div> 121 <div class="col-md-6"> 122 <h3>Project Risks</h3> 123 <div class="scrollbox"> 124 <table class="table"> 125 <thead> 126 <tr> 127 <th>Method</th> 128 <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th> 129 </tr> 130 </thead> 131 <tbody> 132 133 </tbody> 134 </table> 135 </div> 136 </div> 137 </div> 138 <footer> 139 <hr/> 140 <p> 141 <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage %s</a> using <a href="%s" target="_top">%s</a> at %s.</small> 142 </p> 143 </footer> 144 </div> 145 <script src="js/jquery.min.js" type="text/javascript"></script> 146 <script src="js/bootstrap.min.js" type="text/javascript"></script> 147 <script src="js/holder.min.js" type="text/javascript"></script> 148 <script src="js/d3.min.js" type="text/javascript"></script> 149 <script src="js/nv.d3.min.js" type="text/javascript"></script> 150 <script type="text/javascript"> 151$(document).ready(function() { 152 nv.addGraph(function() { 153 var chart = nv.models.multiBarChart(); 154 chart.tooltips(false) 155 .showControls(false) 156 .showLegend(false) 157 .reduceXTicks(false) 158 .staggerLabels(true) 159 .yAxis.tickFormat(d3.format('d')); 160 161 d3.select('#classCoverageDistribution svg') 162 .datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,1,0,0], "Class Coverage")) 163 .transition().duration(500).call(chart); 164 165 nv.utils.windowResize(chart.update); 166 167 return chart; 168 }); 169 170 nv.addGraph(function() { 171 var chart = nv.models.multiBarChart(); 172 chart.tooltips(false) 173 .showControls(false) 174 .showLegend(false) 175 .reduceXTicks(false) 176 .staggerLabels(true) 177 .yAxis.tickFormat(d3.format('d')); 178 179 d3.select('#methodCoverageDistribution svg') 180 .datum(getCoverageDistributionData([0,0,0,0,0,0,0,1,0,0,0,1], "Method Coverage")) 181 .transition().duration(500).call(chart); 182 183 nv.utils.windowResize(chart.update); 184 185 return chart; 186 }); 187 188 function getCoverageDistributionData(data, label) { 189 var labels = [ 190 '0%', 191 '0-10%', 192 '10-20%', 193 '20-30%', 194 '30-40%', 195 '40-50%', 196 '50-60%', 197 '60-70%', 198 '70-80%', 199 '80-90%', 200 '90-100%', 201 '100%' 202 ]; 203 var values = []; 204 $.each(labels, function(key) { 205 values.push({x: labels[key], y: data[key]}); 206 }); 207 208 return [ 209 { 210 key: label, 211 values: values, 212 color: "#4572A7" 213 } 214 ]; 215 } 216 nv.addGraph(function() { 217 var chart = nv.models.scatterChart() 218 .showDistX(true) 219 .showDistY(true) 220 .showLegend(false) 221 .forceX([0, 100]); 222 chart.tooltipContent(function(graph) { 223 return '<p>' + graph.point.class + '</p>'; 224 }); 225 226 chart.xAxis.axisLabel('Code Coverage (in percent)'); 227 chart.yAxis.axisLabel('Cyclomatic Complexity'); 228 229 d3.select('#classComplexity svg') 230 .datum(getComplexityData([[87.5,2,"<a href=\"source_with_class_and_anonymous_function.php.html#3\">CoveredClassWithAnonymousFunctionInStaticMethod<\/a>"]], 'Class Complexity')) 231 .transition() 232 .duration(500) 233 .call(chart); 234 235 nv.utils.windowResize(chart.update); 236 237 return chart; 238 }); 239 240 nv.addGraph(function() { 241 var chart = nv.models.scatterChart() 242 .showDistX(true) 243 .showDistY(true) 244 .showLegend(false) 245 .forceX([0, 100]); 246 chart.tooltipContent(function(graph) { 247 return '<p>' + graph.point.class + '</p>'; 248 }); 249 250 chart.xAxis.axisLabel('Code Coverage (in percent)'); 251 chart.yAxis.axisLabel('Method Complexity'); 252 253 d3.select('#methodComplexity svg') 254 .datum(getComplexityData([[66.666666666667,1,"<a href=\"source_with_class_and_anonymous_function.php.html#5\">CoveredClassWithAnonymousFunctionInStaticMethod::runAnonymous<\/a>"],[100,1,"<a href=\"source_with_class_and_anonymous_function.php.html#11\">CoveredClassWithAnonymousFunctionInStaticMethod::anonymous function<\/a>"]], 'Method Complexity')) 255 .transition() 256 .duration(500) 257 .call(chart); 258 259 nv.utils.windowResize(chart.update); 260 261 return chart; 262 }); 263 264 function getComplexityData(data, label) { 265 var values = []; 266 $.each(data, function(key) { 267 var value = Math.round(data[key][0]*100) / 100; 268 values.push({ 269 x: value, 270 y: data[key][1], 271 class: data[key][2], 272 size: 0.05, 273 shape: 'diamond' 274 }); 275 }); 276 277 return [ 278 { 279 key: label, 280 values: values, 281 color: "#4572A7" 282 } 283 ]; 284 } 285}); 286 </script> 287 </body> 288</html> 289