7

JS/TS Code Stats

 1 year ago
source link: https://stats.subsecond.app/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
JS/TS code stats
Some stuff about your javascript code you probably didn't already know.
Github repo:

Recently viewed repositories

loading

How does this work?

It uses the github API to download all javascript and typescript files in a repository one by one. Then it runs some static analysis code locally across all of that code it downloaded. The results are cached so that much computation only has to happen once. This could be done much more efficiently by cloning a git repo in a container and running static analysis off of that code with fs access, but that would require servers and I didn't want to pay for any servers.

Why is it asking me to sign in?

Github only provides 50 requests to unauthenticated users. Once you run out of those you can connect your github account with oauth to get another 5000 requests. This app only ever reads files from your repositories. If you tell it to, the app is able to grab files from private repos on your authenticated account. The stats that are stored are just vague metadata so I can't imagine it being any sort of security risk.

Why only javascript/typescript?

That's what the static analysis library I'm using has support for. I don't have any easy way to query other types of code. Feel free to fork this project and make your own version for ruby or whatever, that would be cool.

Why don't you have [x] statistic?

The ones that I chose are the intersection between easy to compute with static analysis tools and interesting enough to make me say, 'huh, kinda cool'. If you want something else, add a github issue.

Why does this exist?

Mainly, I wanted to practice using Subsecond, a static analysis and codemod library. I think it will also be cool to collect a bunch of stats about different repositories, then eventually do a larger analysis over all repos cached by this project. I'll link that here if I ever end up making that.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK