Skip to content

Instantly share code, notes, and snippets.

@dubbha
dubbha / cloc.md
Last active January 18, 2022 19:27
count lines of code

npx cloc src

$ npx cloc src
npx: installed 1 in 2.296s
    1364 text files.
    1287 unique files.
      91 files ignored.

github.com/AlDanial/cloc v 1.92  T=1.54 s (836.2 files/s, 37198.7 lines/s)
@dubbha
dubbha / istanbul.md
Last active January 22, 2022 17:17 — forked from robertknight/istanbul.md
How Istanbul works

Istanbul Notes

These are some notes I made while reviewing hypothesis/client#156 to understand how Istanbul works

Istanbul instruments code in order to generate code coverage metrics for tests by adding code to record lines, statements etc. that are executed.

It adds a global __coverage__ variable to the generated code which is a map from file path to coverage information. The code for each module is then augmented with: