dashboard.html 8.9 KB

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