dashboard.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dashboard for D:\Demo\bswas\app\Console</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../.css/bootstrap.min.css" rel="stylesheet" type="text/css">
  8. <link href="../.css/nv.d3.min.css" rel="stylesheet" type="text/css">
  9. <link href="../.css/style.css" rel="stylesheet" type="text/css">
  10. <link href="../.css/custom.css" rel="stylesheet" type="text/css">
  11. </head>
  12. <body>
  13. <header>
  14. <div class="container-fluid">
  15. <div class="row">
  16. <div class="col-md-12">
  17. <nav aria-label="breadcrumb">
  18. <ol class="breadcrumb">
  19. <li class="breadcrumb-item"><a href="../index.html">D:\Demo\bswas\app</a></li>
  20. <li class="breadcrumb-item"><a href="index.html">Console</a></li>
  21. <li class="breadcrumb-item active">(Dashboard)</li>
  22. </ol>
  23. </nav>
  24. </div>
  25. </div>
  26. </div>
  27. </header>
  28. <div class="container-fluid">
  29. <div class="row">
  30. <div class="col-md-12">
  31. <h2>Classes</h2>
  32. </div>
  33. </div>
  34. <div class="row">
  35. <div class="col-md-6">
  36. <h3>Coverage Distribution</h3>
  37. <div id="classCoverageDistribution" style="height: 300px;">
  38. <svg></svg>
  39. </div>
  40. </div>
  41. <div class="col-md-6">
  42. <h3>Complexity</h3>
  43. <div id="classComplexity" style="height: 300px;">
  44. <svg></svg>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="col-md-6">
  50. <h3>Insufficient Coverage</h3>
  51. <div class="scrollbox">
  52. <table class="table">
  53. <thead>
  54. <tr>
  55. <th>Class</th>
  56. <th class="text-right">Coverage</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <tr><td><a href="Commands/RedisSubscribe.php.html#8">App\Console\Commands\RedisSubscribe</a></td><td class="text-right">66%</td></tr>
  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. <tr><td><a href="Commands/RedisSubscribe.php.html#39"><abbr title="App\Console\Commands\RedisSubscribe::handle">handle</abbr></a></td><td class="text-right">0%</td></tr>
  113. </tbody>
  114. </table>
  115. </div>
  116. </div>
  117. <div class="col-md-6">
  118. <h3>Project Risks</h3>
  119. <div class="scrollbox">
  120. <table class="table">
  121. <thead>
  122. <tr>
  123. <th>Method</th>
  124. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. </tbody>
  129. </table>
  130. </div>
  131. </div>
  132. </div>
  133. <footer>
  134. <hr/>
  135. <p>
  136. <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 6.1.4</a> using <a href="https://secure.php.net/" target="_top">PHP 7.3.5</a> with <a href="https://xdebug.org/">Xdebug 2.9.0</a> and <a href="https://phpunit.de/">PHPUnit 7.5.16</a> at Thu Dec 12 13:33:01 CST 2019.</small>
  137. </p>
  138. </footer>
  139. </div>
  140. <script src="../.js/jquery.min.js" type="text/javascript"></script>
  141. <script src="../.js/d3.min.js" type="text/javascript"></script>
  142. <script src="../.js/nv.d3.min.js" type="text/javascript"></script>
  143. <script type="text/javascript">
  144. $(document).ready(function() {
  145. nv.addGraph(function() {
  146. var chart = nv.models.multiBarChart();
  147. chart.tooltips(false)
  148. .showControls(false)
  149. .showLegend(false)
  150. .reduceXTicks(false)
  151. .staggerLabels(true)
  152. .yAxis.tickFormat(d3.format('d'));
  153. d3.select('#classCoverageDistribution svg')
  154. .datum(getCoverageDistributionData([0,0,0,0,0,0,0,1,0,0,0,1], "Class Coverage"))
  155. .transition().duration(500).call(chart);
  156. nv.utils.windowResize(chart.update);
  157. return chart;
  158. });
  159. nv.addGraph(function() {
  160. var chart = nv.models.multiBarChart();
  161. chart.tooltips(false)
  162. .showControls(false)
  163. .showLegend(false)
  164. .reduceXTicks(false)
  165. .staggerLabels(true)
  166. .yAxis.tickFormat(d3.format('d'));
  167. d3.select('#methodCoverageDistribution svg')
  168. .datum(getCoverageDistributionData([1,0,0,0,0,0,0,0,0,0,0,3], "Method Coverage"))
  169. .transition().duration(500).call(chart);
  170. nv.utils.windowResize(chart.update);
  171. return chart;
  172. });
  173. function getCoverageDistributionData(data, label) {
  174. var labels = [
  175. '0%',
  176. '0-10%',
  177. '10-20%',
  178. '20-30%',
  179. '30-40%',
  180. '40-50%',
  181. '50-60%',
  182. '60-70%',
  183. '70-80%',
  184. '80-90%',
  185. '90-100%',
  186. '100%'
  187. ];
  188. var values = [];
  189. $.each(labels, function(key) {
  190. values.push({x: labels[key], y: data[key]});
  191. });
  192. return [
  193. {
  194. key: label,
  195. values: values,
  196. color: "#4572A7"
  197. }
  198. ];
  199. }
  200. nv.addGraph(function() {
  201. var chart = nv.models.scatterChart()
  202. .showDistX(true)
  203. .showDistY(true)
  204. .showLegend(false)
  205. .forceX([0, 100]);
  206. chart.tooltipContent(function(graph) {
  207. return '<p>' + graph.point.class + '</p>';
  208. });
  209. chart.xAxis.axisLabel('Code Coverage (in percent)');
  210. chart.yAxis.axisLabel('Cyclomatic Complexity');
  211. d3.select('#classComplexity svg')
  212. .datum(getComplexityData([[66.66666666666666,2,"<a href=\"Commands\/RedisSubscribe.php.html#8\">App\\Console\\Commands\\RedisSubscribe<\/a>"],[100,2,"<a href=\"Kernel.php.html#8\">App\\Console\\Kernel<\/a>"]], 'Class Complexity'))
  213. .transition()
  214. .duration(500)
  215. .call(chart);
  216. nv.utils.windowResize(chart.update);
  217. return chart;
  218. });
  219. nv.addGraph(function() {
  220. var chart = nv.models.scatterChart()
  221. .showDistX(true)
  222. .showDistY(true)
  223. .showLegend(false)
  224. .forceX([0, 100]);
  225. chart.tooltipContent(function(graph) {
  226. return '<p>' + graph.point.class + '</p>';
  227. });
  228. chart.xAxis.axisLabel('Code Coverage (in percent)');
  229. chart.yAxis.axisLabel('Method Complexity');
  230. d3.select('#methodComplexity svg')
  231. .datum(getComplexityData([[100,1,"<a href=\"Commands\/RedisSubscribe.php.html#29\">App\\Console\\Commands\\RedisSubscribe::__construct<\/a>"],[0,1,"<a href=\"Commands\/RedisSubscribe.php.html#39\">App\\Console\\Commands\\RedisSubscribe::handle<\/a>"],[100,1,"<a href=\"Kernel.php.html#25\">App\\Console\\Kernel::schedule<\/a>"],[100,1,"<a href=\"Kernel.php.html#36\">App\\Console\\Kernel::commands<\/a>"]], 'Method Complexity'))
  232. .transition()
  233. .duration(500)
  234. .call(chart);
  235. nv.utils.windowResize(chart.update);
  236. return chart;
  237. });
  238. function getComplexityData(data, label) {
  239. var values = [];
  240. $.each(data, function(key) {
  241. var value = Math.round(data[key][0]*100) / 100;
  242. values.push({
  243. x: value,
  244. y: data[key][1],
  245. class: data[key][2],
  246. size: 0.05,
  247. shape: 'diamond'
  248. });
  249. });
  250. return [
  251. {
  252. key: label,
  253. values: values,
  254. color: "#4572A7"
  255. }
  256. ];
  257. }
  258. });
  259. </script>
  260. </body>
  261. </html>