# Issue closing stats for any repo

DevFeed: [Issue closing stats for any repo](<https://devfeed.tech/articles/issue-closing-stats-for-any-repo-52111.md>)

Original publisher: [Read original article](<https://lea.verou.me/2019/12/issue-closing-stats-for-any-repo/>)

Author: Lea Verou

Published: 2019-12-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [GitHub Issues](<https://devfeed.tech/topics/github-issues.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [articles](<https://devfeed.tech/tags/articles.md>), [blog](<https://devfeed.tech/tags/blog.md>), [css](<https://devfeed.tech/tags/css.md>), [github](<https://devfeed.tech/tags/github.md>), [github-api](<https://devfeed.tech/tags/github-api.md>), [html](<https://devfeed.tech/tags/html.md>), [issue](<https://devfeed.tech/tags/issue.md>), [js](<https://devfeed.tech/tags/js.md>), [mavo](<https://devfeed.tech/tags/mavo.md>), [repo](<https://devfeed.tech/tags/repo.md>), [stats](<https://devfeed.tech/tags/stats.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

The tutorial builds a GitHub issue closing-time stats app in Mavo using HTML and CSS, with no JavaScript. It fetches up to 100 closed issues sorted by update time, shows each issue's elapsed time in readable form, and calculates median, average, fastest, and slowest times from numeric durations. Users can choose a repository, submit changes to avoid reloading on each keystroke, set a repository through a URL parameter, filter by labels, and get autocomplete suggestions from labels found in the returned issues. A CSS graphic summarizes short, long, and intermediate closing times. The excerpt describes a 100-issue result set, so the statistics and label suggestions reflect those returned issues.

## Source excerpt

tl;dr: If you just want to quickly get stats for a repo, you can find the app here. The rest of this post explains how it's built with Mavo HTML, CSS, and 0 lines of JS. Or, if you'd prefer, you can just View Source -- it's all there! The finished app we're going to make, find it at https://projects.verou.me/issue-closing One of the cool things about Mavo is how it enables one to quickly build apps that utilize the Github API. At some point I wanted to compute stats about how quickly (or rather, slowly...) Github issues are closed in the Mavo repo. And what better way to build this than a Mavo app? It was fairly easy to build a prototype for that. Displaying a list of the last 100 closed issues and the time it took to close them To render the last 100 closed issues in the Mavo app, I first looked up the appropriate API call in Github's API documentation, then used it in the mv-source attribute on the Mavo root, i.e. the element with mv-app that encompasses everything in my app: <div mv-app="issueClosing" mv-source="https://api.github.com/repos/mavoweb/mavo/issues?state=closed&sort=updated&per_page=100" mv-mode="read"> <!-- app here --> </div> Then, I displayed a list of these issues with: <div mv-multiple property="issue"> <a class="issue-number" href="https://github.com/mavoweb/mavo/issues/[number]" title="[title]" target="_blank">#[number]</a> took [closed_at - created_at] ms </div> See the Pen Step 1 - Issue Closing App Tutorial by Lea Verou (@leaverou) on CodePen. This would work, but the way it displays results is not very user friendly (e.g. "#542 took 149627000 ms"). We need to display the result in a more readable way. We can use the duration() function to display a readable duration such as "1 day": <div mv-multiple property="issue"> <a class="issue-number" href="https://github.com/mavoweb/mavo/issues/[number]" title="[title]" target="_blank">#[number]</a> took [duration(closed_at - created_at)] </div> See the Pen Step 2 - Issue Closing App Tutorial by Lea Ver