A tool to evaluate BitBucket pull requests and report back various metrics about how the pull request impacts a project. Presently, only designed to support JavaScript ES6 projects.
NOTE: This project is not currently published.
$ npm install --save-dev bitbucket-pull-request-metrics
Assuming the module was installed globally:
$ bitbucket-pull-request-metrics \
--username foobar \
--authToken 123abc \
--project DEV \
--repo my-repo \
--pr 123
--username, -u (string, required)
User's BitBucket username.
--authToken, -t (string, required)
User's BitBucket auth token.
--project, -p (string, required)
BitBucket project's key/name.
--repo, -r (string, required)
The BitBucket project's repository which contains the pull request.
--pr (number, required)
The pull request to inspect.
--host (string, optional)
The protocol and hostname of the BitBucket server. Defaults to "https://bitbucket.org".
// Initialize metrics lib
const metrics = require('bitbucket-pull-request-metrics')({
host: 'https://bitbucket.org', // Optional parameter. This is the default.
// The following are all required.
project: 'DEV',
repo: 'my-repo',
username: 'foobar',
authToken: '123abc'
});
// Fetch details about PR 123
metrics(123, (err, prMetrics) => {
console.log(prMetrics);
});
- Design to review one PR versus a list of PRs, maybe all currently open, and all for a project? Pagination?
- Design hooks for static code analysis. Unit test coverage hook,
- Number of images (screenshots?)
- Number of commits
- Number of subsequent additional commits
- Number of original author comments
- Number of follow up comments (non-author, or replies)
- Min/max/median comment thread length
- Number of days in development
- Number of days PR stayed open
- Number of approvals
- Number of "Needs Work" reviews
- Number of contributing reviewers (submitted some sort of PR review activity)
- Number of contributing reviewers who did not approve PR
- User IDs of contributing reviewers
- Author user ID
- PR number, link
- PR approval status (open/merged/declined)
- Number of open, completed tasks
- Min/max/median per-file LOC changes
- Number of files changed, added, deleted, moved
- Plato LOC, complexity, bug estimate, maintainability, deltas per-file
- Instanbul code coverage delta
- Esprima comment density delta
- Suggested PR quality score