GitHub repository link: https://github.com/SiRumCz/REM
by Zhe Chen ([email protected]) and Daniel M. German ([email protected])
The Ripple Effect of Metrics (REM) graph is a dependency graph designed to help developers identify vulnerable dependencies with lower metric-rating transitive dependencies in their dependency chains.
demo: https://turingmachine.org/rem_demo/
Storage | RAM | Language | OS |
---|---|---|---|
2GB | 10GB | Python 3.7.4 | Linux(Ubuntu 18.04)/MacOS(Catalina 10.15.5)/Windows 10 Home |
For this repository, we have provided a compressed database file that we generated on May, 2020 which can be downloaded from https://github.com/SiRumCz/REM-dataset. Download the dataset and store in the data\
folder provided. To uncompress it, go to data\
folder and run command similar to cat dep_network_npm_search.db.tar.gz.a* | tar xzvf -
.
However, if you wish to collect the latest data, run python3 preprocess.py
to generate a database that contains the latest NPM pakcages and scores.
- make sure you have created the database (see Prerequisite).
- Run
pip3 install -r requirements.txt
to install Python libraries. - REM depends on GraphViz. To install it, go to https://graphviz.gitlab.io/download/ and look for right version for your OS.
- Run
mkdir htmls
to create the folder that stores REM graphs. rem_graph_run_all.py
allows user to have all 8 REM graphs for four metrics of health (popularity, quality, maintenance, final) with and without Filtering. To run it, runpython3 rem_graph_run_all.py <github_url> [<out_folder>(htmls/)]
wheregithub_url
is the url to NPM application github repo, and optinalout_folder
which is the output folder to store REM graphs, default ishtmls\
. For example, to generate every REM graph for adobe/brackets, runpython3 rem_graph_run_all.py https://github.com/adobe/brackets
.rem_graph_run_single.py
allows user to generate REM graph on which metric of health and whether to use Filtering. To run it, runpython3 rem_graph_run_single.py <keyword> <github_url> [<out_folder>(htmls/)]
wherekeyword
is one of the metrics of health (popularity, quality, maintenance, final). To toggle the graph filtering, go toconfigs.py
, changeFILTER_ENABLE
to eitherTrue
orFalse
. For example, to generate a filtered REM graph with quality metric for adobe/brackets, runpython3 rem_graph_run_single.py quality https://github.com/adobe/brackets
.- To view the REM graph generated, open it using a web browser (we recommend Chrome).
The Dockerfile includes every environment for REM graph rendering.
- make sure you have created the database (see Prerequisite).
- Docker requirment: >= 10GB memory. Under
Preference -> Resources
of docker desktop, please setMemory
to at least 10 GB. - under repo directory, run
docker build .
to build the image. - once the build is finished, run
docker run -it --name <name> <image id>
to bring the user to the CLI of the running Docker container for REM.name
is the name of the image which user can reuse later by runningdocker start -i <name>
andimage id
is the last unique string generated from step 2. - generate REM graphs:
rem_graph_run_all.py
allows user to have all 8 REM graphs for four metrics of health (popularity, quality, maintenance, final) with and without Filtering. To run it, runpython3 rem_graph_run_all.py <github_url> [<out_folder>(htmls/)]
wheregithub_url
is the url to NPM application github repo, and optinalout_folder
which is the output folder to store REM graphs, default ishtmls\
. For example, to generate every REM graph for adobe/brackets, runpython3 rem_graph_run_all.py https://github.com/adobe/brackets
.rem_graph_run_single.py
allows user to generate REM graph on which metric of health and whether to use Filtering. To run it, runpython3 rem_graph_run_single.py <keyword> <github_url> [<out_folder>(htmls/)]
wherekeyword
is one of the metrics of health (popularity, quality, maintenance, final). To toggle the graph filtering, go toconfigs.py
, changeFILTER_ENABLE
to eitherTrue
orFalse
. For example, to generate a filtered REM graph with quality metric for adobe/brackets, runpython3 rem_graph_run_single.py quality https://github.com/adobe/brackets
.
- REM graphs will be created in
/htmls
folder inside Docker container - to export file from Docker container to local machine, keep the container running and run
docker cp <container id>:/htmls <target_dir>
from host.container id
can be found bydocker ps
.
A complete Docker image is available on Dockerhub: https://hub.docker.com/repository/docker/sirumcz/rem .
- The process of collecting the latest NPM package and score database with
preprocess.py
heaviliy depends on the internet speed, on a University lab environment, it usually takes 1 to 2 days to finish. - Running
rem_graph_run_all.py
that generates a set of 8 REM graphs on a 8-core Intel Core i9 MacBook Pro will take about 2 minutes to finish.