dashboard.html 9.3 KB

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