← All Tools
Code Heatmap Formatter🔒 100% local
Visualize code execution frequency. Privacy-first, no server uploads, no tracking.
Scores pasted code line by line: each branch keyword adds 2, indentation depth and bracket count add 1 each, every 40 characters adds 1, and a recognised function signature subtracts 1. The scores are scaled against the worst line and drawn as a three-character block ramp next to the line number, with branchy and long lines flagged on the right. Under the map it reports code/comment/blank counts, an estimated cyclomatic complexity, the deepest indent, a maintainability score out of 100 and the five lines to look at first.
How to use it
- Paste the function or file into the box.
- Press Process.
- Work down the hot-spot list at the bottom of the report; it repeats the highest-scoring lines with their numbers.
Worked example
function f(x) {
if (x) return 1;
}becomesHeatmap legend: . : - = + * # % @ (light → heavy)
1 ::: function f(x) {
2 @@@ if (x) return 1;
3 }
Summary:
Lines: 3 (3 code, 0 comment, 0 blank)
Comment ratio: 0%
Cyclomatic (est): 2 (simple)
Max indent depth: 1
Branchy lines: 0
Long lines: 0 (>120 chars)
Maintainability: 96/100
Hot spots (fix these first):
line 2 score 4 if (x) return 1;
line 1 score 1 function f(x) {
How the score is computed: 2 per branch keyword, +1 per indent level, +1 per 40 chars, +1 per bracket, -1 for a function signature.
Rule of thumb: a function above cyclomatic 10 is hard to test; above 20 it is hard to reason about. Extract branches into named helpers.The bar is relative: line 2 is the heaviest line here, so it gets the darkest symbol, and its indent and bracket count give it a score of 4.
When to use it
- Finding the gnarly function in a file before you start a refactor.
- Getting a rough complexity number for a code review comment without installing a linter.
- Checking whether a function you just wrote crept over a comfortable branch count.
What it does not do
- The scoring is regex-based, so it counts words that look like branches; "and" and "or" inside a string or a comment-free prose line can raise a score.
- The cyclomatic figure is a count of decision keywords plus one, not a real control-flow graph, and it will disagree with a compiler-based tool.
- Scores are relative to the heaviest line you pasted, so the same line can change shade between two runs with different inputs.
- Indent depth is computed as two spaces per level, so tab-indented code reads as depth 0.
- One file per paste; there is no repository or multi-file analysis.