dashboard.html 7.2 KB

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