\n'
statistics += ' Statistics
\n'
statistics += ` In the month of ${months[wantedMonth]} `
statistics += `${commits.length} commits were made to the Tildes code, `
statistics += `${opened.length} issues were opened and `
statistics += `${closed.length} issues were closed.
\n`
statistics += ` An average of ${(opened.length / 30).toFixed(2)} issues were opened `
statistics += `and ${(closed.length / 30).toFixed(2)} issues were closed each day.
\n`
statistics += ` The average time to close issues was ${avgTime(closed, 'days')} days `
statistics += `or ${avgTime(closed, 'hours')} hours.
\n`
const topUsers = freqUsers(opened, 3)
statistics += ' Top 3 issue creators:
\n'
statistics += ' \n'
for (const user in topUsers) {
statistics += ' - \n'
statistics += ` ${user}`
statistics += ' with '
statistics += `${topUsers[user]} issues created.\n`
statistics += '
\n'
}
statistics += '
\n'
let labels = labelsAlphabet(opened, true)
statistics += ' Amount of labels assigned to currently open issues:
\n'
statistics += ' \n'
for (const label in labels) {
statistics += ' - \n'
statistics += ` ${label}:`
statistics += `${labels[label]} `
if (labels[label] === 1) statistics += 'time.\n'
else statistics += 'times.\n'
statistics += '
\n'
}
statistics += '
\n'
labels = labelsAlphabet(closed, false)
statistics += ' Amount of labels assigned to closed issues:
\n'
statistics += ' \n'
for (const label in labels) {
statistics += ' - \n'
statistics += ` ${label}:`
statistics += `${labels[label]} `
if (labels[label] === 1) statistics += 'time.\n'
else statistics += 'times.\n'
statistics += '
\n'
}
statistics += '
\n'
statistics += '\n'
fs.writeFileSync(outIssuesPath + '_statistics.html', statistics, { encoding: 'UTF-8' })
resolve()
})
}
exports.build = gulp.series(lintSCSS, gulp.parallel(buildHTML, buildCSS, buildExtra))
exports.download = gulp.series(download, gulp.parallel(createIssueTable, createStatistics))
exports.no_download = gulp.parallel(createIssueTable, createStatistics)
exports.lint = lintSCSS
exports.watch = gulp.series(lintSCSS, gulp.parallel(buildHTML, buildCSS, buildExtra), watch)