Contribution Guide
Relevant source files
The following files were used as context for generating this wiki page:Welcome to the Quant project! We welcome contributions from the cybersecurity community to make this CVSS score calculator even more powerful and user-friendly. This guide provides all the information you need to get started with contributing to Quant, from setting up your development environment to understanding the codebase and submitting your changes.
Whether you are reporting a bug, suggesting an improvement, enhancing the UI, adding a feature, or improving documentation, your help is valued.
Sources: README.md:104-112
Getting Started
Before you can contribute, you need to set up the project locally. The project is built with Astro and requires pnpm for dependency management.
Sources: README.md:79-88
Setup and Installation
The following diagram illustrates the steps to get the local development environment running.
Sources: README.md:82-91
Development Commands
All commands should be run from the root of the project.
| Command | Action |
|---|---|
pnpm install | Install dependencies |
pnpm dev | Start local dev server at localhost:4321 |
pnpm build | Build production site to ./dist/ |
pnpm preview | Preview build locally before deploying |
pnpm lint | Run ESLint and code quality checks |
Sources: README.md:93-102
Project Structure
Understanding the project's structure is key to making effective contributions. The core logic and UI components are located within the src directory.
src/components/: Contains all React components used to build the user interface. The main calculator interface isCVSSGenericCalculator.tsx, which dynamically handles all CVSS versions.src/lib/cvss/: This is the heart of the application, containing the pure TypeScript scoring logic for each CVSS version.v4/,v3/,v2/: Each directory contains ascoring.tsfile that implements the official specification for that CVSS version. This is where you would fix scoring bugs or update formulas.metrics-data.ts: Defines the structure, labels, and descriptions for all metrics across all CVSS versions. This file populates the UI.types.ts: Contains shared TypeScript type definitions for all CVSS versions, ensuring type safety across the application.
src/lib/constants.ts: Holds shared constants used throughout the application, such as UI text, color maps, and default settings.
How to Contribute
We welcome many forms of contribution. The general workflow for code contributions is outlined below.
Contribution Workflow
This diagram shows the standard fork-and-pull-request workflow.
Sources: README.md:114-118
Modifying CVSS Scoring Logic
All scoring calculations are performed client-side using pure TypeScript, with no server-side processing. The logic is self-contained within the src/lib/cvss/ directory.
- CVSS v4.0: Logic is in
src/lib/cvss/v4/scoring.ts. It uses a MacroVector-based lookup and interpolation system. - CVSS v3.0/3.1: Logic is in
src/lib/cvss/v3/scoring.ts. It's a formula-based system. The file handles both v3.0 and v3.1, with differences managed by a version-specific roundup function. - CVSS v2.0: Logic is in
src/lib/cvss/v2/scoring.ts, which implements the original formula-based scoring.
The following diagram shows how a user interaction in the UI triggers a score recalculation.
Modifying UI and Metric Data
- UI Components: To change the layout or behavior of the calculator, you'll need to edit the React components in
src/components/. The primary component isCVSSGenericCalculator.tsx. - Metric Text: To update metric descriptions, labels, or "in other words" text, modify the corresponding entries in
src/lib/cvss/metrics-data.ts. This file acts as a single source of truth for all UI text related to CVSS metrics.
Sources: src/components/CVSSGenericCalculator.tsx, src/lib/cvss/metrics-data.ts
Adding Features to the Roadmap
The project has a public roadmap. If you have ideas for new features or want to contribute to planned ones, please follow these steps:
- Open an issue on GitHub to discuss your ideas.
- Check the contribution guidelines for development setup.
- Join the Discord community to connect with other contributors.
Sources: README.md:67-73
Community
Stay connected with the Cyberpath community through various channels. Your feedback and participation are highly encouraged.
- Website: cyberpath-hq.com
- GitHub: github.com/cyberpath-HQ
- Discord: Join our Discord server
- Twitter: @cyberpath_hq