Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngzhian/accgtimnotyz
6 things you didn't know about your variables
https://github.com/ngzhian/accgtimnotyz
Last synced: about 1 month ago
JSON representation
6 things you didn't know about your variables
- Host: GitHub
- URL: https://github.com/ngzhian/accgtimnotyz
- Owner: ngzhian
- Created: 2015-05-03T08:58:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-03T14:08:32.000Z (over 9 years ago)
- Last Synced: 2024-10-13T06:50:58.840Z (3 months ago)
- Language: Python
- Homepage:
- Size: 5.57 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
CodeStats (aka accgtimnotyz)
============================6 things you didn't know about your javascript variables!
This was built as part of TechCrunch Discrupt Hackathon (NY) 2015.
What?
-----Looks at variable names and spits out some interesting statistics about them!
For example:
- are you a concise or verbose programmer (based on length of your variable names)
- camel case or underscore?How?
----Parsing is handled by the [Closure Compiler](https://github.com/google/closure-compiler/).
This is a custom (slightly modified) build that adds a compiler pass that emits
output that I am interested in.I use python to call the compiler as a subprocess and capture the stdout.
It then massages the compiler output to get a list of all variable names.Use [pandas](http://pandas.pydata.org/) to calculate statistics like mean median etc.
Spit it out onto the template and display it!
Source structure
----------------```
|-- static # static assests used for the web app
|-- templates # templates for the web app
|-- analyse.py # analysis of variable
|-- codestats.py # flask web app, takes in js snippet or url to js file
|-- compiler.jar # custom build of closure compiler
|-- parser.py # calls closure compiler as a subprocess and parses its output
|-- test_analyse.py # tests for analyse
|-- test_codestats.py # tests for codestats
|-- test_parser.py # tests for parser
|-- test_snippet.js # javascript file used for tests
```License
-------MIT