UNPKG

kudo

Version:

check someone's code quality in git repository

517 lines (515 loc) 21.7 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for lib/commit.js</title> <meta charset="utf-8"> <link rel="stylesheet" href="../prettify.css"> <link rel="stylesheet" href="../base.css"> <style type='text/css'> div.coverage-summary .sorter { background-image: url(../sort-arrow-sprite.png); } </style> </head> <body> <div class="header high"> <h1>Code coverage report for <span class="entity">lib/commit.js</span></h1> <h2> Statements: <span class="metric">93.02% <small>(40 / 43)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Branches: <span class="metric">91.67% <small>(11 / 12)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Functions: <span class="metric">75% <small>(9 / 12)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Lines: <span class="metric">93.02% <small>(40 / 43)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp; </h2> <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; commit.js</div> </div> <div class="body"> <pre><table class="coverage"> <tr><td class="line-count">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">19</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">19</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">19</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-yes">6</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">6</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11</span> <span class="cline-any cline-yes">7</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">9</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/** * @file commit 处理 * @author chris&lt;wfsr@foxmail.com&gt; */ &nbsp; 'use strict'; &nbsp; var _createClass = require('babel-runtime/helpers/create-class')['default']; &nbsp; var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default']; &nbsp; var _slicedToArray = require('babel-runtime/helpers/sliced-to-array')['default']; &nbsp; var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; &nbsp; var _Promise = require('babel-runtime/core-js/promise')['default']; &nbsp; var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; &nbsp; Object.defineProperty(exports, '__esModule', { value: true }); &nbsp; var _git = require('./git'); &nbsp; var _file = require('./file'); &nbsp; var _file2 = _interopRequireDefault(_file); &nbsp; /** * 匹配文件路径的正则 * * @const * @type {RegExp} */ var FILE_REG = /^\s*\S+(?=\s*\|)/gm; &nbsp; /** * Commit * * @class * @param {Object} options 配置项 * @param {string} options.id 提交的 id * @param {string} options.date 提交时间 */ &nbsp; var Commit = (function () { function Commit() { var options = arguments.length &lt;= 0 || arguments[0] === undefined ? { id: '', date: new Date() } : arguments[0]; &nbsp; _classCallCheck(this, Commit); &nbsp; _Object$assign(this, options); } &nbsp; /** * 从 git-show 输出中获取提交的文件路径 * * @param {string} output git-show 的输出 * @return {Promise.&lt;File[]&gt;} */ &nbsp; _createClass(Commit, [{ key: 'getFiles', value: function getFiles(output) { // istanbul ignore next &nbsp; var _this = this; &nbsp; var cid = this.id; var date = this.date; var files = (output.match(FILE_REG) || <span class="branch-1 cbranch-no" title="branch not covered" >[])</span>.reduce(function (files, path) { path = path.trim(); if (/.+\.(?:js|css|html)$/.test(path)) { files.push(new _file2['default']({ cid: cid, path: path, date: date })); } &nbsp; return files; }, []); &nbsp; return _Promise.all(files.map(function (file) { return file.read(); })).then(<span class="fstat-no" title="function not covered" >function (files) {</span> <span class="cstat-no" title="statement not covered" > return _this.files = files;</span> }); } &nbsp; /** * 从 git-log 输出中分析生成提交实例 * * @param {string} log git-log 的输出 * @return {?Commit} */ }], [{ key: 'from', value: function from(log) { var _log$replace$split = log.replace(/\s*(\r?\n)+/g, '').split(','); &nbsp; var _log$replace$split2 = _slicedToArray(_log$replace$split, 2); &nbsp; var id = _log$replace$split2[0]; var date = _log$replace$split2[1]; &nbsp; if (id &amp;&amp; date) { return new Commit({ id: id, date: new Date(date) }); } &nbsp; return null; } &nbsp; /** * 从 git-log 获取指定用户在某个时间段内的所有 Commit * * @param {string} name 提交代码的作者名字 * @param {string} since git 格式的时间段表示 * @return {Promise.&lt;Commit[]&gt;} */ }, { key: 'getCommits', value: function getCommits(name, since) { return _git.git.run('log', '--author=' + name, '--since=\'' + since + '\'', '--pretty=format:%h,%ad').then(Commit.parse); } &nbsp; /** * 从 git-show 获取所有 Commit 的相关文件 * * @param {Commit[]} commits Commit 列表 * @return {Promise.&lt;Array.&lt;File[]&gt;&gt;} */ }, { key: 'getFiles', value: <span class="fstat-no" title="function not covered" >function getFiles(commits) {</span> <span class="cstat-no" title="statement not covered" > return _Promise.all(commits.map(<span class="fstat-no" title="function not covered" >function (commit) {</span></span> <span class="cstat-no" title="statement not covered" > return _git.git.run('show', commit.id, '--pretty=format:', '--diff-filter=AM', '--stat=1200', '--stat-graph-width=1').then(commit.getFiles.bind(commit));</span> })); } &nbsp; /** * 解释出 Commit 列表 * * @param {string} logs git-log 的输出 * @return {Commit[]} */ }, { key: 'parse', value: function parse(logs) { return logs.split(/\r?\n/).map(function (log) { return Commit.from(log); }).filter(Boolean); } }]); &nbsp; return Commit; })(); &nbsp; exports['default'] = Commit; module.exports = exports['default']; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9jb21taXQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7bUJBS2tCLE9BQU87O29CQUNSLFFBQVE7Ozs7Ozs7Ozs7QUFRekIsSUFBTSxRQUFRLEdBQUcsb0JBQW9CLENBQUM7Ozs7Ozs7Ozs7O0lBVWpCLE1BQU07QUFFWixhQUZNLE1BQU0sR0FFMkI7WUFBdEMsT0FBTyx5REFBRyxFQUFDLEVBQUUsRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLElBQUksSUFBSSxFQUFFLEVBQUM7OzhCQUYvQixNQUFNOztBQUduQix1QkFBYyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUM7S0FDaEM7Ozs7Ozs7OztpQkFKZ0IsTUFBTTs7ZUFZZixrQkFBQyxNQUFNLEVBQUU7Ozs7O0FBQ2IsZ0JBQUksR0FBRyxHQUFHLElBQUksQ0FBQyxFQUFFLENBQUM7QUFDbEIsZ0JBQUksSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7QUFDckIsZ0JBQUksS0FBSyxHQUFHLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSSxFQUFFLENBQUEsQ0FBRSxNQUFNLENBQUMsVUFBVSxLQUFLLEVBQUUsSUFBSSxFQUFFO0FBQ3JFLG9CQUFJLEdBQUcsSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO0FBQ25CLG9CQUFJLHNCQUFzQixDQUFDLElBQUksQ0FBQyxJQU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BnZXRDb21taXRzKG5hbWUsIHNpbmNlKSB7XG4gICAgICAgIHJldHVybiBnaXQucnVuKCdsb2cnLCAnLS1hdXRob3I9JyArIG5hbWUsICctLXNpbmNlPVxcJycgKyBzaW5jZSArICdcXCcnLCAnLS1wcmV0dHk9Zm9ybWF0OiVoLCVhZCcpXG4gICAgICAgICAgICAudGhlbihDb21taXQucGFyc2UpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIOS7jiBnaXQtc2hvdyDojrflj5bmiYDmnIkgQ29tbWl0IOeahOebuOWFs+aWh+S7tlxuICAgICAqXG4gICAgICogQHBhcmFtIHtDb21taXRbXX0gY29tbWl0cyBDb21taXQg5YiX6KGoXG4gICAgICogQHJldHVybiB7UHJvbWlzZS48QXJyYXkuPEZpbGVbXT4+fVxuICAgICAqL1xuICAgIHN0YXRpYyBnZXRGaWxlcyhjb21taXRzKSB7XG4gICAgICAgIHJldHVybiBQcm9taXNlLmFsbChjb21taXRzLm1hcChmdW5jdGlvbiAoY29tbWl0KSB7XG4gICAgICAgICAgICByZXR1cm4gZ2l0LnJ1bihcbiAgICAgICAgICAgICAgICAnc2hvdycsIGNvbW1pdC5pZCxcbiAgICAgICAgICAgICAgICAnLS1wcmV0dHk9Zm9ybWF0OicsICctLWRpZmYtZmlsdGVyPUFNJyxcbiAgICAgICAgICAgICAgICAnLS1zdGF0PTEyMDAnLCAnLS1zdGF0LWdyYXBoLXdpZHRoPTEnXG4gICAgICAgICAgICApLnRoZW4oY29tbWl0LmdldEZpbGVzLmJpbmQoY29tbWl0KSk7XG4gICAgICAgIH0pKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiDop6Pph4rlh7ogQ29tbWl0IOWIl+ihqFxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGxvZ3MgZ2l0LWxvZyDnmoTovpPlh7pcbiAgICAgKiBAcmV0dXJuIHtDb21taXRbXX1cbiAgICAgKi9cbiAgICBzdGF0aWMgcGFyc2UobG9ncykge1xuICAgICAgICByZXR1cm4gbG9ncy5zcGxpdCgvXFxyP1xcbi8pLm1hcChmdW5jdGlvbiAobG9nKSB7XG4gICAgICAgICAgICByZXR1cm4gQ29tbWl0LmZyb20obG9nKTtcbiAgICAgICAgfSkuZmlsdGVyKEJvb2xlYW4pO1xuICAgIH1cblxufVxuIl19</pre></td></tr> </table></pre> </div> <div class="footer"> <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Sep 17 2015 10:53:44 GMT+0800 (CST)</div> </div> <script src="../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../sorter.js"></script> </body> </html>