Lint Rules
Static analysis rules that detect carbon-inefficient patterns in source code. Run with carbonah lint.
Detects assets served without compression (gzip/brotli). Uncompressed transfers waste bandwidth and increase energy consumption.
Impact: 2-5x more bytes transferred per request
Database query inside a loop. Each iteration hits the database separately instead of batching. Use JOINs, eager loading, or batch queries.
Impact: 3.7-7.2x more energy per request at scale
Query without LIMIT or pagination. As data grows, unbounded queries fetch increasingly large result sets, consuming memory and CPU.
Impact: Linear growth in energy with data size
Repeated polling via setInterval/setTimeout or sleep loops. Consider WebSockets, Server-Sent Events, or push notifications instead.
Impact: Continuous CPU/network usage even when idle
Expensive computation repeated in a loop without caching. Memoize or hoist invariant calculations outside the loop.
Impact: Proportional to loop iterations and computation cost
Heavy module loaded eagerly at startup when it may not be needed. Consider lazy/deferred loading to reduce cold start energy.
Impact: Slower cold starts, wasted memory
Potential memory leak from unclosed resources, accumulating event listeners, or growing data structures without bounds.
Impact: Growing memory pressure, GC overhead, eventual OOM
Object allocation inside a hot loop. Creates GC pressure. Pre-allocate or reuse objects where possible.
Impact: Increased GC pauses and memory churn
Synchronous I/O or heavy computation on the main/UI thread. Move to a worker, async call, or background thread.
Impact: Poor UX forces retries, wasting energy
Development-only code or dependencies detected in production context. Debug logging, dev servers, and test fixtures waste resources in production.
Impact: Unnecessary CPU/memory/disk in production
Docker image uses a large base image (e.g. ubuntu, node) when a slim or alpine alternative exists. Smaller images transfer and start faster.
Impact: 100-500MB+ wasted per deployment
Dockerfile without multi-stage build. Build tools and intermediate artifacts end up in the final image, increasing size and attack surface.
Impact: Larger images, slower deployments
Cloud region hardcoded in source. This prevents carbon-aware scheduling that routes workloads to regions with cleaner grids.
Impact: Missed opportunity for carbon-aware deployment
Analyse Rules
Dependency analysis rules that detect wasteful packages. Run with carbonah analyse.
Dependency significantly larger than lighter alternatives that provide the same functionality. Suggests replacements with size savings.
Impact: 5-50MB+ per unnecessary dependency
Multiple packages providing overlapping functionality. Consolidate to a single package to reduce install size and maintenance burden.
Impact: Redundant disk and download overhead
Development-only dependencies listed in production dependencies. Move to devDependencies / dev group to exclude from production installs.
Impact: Bloated production installs
Frontend bundle includes large packages that could be tree-shaken, code-split, or replaced with smaller alternatives.
Impact: Slower page loads, more network energy
Dependency is deprecated or unmaintained. May have unpatched vulnerabilities and often has better-maintained alternatives.
Impact: Security risk, technical debt accumulation
A direct dependency pulls in a deep chain of transitive dependencies, dramatically increasing total install size.
Impact: Install size multiplied by dependency depth