Documentation
Welcome to Code Baseline! This documentation will help you get started with monitoring your codebase health across all your repositories.
New to Code Baseline? Start with the Quickstart guide to set up your first project in under 5 minutes.
Quickstart
Get up and running with Code Baseline in just a few steps:
1. Install the CLI
Install our command-line tool using npm:
npm install -g @codebaseline/cli
2. Authenticate
Log in to your Code Baseline account:
baseline auth login
3. Initialize Your Project
Navigate to your repository and run:
baseline init
This creates a baseline.config.json file with your project settings.
Installation
Code Baseline can be installed via npm, yarn, or as a standalone binary.
npm
npm install -g @codebaseline/cli
yarn
yarn global add @codebaseline/cli
SDK Installation
For programmatic access, install the SDK:
npm install @codebaseline/sdk
Understanding Baselines
A baseline is a snapshot of your codebase health at a specific point in time. Baselines help you:
- Track code quality trends over time
- Set quality gates for pull requests
- Identify regression before they reach production
- Compare metrics across different branches
Metrics
Code Baseline tracks a comprehensive set of code health metrics:
- Complexity Score - Cyclomatic and cognitive complexity
- Duplication - Code duplication percentage
- Test Coverage - Unit and integration test coverage
- Technical Debt - Estimated remediation time
- Security Issues - Vulnerability detection
Alerts & Notifications
Configure alerts to be notified when metrics breach thresholds:
// baseline.config.json
{
"alerts": {
"health_score": { "threshold": 80, "direction": "below" },
"test_coverage": { "threshold": 70, "direction": "below" }
},
"notifications": ["slack", "email"]
}
Note: Slack and Microsoft Teams integrations require additional setup. See the Integrations section for details.
GitHub Integration
Connect your GitHub organization to automatically track all repositories:
- Go to Settings → Integrations in the dashboard
- Click Connect GitHub
- Authorize Code Baseline to access your organization
- Select repositories to monitor