dashboard.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Dashboard for /win/work/Project/ecom/core/models</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="../css/bootstrap.min.css" rel="stylesheet">
  8. <link href="../css/nv.d3.min.css" rel="stylesheet">
  9. <link href="../css/style.css" rel="stylesheet">
  10. <!--[if lt IE 9]>
  11. <script src="../js/html5shiv.min.js"></script>
  12. <script src="../js/respond.min.js"></script>
  13. <![endif]-->
  14. </head>
  15. <body>
  16. <header>
  17. <div class="container">
  18. <div class="row">
  19. <div class="col-md-12">
  20. <ol class="breadcrumb">
  21. <li><a href="../index.html">/win/work/Project/ecom/core</a></li>
  22. <li><a href="index.html">models</a></li>
  23. <li class="active">(Dashboard)</li>
  24. </ol>
  25. </div>
  26. </div>
  27. </div>
  28. </header>
  29. <div class="container">
  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="Meta.php.html#5">Meta</a></td><td class="text-right">35%</td></tr>
  62. <tr><td><a href="Config.php.html#5">Config</a></td><td class="text-right">42%</td></tr>
  63. <tr><td><a href="ModelBase.php.html#5">ModelBase</a></td><td class="text-right">63%</td></tr>
  64. <tr><td><a href="Module.php.html#5">Module</a></td><td class="text-right">75%</td></tr>
  65. <tr><td><a href="ModuleHook.php.html#5">ModuleHook</a></td><td class="text-right">77%</td></tr>
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. <div class="col-md-6">
  71. <h3>Project Risks</h3>
  72. <div class="scrollbox">
  73. <table class="table">
  74. <thead>
  75. <tr>
  76. <th>Class</th>
  77. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <tr><td><a href="ModelBase.php.html#5">ModelBase</a></td><td class="text-right">181</td></tr>
  82. <tr><td><a href="Meta.php.html#5">Meta</a></td><td class="text-right">25</td></tr>
  83. <tr><td><a href="Config.php.html#5">Config</a></td><td class="text-right">16</td></tr>
  84. <tr><td><a href="Module.php.html#5">Module</a></td><td class="text-right">3</td></tr>
  85. <tr><td><a href="ModuleHook.php.html#5">ModuleHook</a></td><td class="text-right">3</td></tr>
  86. </tbody>
  87. </table>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="row">
  92. <div class="col-md-12">
  93. <h2>Methods</h2>
  94. </div>
  95. </div>
  96. <div class="row">
  97. <div class="col-md-6">
  98. <h3>Coverage Distribution</h3>
  99. <div id="methodCoverageDistribution" style="height: 300px;">
  100. <svg></svg>
  101. </div>
  102. </div>
  103. <div class="col-md-6">
  104. <h3>Complexity</h3>
  105. <div id="methodComplexity" style="height: 300px;">
  106. <svg></svg>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="row">
  111. <div class="col-md-6">
  112. <h3>Insufficient Coverage</h3>
  113. <div class="scrollbox">
  114. <table class="table">
  115. <thead>
  116. <tr>
  117. <th>Method</th>
  118. <th class="text-right">Coverage</th>
  119. </tr>
  120. </thead>
  121. <tbody>
  122. <tr><td><a href="Module.php.html#22"><abbr title="Module::getActivated">getActivated</a></a></td><td class="text-right">0%</td></tr>
  123. <tr><td><a href="ModuleHook.php.html#23"><abbr title="ModuleHook::getModules">getModules</a></a></td><td class="text-right">0%</td></tr>
  124. <tr><td><a href="ModelBase.php.html#152"><abbr title="ModelBase::selects">selects</a></a></td><td class="text-right">0%</td></tr>
  125. <tr><td><a href="ModelBase.php.html#79"><abbr title="ModelBase::getMeta">getMeta</a></a></td><td class="text-right">0%</td></tr>
  126. <tr><td><a href="Meta.php.html#25"><abbr title="Meta::__get">__get</a></a></td><td class="text-right">0%</td></tr>
  127. <tr><td><a href="Meta.php.html#32"><abbr title="Meta::__set">__set</a></a></td><td class="text-right">0%</td></tr>
  128. <tr><td><a href="Config.php.html#23"><abbr title="Config::getConfig">getConfig</a></a></td><td class="text-right">0%</td></tr>
  129. <tr><td><a href="ModelBase.php.html#108"><abbr title="ModelBase::save">save</a></a></td><td class="text-right">85%</td></tr>
  130. </tbody>
  131. </table>
  132. </div>
  133. </div>
  134. <div class="col-md-6">
  135. <h3>Project Risks</h3>
  136. <div class="scrollbox">
  137. <table class="table">
  138. <thead>
  139. <tr>
  140. <th>Method</th>
  141. <th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. <tr><td><a href="ModelBase.php.html#152"><abbr title="ModelBase::selects">selects</abbr></a></td><td class="text-right">156</td></tr>
  146. <tr><td><a href="Config.php.html#23"><abbr title="Config::getConfig">getConfig</abbr></a></td><td class="text-right">30</td></tr>
  147. <tr><td><a href="Meta.php.html#32"><abbr title="Meta::__set">__set</abbr></a></td><td class="text-right">20</td></tr>
  148. <tr><td><a href="ModelBase.php.html#108"><abbr title="ModelBase::save">save</abbr></a></td><td class="text-right">9</td></tr>
  149. <tr><td><a href="Meta.php.html#25"><abbr title="Meta::__get">__get</abbr></a></td><td class="text-right">6</td></tr>
  150. </tbody>
  151. </table>
  152. </div>
  153. </div>
  154. </div>
  155. <footer>
  156. <hr/>
  157. <p>
  158. <small>Generated by <a href="http://github.com/sebastianbergmann/php-code-coverage" target="_top">PHP_CodeCoverage 2.1.8</a> using <a href="http://php.net/" target="_top">PHP 5.6.1</a> and <a href="http://phpunit.de/">PHPUnit 4.7.7</a> at Tue Aug 4 22:53:33 UTC 2015.</small>
  159. </p>
  160. </footer>
  161. </div>
  162. <script src="../js/jquery.min.js" type="text/javascript"></script>
  163. <script src="../js/bootstrap.min.js" type="text/javascript"></script>
  164. <script src="../js/holder.min.js" type="text/javascript"></script>
  165. <script src="../js/d3.min.js" type="text/javascript"></script>
  166. <script src="../js/nv.d3.min.js" type="text/javascript"></script>
  167. <script type="text/javascript">
  168. $(document).ready(function() {
  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('#classCoverageDistribution svg')
  178. .datum(getCoverageDistributionData([0,0,0,0,1,1,0,1,2,0,0,8], "Class Coverage"))
  179. .transition().duration(500).call(chart);
  180. nv.utils.windowResize(chart.update);
  181. return chart;
  182. });
  183. nv.addGraph(function() {
  184. var chart = nv.models.multiBarChart();
  185. chart.tooltips(false)
  186. .showControls(false)
  187. .showLegend(false)
  188. .reduceXTicks(false)
  189. .staggerLabels(true)
  190. .yAxis.tickFormat(d3.format('d'));
  191. d3.select('#methodCoverageDistribution svg')
  192. .datum(getCoverageDistributionData([7,0,0,0,0,0,0,0,0,1,0,30], "Method Coverage"))
  193. .transition().duration(500).call(chart);
  194. nv.utils.windowResize(chart.update);
  195. return chart;
  196. });
  197. function getCoverageDistributionData(data, label) {
  198. var labels = [
  199. '0%',
  200. '0-10%',
  201. '10-20%',
  202. '20-30%',
  203. '30-40%',
  204. '40-50%',
  205. '50-60%',
  206. '60-70%',
  207. '70-80%',
  208. '80-90%',
  209. '90-100%',
  210. '100%'
  211. ];
  212. var values = [];
  213. $.each(labels, function(key) {
  214. values.push({x: labels[key], y: data[key]});
  215. });
  216. return [
  217. {
  218. key: label,
  219. values: values,
  220. color: "#4572A7"
  221. }
  222. ];
  223. }
  224. nv.addGraph(function() {
  225. var chart = nv.models.scatterChart()
  226. .showDistX(true)
  227. .showDistY(true)
  228. .showLegend(false)
  229. .forceX([0, 100]);
  230. chart.tooltipContent(function(key, y, e, graph) {
  231. return '<p>' + graph.point.class + '</p>';
  232. });
  233. chart.xAxis.axisLabel('Code Coverage (in percent)');
  234. chart.yAxis.axisLabel('Cyclomatic Complexity');
  235. d3.select('#classComplexity svg')
  236. .datum(getComplexityData([[100,2,"<a href=\"Address.php.html#5\">Address<\/a>"],[100,7,"<a href=\"Admin.php.html#5\">Admin<\/a>"],[100,2,"<a href=\"Cart.php.html#5\">Cart<\/a>"],[100,2,"<a href=\"CartProduct.php.html#5\">CartProduct<\/a>"],[100,2,"<a href=\"Category.php.html#5\">Category<\/a>"],[100,2,"<a href=\"Cms.php.html#5\">Cms<\/a>"],[42.857142857143,7,"<a href=\"Config.php.html#5\">Config<\/a>"],[35.294117647059,8,"<a href=\"Meta.php.html#5\">Meta<\/a>"],[63.703703703704,52,"<a href=\"ModelBase.php.html#5\">ModelBase<\/a>"],[75,3,"<a href=\"Module.php.html#5\">Module<\/a>"],[77.777777777778,3,"<a href=\"ModuleHook.php.html#5\">ModuleHook<\/a>"],[100,2,"<a href=\"Product.php.html#5\">Product<\/a>"],[100,7,"<a href=\"User.php.html#5\">User<\/a>"]], 'Class Complexity'))
  237. .transition()
  238. .duration(500)
  239. .call(chart);
  240. nv.utils.windowResize(chart.update);
  241. return chart;
  242. });
  243. nv.addGraph(function() {
  244. var chart = nv.models.scatterChart()
  245. .showDistX(true)
  246. .showDistY(true)
  247. .showLegend(false)
  248. .forceX([0, 100]);
  249. chart.tooltipContent(function(key, y, e, graph) {
  250. return '<p>' + graph.point.class + '</p>';
  251. });
  252. chart.xAxis.axisLabel('Code Coverage (in percent)');
  253. chart.yAxis.axisLabel('Method Complexity');
  254. d3.select('#methodComplexity svg')
  255. .datum(getComplexityData([[100,2,"<a href=\"Address.php.html#7\">Address::install<\/a>"],[100,2,"<a href=\"Admin.php.html#21\">Admin::install<\/a>"],[100,1,"<a href=\"Admin.php.html#37\">Admin::__construct<\/a>"],[100,1,"<a href=\"Admin.php.html#44\">Admin::checkPassword<\/a>"],[100,1,"<a href=\"Admin.php.html#49\">Admin::setPassword<\/a>"],[100,2,"<a href=\"Admin.php.html#54\">Admin::__set<\/a>"],[100,2,"<a href=\"Cart.php.html#7\">Cart::install<\/a>"],[100,2,"<a href=\"CartProduct.php.html#7\">CartProduct::install<\/a>"],[100,2,"<a href=\"Category.php.html#7\">Category::install<\/a>"],[100,2,"<a href=\"Cms.php.html#7\">Cms::install<\/a>"],[100,2,"<a href=\"Config.php.html#9\">Config::install<\/a>"],[0,5,"<a href=\"Config.php.html#23\">Config::getConfig<\/a>"],[100,2,"<a href=\"Meta.php.html#9\">Meta::install<\/a>"],[0,2,"<a href=\"Meta.php.html#25\">Meta::__get<\/a>"],[0,4,"<a href=\"Meta.php.html#32\">Meta::__set<\/a>"],[100,1,"<a href=\"ModelBase.php.html#13\">ModelBase::install<\/a>"],[100,3,"<a href=\"ModelBase.php.html#15\">ModelBase::__construct<\/a>"],[100,5,"<a href=\"ModelBase.php.html#23\">ModelBase::init<\/a>"],[100,1,"<a href=\"ModelBase.php.html#42\">ModelBase::getDbPrefix<\/a>"],[100,1,"<a href=\"ModelBase.php.html#47\">ModelBase::getTableName<\/a>"],[100,4,"<a href=\"ModelBase.php.html#53\">ModelBase::setup<\/a>"],[0,1,"<a href=\"ModelBase.php.html#79\">ModelBase::getMeta<\/a>"],[100,5,"<a href=\"ModelBase.php.html#85\">ModelBase::__get<\/a>"],[100,4,"<a href=\"ModelBase.php.html#96\">ModelBase::__set<\/a>"],[85.714285714286,9,"<a href=\"ModelBase.php.html#108\">ModelBase::save<\/a>"],[0,12,"<a href=\"ModelBase.php.html#152\">ModelBase::selects<\/a>"],[100,3,"<a href=\"ModelBase.php.html#206\">ModelBase::selectById<\/a>"],[100,3,"<a href=\"ModelBase.php.html#215\">ModelBase::populate<\/a>"],[100,2,"<a href=\"Module.php.html#7\">Module::install<\/a>"],[0,1,"<a href=\"Module.php.html#22\">Module::getActivated<\/a>"],[100,2,"<a href=\"ModuleHook.php.html#7\">ModuleHook::install<\/a>"],[0,1,"<a href=\"ModuleHook.php.html#23\">ModuleHook::getModules<\/a>"],[100,2,"<a href=\"Product.php.html#7\">Product::install<\/a>"],[100,2,"<a href=\"User.php.html#7\">User::install<\/a>"],[100,1,"<a href=\"User.php.html#28\">User::__construct<\/a>"],[100,1,"<a href=\"User.php.html#35\">User::checkPassword<\/a>"],[100,1,"<a href=\"User.php.html#40\">User::setPassword<\/a>"],[100,2,"<a href=\"User.php.html#45\">User::__set<\/a>"]], 'Method Complexity'))
  256. .transition()
  257. .duration(500)
  258. .call(chart);
  259. nv.utils.windowResize(chart.update);
  260. return chart;
  261. });
  262. function getComplexityData(data, label) {
  263. var values = [];
  264. $.each(data, function(key) {
  265. var value = Math.round(data[key][0]*100) / 100;
  266. values.push({
  267. x: value,
  268. y: data[key][1],
  269. class: data[key][2],
  270. size: 0.05,
  271. shape: 'diamond'
  272. });
  273. });
  274. return [
  275. {
  276. key: label,
  277. values: values,
  278. color: "#4572A7"
  279. }
  280. ];
  281. }
  282. });
  283. </script>
  284. </body>
  285. </html>