This project implements a scalable and efficient system for evaluating open-source modules based on key metrics such as bus factor, correctness, ramp-up time, maintainer responsiveness, and license compatibility. The goal is to address concerns about open-source risks, including sparse documentation, low correctness standards, and the timely application of critical patches. The system is primarily written in TypeScript, employs the Command design pattern for modularity, and outputs results in NDJSON format for easy integration with the auto-grader.
To get started with this project, follow the steps below to install dependencies, execute the program, and run the test suite.
Before you begin, ensure you have the following installed:
git clone https://github.com/cs-450-project/se-phase1.git
npm install OR ./run install
logs
folder in the root directory..env
file in the root directory:
// Example .env file
GITHUB_TOKEN = '<your GitHub personal access token>'
LOG_LEVEL = 1
LOG_FILE = ./logs/app.log
βββ πse-phase1
βββ πdist
βββ πnode_modules
βββ πlogs
βββ app.log
βββ πsrc
βββ πmodels
βββ πevaluators
βββ createScorecard.ts
βββ evaluateModule.ts
βββ readURLsFromFile.ts
βββ πmetrics
βββ busfactorMetric.ts
βββ correctnessMetric.ts
βββ licenseMetric.ts
βββ maintainersMetric.ts
βββ metric.ts
βββ rampupMetric.ts
βββ πscores
βββ scorecard.ts
βββ index.ts
βββ logger.ts
βββ .env
βββ .gitignore
βββ .npmrc
βββ package-lock.json
βββ package.json
βββ README.md
βββ run
βββ sample-file.txt
βββ tsconfig.json
To evaluate a list of open-source modules:
sample-file.txt
already in the project) containing the URLs of the repositories to be evaluated../run <URL_FILE>
Example:
./run sample-file.txt
This will produce the output with the module scores in NDJSON format.
To ensure everything is functioning correctly, you can run the test suite using npm or the bash file:
npm run test OR ./run test
This output will include a summary of test results, showing the number of tests passed and the code coverage percentage.
The program supports logging, which can be configured through environment variables:
See example .env
file above for possible configuration.