Skip to content

What it is

denoise draws the structure of code you did not write. You give it a pull request, a repository or a file. It gives back one picture per function, so you can see how the function is built before you read a line of it.

Try it on a pull request

Each function becomes a schematic. Statements stack in the order they run. A for or while is a bar. An if and its else sit side by side. A check that leaves at once is a single row, and every return and throw runs out to a rail on the right. Calls to the database and to HTTP are tagged.

Here is one function, checkout(cart), drawn the way the app draws it.

  • Header. The function’s name and parameters, then five chips: cognitive complexity, cyclomatic complexity, nesting depth, exits and lines. Metrics says what each one counts.
  • Guard row. if !cart.items.length → return null is a check that leaves the function. It takes one row.
  • Loop bar. The violet bar is the for loop. What sits to its right runs once per item.
  • Nested guard. The soldOut check is inside the loop, so it is drawn inside the bar, and its exit is a throw.
  • Tag. INSERT orders marks the database write. A write is amber.
  • Exit rail. All three exits (the return null, the throw and the final return) end on the rail.
  • Fill. The fill warms as blocks nest. This function is only two levels deep, so it stays cool.

Reading a schematic goes through every construct.

Reading code you did not write is slow. You want to know first what a function decides, where it can leave, and what it touches. A schematic answers that from the structure. You can then zoom in to the code itself, from the headers of a file down to the source as written.

In a pull request the same idea shows what changed. Each function the change added, removed or edited is drawn as a diff, with its complexity before and after, so you can find the changes worth reading first.

  • A pull request. Paste its URL. You get the modules the change touches, each changed function as a diff, and a Start here list of the changes most worth reading. See Using the app.
  • A repository or folder. You get its modules, then the files in one module, then that file’s functions. You open any function from there.
  • A file. You get the file’s functions, headers first. Click one to open it.

A commit or a comparison works like a pull request. You can also search for a repository by name instead of pasting a URL.

Open the app

It is not an AI reviewer. It does not tell you a change is good or bad, and it does not write comments. The drawing is made from the code’s syntax by a parser, with no model in the loop. The same commit always draws the same picture.

It does not run the code. It shows what is written in the function you are looking at.