dashboard.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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="ProductController.php.html#5">ProductController</a></td><td class="text-right">0%</td></tr>
  62. <tr><td><a href="CategoryController.php.html#5">CategoryController</a></td><td class="text-right">0%</td></tr>
  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. </tbody>
  79. </table>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="row">
  84. <div class="col-md-12">
  85. <h2>Methods</h2>
  86. </div>
  87. </div>
  88. <div class="row">
  89. <div class="col-md-6">
  90. <h3>Coverage Distribution</h3>
  91. <div id="methodCoverageDistribution" style="height: 300px;">
  92. <svg></svg>
  93. </div>
  94. </div>
  95. <div class="col-md-6">
  96. <h3>Complexity</h3>
  97. <div id="methodComplexity" style="height: 300px;">
  98. <svg></svg>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="row">
  103. <div class="col-md-6">
  104. <h3>Insufficient Coverage</h3>
  105. <div class="scrollbox">
  106. <table class="table">
  107. <thead>
  108. <tr>
  109. <th>Method</th>
  110. <th class="text-right">Coverage</th>
  111. </tr>
  112. </thead>
  113. <tbody>
  114. <tr><td><a href="ProductController.php.html#13"><abbr title="ProductController::start">start</a></a></td><td class="text-right">0%</td></tr>
  115. <tr><td><a href="ProductController.php.html#7"><abbr title="ProductController::__construct">__construct</a></a></td><td class="text-right">0%</td></tr>
  116. <tr><td><a href="CategoryController.php.html#12"><abbr title="CategoryController::start">start</a></a></td><td class="text-right">0%</td></tr>
  117. <tr><td><a href="CategoryController.php.html#7"><abbr title="CategoryController::__construct">__construct</a></a></td><td class="text-right">0%</td></tr>
  118. </tbody>
  119. </table>
  120. </div>
  121. </div>
  122. <div class="col-md-6">
  123. <h3>Project Risks</h3>
  124. <div class="scrollbox">
  125. <table class="table">
  126. <thead>
  127. <tr>
  128. <th>Method</th>
  129. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  130. </tr>
  131. </thead>
  132. <tbody>
  133. </tbody>
  134. </table>
  135. </div>
  136. </div>
  137. </div>
  138. <footer>
  139. <hr/>
  140. <p>
  141. <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 Tue Aug 4 22:53:33 UTC 2015.</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. d3.select('#classCoverageDistribution svg')
  161. .datum(getCoverageDistributionData([2,0,0,0,0,0,0,0,0,0,0,0], "Class Coverage"))
  162. .transition().duration(500).call(chart);
  163. nv.utils.windowResize(chart.update);
  164. return chart;
  165. });
  166. nv.addGraph(function() {
  167. var chart = nv.models.multiBarChart();
  168. chart.tooltips(false)
  169. .showControls(false)
  170. .showLegend(false)
  171. .reduceXTicks(false)
  172. .staggerLabels(true)
  173. .yAxis.tickFormat(d3.format('d'));
  174. d3.select('#methodCoverageDistribution svg')
  175. .datum(getCoverageDistributionData([4,0,0,0,0,0,0,0,0,0,0,0], "Method Coverage"))
  176. .transition().duration(500).call(chart);
  177. nv.utils.windowResize(chart.update);
  178. return chart;
  179. });
  180. function getCoverageDistributionData(data, label) {
  181. var labels = [
  182. '0%',
  183. '0-10%',
  184. '10-20%',
  185. '20-30%',
  186. '30-40%',
  187. '40-50%',
  188. '50-60%',
  189. '60-70%',
  190. '70-80%',
  191. '80-90%',
  192. '90-100%',
  193. '100%'
  194. ];
  195. var values = [];
  196. $.each(labels, function(key) {
  197. values.push({x: labels[key], y: data[key]});
  198. });
  199. return [
  200. {
  201. key: label,
  202. values: values,
  203. color: "#4572A7"
  204. }
  205. ];
  206. }
  207. nv.addGraph(function() {
  208. var chart = nv.models.scatterChart()
  209. .showDistX(true)
  210. .showDistY(true)
  211. .showLegend(false)
  212. .forceX([0, 100]);
  213. chart.tooltipContent(function(key, y, e, graph) {
  214. return '<p>' + graph.point.class + '</p>';
  215. });
  216. chart.xAxis.axisLabel('Code Coverage (in percent)');
  217. chart.yAxis.axisLabel('Cyclomatic Complexity');
  218. d3.select('#classComplexity svg')
  219. .datum(getComplexityData([[0,2,"<a href=\"CategoryController.php.html#5\">CategoryController<\/a>"],[0,2,"<a href=\"ProductController.php.html#5\">ProductController<\/a>"]], 'Class Complexity'))
  220. .transition()
  221. .duration(500)
  222. .call(chart);
  223. nv.utils.windowResize(chart.update);
  224. return chart;
  225. });
  226. nv.addGraph(function() {
  227. var chart = nv.models.scatterChart()
  228. .showDistX(true)
  229. .showDistY(true)
  230. .showLegend(false)
  231. .forceX([0, 100]);
  232. chart.tooltipContent(function(key, y, e, graph) {
  233. return '<p>' + graph.point.class + '</p>';
  234. });
  235. chart.xAxis.axisLabel('Code Coverage (in percent)');
  236. chart.yAxis.axisLabel('Method Complexity');
  237. d3.select('#methodComplexity svg')
  238. .datum(getComplexityData([[0,1,"<a href=\"CategoryController.php.html#7\">CategoryController::__construct<\/a>"],[0,1,"<a href=\"CategoryController.php.html#12\">CategoryController::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'))
  239. .transition()
  240. .duration(500)
  241. .call(chart);
  242. nv.utils.windowResize(chart.update);
  243. return chart;
  244. });
  245. function getComplexityData(data, label) {
  246. var values = [];
  247. $.each(data, function(key) {
  248. var value = Math.round(data[key][0]*100) / 100;
  249. values.push({
  250. x: value,
  251. y: data[key][1],
  252. class: data[key][2],
  253. size: 0.05,
  254. shape: 'diamond'
  255. });
  256. });
  257. return [
  258. {
  259. key: label,
  260. values: values,
  261. color: "#4572A7"
  262. }
  263. ];
  264. }
  265. });
  266. </script>
  267. </body>
  268. </html>