dashboard.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dashboard for /win/work/Project/ecom/core/controllers</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">/win/work/Project/ecom/core</a></li>
  22. <li><a href="index.html">controllers</a></li>
  23. <li class="active">(Dashboard)</li>
  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="CategoryController.php.html#5">CategoryController</a></td><td class="text-right">0%</td></tr>
  62. <tr><td><a href="ProductController.php.html#5">ProductController</a></td><td class="text-right">0%</td></tr>
  63. <tr><td><a href="Error404.php.html#5">Error404</a></td><td class="text-right">66%</td></tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. <div class="col-md-6">
  69. <h3>Project Risks</h3>
  70. <div class="scrollbox">
  71. <table class="table">
  72. <thead>
  73. <tr>
  74. <th>Class</th>
  75. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  76. </tr>
  77. </thead>
  78. <tbody>
  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="ProductController.php.html#13"><abbr title="ProductController::start">start</a></a></td><td class="text-right">0%</td></tr>
  116. <tr><td><a href="ProductController.php.html#7"><abbr title="ProductController::__construct">__construct</a></a></td><td class="text-right">0%</td></tr>
  117. <tr><td><a href="Error404.php.html#12"><abbr title="Error404::start">start</a></a></td><td class="text-right">0%</td></tr>
  118. <tr><td><a href="CategoryController.php.html#12"><abbr title="CategoryController::start">start</a></a></td><td class="text-right">0%</td></tr>
  119. <tr><td><a href="CategoryController.php.html#7"><abbr title="CategoryController::__construct">__construct</a></a></td><td class="text-right">0%</td></tr>
  120. </tbody>
  121. </table>
  122. </div>
  123. </div>
  124. <div class="col-md-6">
  125. <h3>Project Risks</h3>
  126. <div class="scrollbox">
  127. <table class="table">
  128. <thead>
  129. <tr>
  130. <th>Method</th>
  131. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. </tbody>
  136. </table>
  137. </div>
  138. </div>
  139. </div>
  140. <footer>
  141. <hr/>
  142. <p>
  143. <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.8</a> using <a href="http://php.net/" target="_top">PHP 5.6.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.7</a> at Wed Aug 12 18:42:22 UTC 2015.</small>
  144. </p>
  145. </footer>
  146. </div>
  147. <script src="../js/jquery.min.js" type="text/javascript"></script>
  148. <script src="../js/bootstrap.min.js" type="text/javascript"></script>
  149. <script src="../js/holder.min.js" type="text/javascript"></script>
  150. <script src="../js/d3.min.js" type="text/javascript"></script>
  151. <script src="../js/nv.d3.min.js" type="text/javascript"></script>
  152. <script type="text/javascript">
  153. $(document).ready(function() {
  154. nv.addGraph(function() {
  155. var chart = nv.models.multiBarChart();
  156. chart.tooltips(false)
  157. .showControls(false)
  158. .showLegend(false)
  159. .reduceXTicks(false)
  160. .staggerLabels(true)
  161. .yAxis.tickFormat(d3.format('d'));
  162. d3.select('#classCoverageDistribution svg')
  163. .datum(getCoverageDistributionData([2,0,0,0,0,0,0,1,0,0,0,0], "Class Coverage"))
  164. .transition().duration(500).call(chart);
  165. nv.utils.windowResize(chart.update);
  166. return chart;
  167. });
  168. nv.addGraph(function() {
  169. var chart = nv.models.multiBarChart();
  170. chart.tooltips(false)
  171. .showControls(false)
  172. .showLegend(false)
  173. .reduceXTicks(false)
  174. .staggerLabels(true)
  175. .yAxis.tickFormat(d3.format('d'));
  176. d3.select('#methodCoverageDistribution svg')
  177. .datum(getCoverageDistributionData([5,0,0,0,0,0,0,0,0,0,0,1], "Method Coverage"))
  178. .transition().duration(500).call(chart);
  179. nv.utils.windowResize(chart.update);
  180. return chart;
  181. });
  182. function getCoverageDistributionData(data, label) {
  183. var labels = [
  184. '0%',
  185. '0-10%',
  186. '10-20%',
  187. '20-30%',
  188. '30-40%',
  189. '40-50%',
  190. '50-60%',
  191. '60-70%',
  192. '70-80%',
  193. '80-90%',
  194. '90-100%',
  195. '100%'
  196. ];
  197. var values = [];
  198. $.each(labels, function(key) {
  199. values.push({x: labels[key], y: data[key]});
  200. });
  201. return [
  202. {
  203. key: label,
  204. values: values,
  205. color: "#4572A7"
  206. }
  207. ];
  208. }
  209. nv.addGraph(function() {
  210. var chart = nv.models.scatterChart()
  211. .showDistX(true)
  212. .showDistY(true)
  213. .showLegend(false)
  214. .forceX([0, 100]);
  215. chart.tooltipContent(function(key, y, e, graph) {
  216. return '<p>' + graph.point.class + '</p>';
  217. });
  218. chart.xAxis.axisLabel('Code Coverage (in percent)');
  219. chart.yAxis.axisLabel('Cyclomatic Complexity');
  220. d3.select('#classComplexity svg')
  221. .datum(getComplexityData([[0,2,"<a href=\"CategoryController.php.html#5\">CategoryController<\/a>"],[66.666666666667,2,"<a href=\"Error404.php.html#5\">Error404<\/a>"],[0,2,"<a href=\"ProductController.php.html#5\">ProductController<\/a>"]], 'Class Complexity'))
  222. .transition()
  223. .duration(500)
  224. .call(chart);
  225. nv.utils.windowResize(chart.update);
  226. return chart;
  227. });
  228. nv.addGraph(function() {
  229. var chart = nv.models.scatterChart()
  230. .showDistX(true)
  231. .showDistY(true)
  232. .showLegend(false)
  233. .forceX([0, 100]);
  234. chart.tooltipContent(function(key, y, e, graph) {
  235. return '<p>' + graph.point.class + '</p>';
  236. });
  237. chart.xAxis.axisLabel('Code Coverage (in percent)');
  238. chart.yAxis.axisLabel('Method Complexity');
  239. d3.select('#methodComplexity svg')
  240. .datum(getComplexityData([[0,1,"<a href=\"CategoryController.php.html#7\">CategoryController::__construct<\/a>"],[0,1,"<a href=\"CategoryController.php.html#12\">CategoryController::start<\/a>"],[100,1,"<a href=\"Error404.php.html#7\">Error404::__construct<\/a>"],[0,1,"<a href=\"Error404.php.html#12\">Error404::start<\/a>"],[0,1,"<a href=\"ProductController.php.html#7\">ProductController::__construct<\/a>"],[0,1,"<a href=\"ProductController.php.html#13\">ProductController::start<\/a>"]], 'Method Complexity'))
  241. .transition()
  242. .duration(500)
  243. .call(chart);
  244. nv.utils.windowResize(chart.update);
  245. return chart;
  246. });
  247. function getComplexityData(data, label) {
  248. var values = [];
  249. $.each(data, function(key) {
  250. var value = Math.round(data[key][0]*100) / 100;
  251. values.push({
  252. x: value,
  253. y: data[key][1],
  254. class: data[key][2],
  255. size: 0.05,
  256. shape: 'diamond'
  257. });
  258. });
  259. return [
  260. {
  261. key: label,
  262. values: values,
  263. color: "#4572A7"
  264. }
  265. ];
  266. }
  267. });
  268. </script>
  269. </body>
  270. </html>