dashboard.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dashboard for D:\Demo\bswas\app\Console\Commands</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"><a href="index.html">Commands</a></li>
  22. <li class="breadcrumb-item active">(Dashboard)</li>
  23. </ol>
  24. </nav>
  25. </div>
  26. </div>
  27. </div>
  28. </header>
  29. <div class="container-fluid">
  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="RedisSubscribe.php.html#8">App\Console\Commands\RedisSubscribe</a></td><td class="text-right">66%</td></tr>
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. <div class="col-md-6">
  67. <h3>Project Risks</h3>
  68. <div class="scrollbox">
  69. <table class="table">
  70. <thead>
  71. <tr>
  72. <th>Class</th>
  73. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. </tbody>
  78. </table>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="row">
  83. <div class="col-md-12">
  84. <h2>Methods</h2>
  85. </div>
  86. </div>
  87. <div class="row">
  88. <div class="col-md-6">
  89. <h3>Coverage Distribution</h3>
  90. <div id="methodCoverageDistribution" style="height: 300px;">
  91. <svg></svg>
  92. </div>
  93. </div>
  94. <div class="col-md-6">
  95. <h3>Complexity</h3>
  96. <div id="methodComplexity" style="height: 300px;">
  97. <svg></svg>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="row">
  102. <div class="col-md-6">
  103. <h3>Insufficient Coverage</h3>
  104. <div class="scrollbox">
  105. <table class="table">
  106. <thead>
  107. <tr>
  108. <th>Method</th>
  109. <th class="text-right">Coverage</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr><td><a href="RedisSubscribe.php.html#39"><abbr title="App\Console\Commands\RedisSubscribe::handle">handle</abbr></a></td><td class="text-right">0%</td></tr>
  114. </tbody>
  115. </table>
  116. </div>
  117. </div>
  118. <div class="col-md-6">
  119. <h3>Project Risks</h3>
  120. <div class="scrollbox">
  121. <table class="table">
  122. <thead>
  123. <tr>
  124. <th>Method</th>
  125. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  126. </tr>
  127. </thead>
  128. <tbody>
  129. </tbody>
  130. </table>
  131. </div>
  132. </div>
  133. </div>
  134. <footer>
  135. <hr/>
  136. <p>
  137. <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>
  138. </p>
  139. </footer>
  140. </div>
  141. <script src="../../.js/jquery.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,1,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([1,0,0,0,0,0,0,0,0,0,0,1], "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(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([[66.66666666666666,2,"<a href=\"RedisSubscribe.php.html#8\">App\\Console\\Commands\\RedisSubscribe<\/a>"]], '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(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([[100,1,"<a href=\"RedisSubscribe.php.html#29\">App\\Console\\Commands\\RedisSubscribe::__construct<\/a>"],[0,1,"<a href=\"RedisSubscribe.php.html#39\">App\\Console\\Commands\\RedisSubscribe::handle<\/a>"]], '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>