# JavaScript Code Analysis

**URL:** <https://discuss.httparchive.org/t/javascript-code-analysis/1636>\
**Category:** Analysis\
**Created:** [April 25, 2019, 8:44pm UTC](https://discuss.httparchive.org/t/javascript-code-analysis/1636 "2019-04-25T20:44:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdul-manaan](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@abdul-manaan](https://discuss.httparchive.org/u/abdul-manaan)\
**Post date:** [April 25, 2019, 8:44pm UTC](https://discuss.httparchive.org/t/javascript-code-analysis/1636/1 "2019-04-25T20:44:27Z")

</div>

I am currently working on designing an API that can take a javaScript as input and tells what are the specific functions this JS will perform like a javascript that loads images or javaScript that uses a particular CSS-Selector for styling. Moreover, with this, the goal is to guess the impact of this javaScript on a particular device in terms of the memory footprint, CPU usage and on the load time of webpage as well.  
What I have done is this [javaScript](https://github.com/abdul-manaan/JS_Analysis/blob/master/src/parseHar.js). It takes a Har file of a webpage, takes all the scripts from that page, downloads them and try to find the number of times different Identifiers are used. It then generates a CSV file like [file](https://github.com/abdul-manaan/JS_Analysis/blob/master/src/resultsjsFiles.csv) this . I know I am still far from my goal, but all I need is some comments that am I going in the right direction?  
By the way, some of the results I am found are these:

![Screenshot%20from%202019-04-26%2001-43-41](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/httparchive/original/2X/5/5079b0e82c3576989537073e6cc867c6f34e56f2.png)

Any help will be appreciated!
