dashboard.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dashboard for /win/work/Project/julia/core/setup</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/julia/core</a></li>
  22. <li><a href="index.html">setup</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. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. <div class="col-md-6">
  66. <h3>Project Risks</h3>
  67. <div class="scrollbox">
  68. <table class="table">
  69. <thead>
  70. <tr>
  71. <th>Class</th>
  72. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  73. </tr>
  74. </thead>
  75. <tbody>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="row">
  82. <div class="col-md-12">
  83. <h2>Methods</h2>
  84. </div>
  85. </div>
  86. <div class="row">
  87. <div class="col-md-6">
  88. <h3>Coverage Distribution</h3>
  89. <div id="methodCoverageDistribution" style="height: 300px;">
  90. <svg></svg>
  91. </div>
  92. </div>
  93. <div class="col-md-6">
  94. <h3>Complexity</h3>
  95. <div id="methodComplexity" style="height: 300px;">
  96. <svg></svg>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="row">
  101. <div class="col-md-6">
  102. <h3>Insufficient Coverage</h3>
  103. <div class="scrollbox">
  104. <table class="table">
  105. <thead>
  106. <tr>
  107. <th>Method</th>
  108. <th class="text-right">Coverage</th>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. </tbody>
  113. </table>
  114. </div>
  115. </div>
  116. <div class="col-md-6">
  117. <h3>Project Risks</h3>
  118. <div class="scrollbox">
  119. <table class="table">
  120. <thead>
  121. <tr>
  122. <th>Method</th>
  123. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. </tbody>
  128. </table>
  129. </div>
  130. </div>
  131. </div>
  132. <footer>
  133. <hr/>
  134. <p>
  135. <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 Sun Aug 16 13:50:53 UTC 2015.</small>
  136. </p>
  137. </footer>
  138. </div>
  139. <script src="../js/jquery.min.js" type="text/javascript"></script>
  140. <script src="../js/bootstrap.min.js" type="text/javascript"></script>
  141. <script src="../js/holder.min.js" type="text/javascript"></script>
  142. <script src="../js/d3.min.js" type="text/javascript"></script>
  143. <script src="../js/nv.d3.min.js" type="text/javascript"></script>
  144. <script type="text/javascript">
  145. $(document).ready(function() {
  146. nv.addGraph(function() {
  147. var chart = nv.models.multiBarChart();
  148. chart.tooltips(false)
  149. .showControls(false)
  150. .showLegend(false)
  151. .reduceXTicks(false)
  152. .staggerLabels(true)
  153. .yAxis.tickFormat(d3.format('d'));
  154. d3.select('#classCoverageDistribution svg')
  155. .datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,0], "Class Coverage"))
  156. .transition().duration(500).call(chart);
  157. nv.utils.windowResize(chart.update);
  158. return chart;
  159. });
  160. nv.addGraph(function() {
  161. var chart = nv.models.multiBarChart();
  162. chart.tooltips(false)
  163. .showControls(false)
  164. .showLegend(false)
  165. .reduceXTicks(false)
  166. .staggerLabels(true)
  167. .yAxis.tickFormat(d3.format('d'));
  168. d3.select('#methodCoverageDistribution svg')
  169. .datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,0,0,0,0], "Method Coverage"))
  170. .transition().duration(500).call(chart);
  171. nv.utils.windowResize(chart.update);
  172. return chart;
  173. });
  174. function getCoverageDistributionData(data, label) {
  175. var labels = [
  176. '0%',
  177. '0-10%',
  178. '10-20%',
  179. '20-30%',
  180. '30-40%',
  181. '40-50%',
  182. '50-60%',
  183. '60-70%',
  184. '70-80%',
  185. '80-90%',
  186. '90-100%',
  187. '100%'
  188. ];
  189. var values = [];
  190. $.each(labels, function(key) {
  191. values.push({x: labels[key], y: data[key]});
  192. });
  193. return [
  194. {
  195. key: label,
  196. values: values,
  197. color: "#4572A7"
  198. }
  199. ];
  200. }
  201. nv.addGraph(function() {
  202. var chart = nv.models.scatterChart()
  203. .showDistX(true)
  204. .showDistY(true)
  205. .showLegend(false)
  206. .forceX([0, 100]);
  207. chart.tooltipContent(function(key, y, e, graph) {
  208. return '<p>' + graph.point.class + '</p>';
  209. });
  210. chart.xAxis.axisLabel('Code Coverage (in percent)');
  211. chart.yAxis.axisLabel('Cyclomatic Complexity');
  212. d3.select('#classComplexity svg')
  213. .datum(getComplexityData([], 'Class Complexity'))
  214. .transition()
  215. .duration(500)
  216. .call(chart);
  217. nv.utils.windowResize(chart.update);
  218. return chart;
  219. });
  220. nv.addGraph(function() {
  221. var chart = nv.models.scatterChart()
  222. .showDistX(true)
  223. .showDistY(true)
  224. .showLegend(false)
  225. .forceX([0, 100]);
  226. chart.tooltipContent(function(key, y, e, graph) {
  227. return '<p>' + graph.point.class + '</p>';
  228. });
  229. chart.xAxis.axisLabel('Code Coverage (in percent)');
  230. chart.yAxis.axisLabel('Method Complexity');
  231. d3.select('#methodComplexity svg')
  232. .datum(getComplexityData([], 'Method Complexity'))
  233. .transition()
  234. .duration(500)
  235. .call(chart);
  236. nv.utils.windowResize(chart.update);
  237. return chart;
  238. });
  239. function getComplexityData(data, label) {
  240. var values = [];
  241. $.each(data, function(key) {
  242. var value = Math.round(data[key][0]*100) / 100;
  243. values.push({
  244. x: value,
  245. y: data[key][1],
  246. class: data[key][2],
  247. size: 0.05,
  248. shape: 'diamond'
  249. });
  250. });
  251. return [
  252. {
  253. key: label,
  254. values: values,
  255. color: "#4572A7"
  256. }
  257. ];
  258. }
  259. });
  260. </script>
  261. </body>
  262. </html>