Lint Rules

Static analysis rules that detect carbon-inefficient patterns in source code. Run with carbonah lint.

E001 Uncompressed Assets Warning
Detects assets served without compression (gzip/brotli). Uncompressed transfers waste bandwidth and increase energy consumption.
Impact: 2-5x more bytes transferred per request
E002 N+1 Query Warning
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
E003 Unbounded Query Warning
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
E004 Polling Loop Info
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
E005 Redundant Computation Info
Expensive computation repeated in a loop without caching. Memoize or hoist invariant calculations outside the loop.
Impact: Proportional to loop iterations and computation cost
E007 Eager Loading Info
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
E008 Memory Leak Warning
Potential memory leak from unclosed resources, accumulating event listeners, or growing data structures without bounds.
Impact: Growing memory pressure, GC overhead, eventual OOM
E009 Loop Allocation Info
Object allocation inside a hot loop. Creates GC pressure. Pre-allocate or reuse objects where possible.
Impact: Increased GC pauses and memory churn
E010 UI Thread Blocking Warning
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
D003 Dev-in-Prod Warning
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
H001 Docker Bloat Warning
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
H002 No Multi-Stage Build Info
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
C001 Hardcoded Region Info
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.

D001 Oversized Package Warning
Dependency significantly larger than lighter alternatives that provide the same functionality. Suggests replacements with size savings.
Impact: 5-50MB+ per unnecessary dependency
D002 Duplicate Package Info
Multiple packages providing overlapping functionality. Consolidate to a single package to reduce install size and maintenance burden.
Impact: Redundant disk and download overhead
D003 Dev-in-Prod (Deps) Warning
Development-only dependencies listed in production dependencies. Move to devDependencies / dev group to exclude from production installs.
Impact: Bloated production installs
D004 Bundle Bloat Warning
Frontend bundle includes large packages that could be tree-shaken, code-split, or replaced with smaller alternatives.
Impact: Slower page loads, more network energy
D005 Deprecated Package Info
Dependency is deprecated or unmaintained. May have unpatched vulnerabilities and often has better-maintained alternatives.
Impact: Security risk, technical debt accumulation
D006 Transitive Bloat Info
A direct dependency pulls in a deep chain of transitive dependencies, dramatically increasing total install size.
Impact: Install size multiplied by dependency depth

SCI Grades

Carbonah assigns a letter grade based on the Software Carbon Intensity score (gCO2eq per functional unit).

GradeSCI RangeMeaning
A+< 0.1 gCO2eqExceptional — negligible carbon footprint
A0.1 – 1Excellent — well optimised
B1 – 10Good — minor improvements possible
C10 – 100Average — room for optimisation
D100 – 1,000Poor — significant carbon waste
E1,000 – 10,000Very poor — urgent attention needed
F> 10,000Critical — major carbon hotspot