dashboard.html 9.1 KB

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