{"id":51628548,"url":"https://github.com/schnoddelbotz/rcc","last_synced_at":"2026-07-13T04:03:39.310Z","repository":{"id":363342281,"uuid":"1234740554","full_name":"schnoddelbotz/rcc","owner":"schnoddelbotz","description":"Retrospective Code Coverage (rcc) walks a local git repo's history and collects lines of code (LoC) and test coverage statistics data of each commit on its way. Collected data can be plotted as HTML (default) or PNG  and be exported as JSON.","archived":false,"fork":false,"pushed_at":"2026-06-08T12:53:15.000Z","size":470,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T14:25:20.009Z","etag":null,"topics":["code-history","code-quality","code-visualization","coverage","git-history","graph","lines-of-code"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schnoddelbotz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T15:26:26.000Z","updated_at":"2026-06-08T12:53:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/schnoddelbotz/rcc","commit_stats":null,"previous_names":["schnoddelbotz/rcc"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/schnoddelbotz/rcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnoddelbotz%2Frcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnoddelbotz%2Frcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnoddelbotz%2Frcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnoddelbotz%2Frcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schnoddelbotz","download_url":"https://codeload.github.com/schnoddelbotz/rcc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnoddelbotz%2Frcc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35409469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-history","code-quality","code-visualization","coverage","git-history","graph","lines-of-code"],"created_at":"2026-07-13T04:03:38.483Z","updated_at":"2026-07-13T04:03:39.304Z","avatar_url":"https://github.com/schnoddelbotz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rcc (retrospective code coverage + lines of code)\n\nrcc can be used to create a graph/plot of test coverage and LoC data based on\na project's git commit history. Graph data is gathered by walking the\ncommit history, cloning each commit into a temporary directory and running\nLoC and/or unit and/or integration tests on the cloned worktree.\n\nIt supports (and tries to auto-detect) few built-in programming languages\nand their commonly used coverage tools. For other languages or different needs,\nrelevant commands to obtain coverage can be provided by the user. Same applies\nto regex used to extract coverage value from test output - regexes documented\nby [gitlab](https://docs.gitlab.com/ci/testing/code_coverage/coverage_reporting/#coverage-regex-patterns)\nshould generally work.\n\nCurrently [built-in support](languages.go):\n- Go (`go test` for unit tests, `go test -tags=integration` for integration tests)\n- Python (`pytest` / [pytest-cov](https://pypi.org/project/pytest-cov/))\n- Java (Gradle / jacoco)\n\nDependencies for integration tests should possibly be started before running rcc.\nAlternatively, built-in defaults can be overridden by specifying custom commands\nfor test execution.\n\nBy default, five parallel workers will be spawned to run analysis in parallel.\nIn theory, this should work well for unit tests. For integration tests, it's\nmore likely that rcc should be limited to a single worker (see usage below).\n\nrcc supports multiple output formats for gathered data:\n- HTML (embeds a bundled [chartjs](https://www.chartjs.org/), or links to it).\n- PNG requires [gnuplot](http://www.gnuplot.info/) to be installed.\n- JSON (using the chartjs dataset structure); raw data, no plot.\nOutput format is determined by the filename (extension) given for output, which\ndefaults to `rcc-output.html`.\n\n## installation\n\nNo binary release available (yet?). Go required.\n\n```bash\ngo install github.com/schnoddelbotz/rcc@main\n```\n\n## usage\n\nFirst argument to `rcc` is a path to the project (under git version control) to be analyzed.\nWithout that argument, the current working directory will be analyzed.\n\nAssuming a Go project in current working directory, to run LoC and unit test coverage, run\n```bash\nrcc\n```\n\nExample output for the first month of rcc's own repository history (browser screenshot):\n\n![Screenshot of rcc-generated graph in a browser.](resources/_examples/rcc-chartjs.png)\n\nThis will produce the default graph format (`rcc-output.html`).\nShould the project language not be specified and auto-detection fail, `rcc` will only analyse LoC.\n\nOverview of currently supported flags to influence `rcc` behaviour (`rcc --help`):\n\n```\nFlags:\n  -E, --commits-every int              Only look at every Nth commit (default 1)\n  -A, --commits-from time              Look at commits since date (default 0)\n  -Z, --commits-to time                Look at commits until date (default Now)\n  -I, --cover-integration              Run integration tests\n  -X, --cover-integration-cmd string   Command for running integration tests\n  -R, --cover-regex string             Regex for coverage value extraction\n  -C, --cover-unit-cmd string          Command for running unit tests\n  -d, --debug                          Enable debug output\n  -J, --html-no-embed-chartjs          Don't embed ChartJS into generated .html\n  -j, --html-no-embed-json             Don't embed JSON into generated .html\n  -i, --include-languages strings      Explicitly list languages for LoC\n  -l, --language string                Set project language (default autodetect)\n  -D, --no-cover-duration              Don't graph coverage duration\n  -U, --no-cover-unit                  Don't run unit tests\n  -O, --open                           Open --output file upon completion\n  -o, --output string                  Output file (default \"rcc-output.html\")\n  -s, --skip-autodetect                Disable language auto detection\n  -T, --timestamps                     Timestamp console log output\n  -t, --tmp string                     Temporary work directory (default OS tmp)\n  -v, --version                        Print rcc version and exit\n  -w, --workers int                    Number of workers (default 5)\n```\n\nMore usage examples:\n```bash\n# analyse the project at given path, open the graph in PNG format upon completion,\n# also run integration tests and only analyse (and graph) LoC for given languages:\nrcc -OIi Go,JavaScript,HTML -o my.png /path/to/my/project\n\n# analyse one year of commits, only analyse every 100th commit, run no unit tests\nrcc -A 2025-01-01 -Z 2025-12-31 -E 100 -U\n```\n\n## libraries used / dependencies\n\n- [go-git](https://github.com/go-git/go-git) for all git operations\n- [gocloc](https://github.com/hhatto/gocloc) to get LoC data\n- [pflag](https://github.com/spf13/pflag) CLI command line interface\n\n- [Chart.js](https://www.chartjs.org/) embedded, for HTML graphs\n  - [chartjs-adapter-moment](https://github.com/chartjs/chartjs-adapter-moment) embedded, for time scale\n  - [Moment.js](https://momentjs.com/) embedded, for readable dates / time scale\n\n## background \u0026 related tools\n\nrcc was originally born in 2025 as shell script (using gnuplot and gocloc), to monitor development of a single project.\nPrimary goal of the re-implentation in Go was to (have fun and) make it more universally usable and faster.\nBoth were created with the intension to sensitize (co-)devs to maintenance cost vs LoC and importance of test coverage.\n\nThere are obviously many similar tools out there, offering different perspectives; I first heard\nabout scc when reading [55,041,902 Lines of Code](https://planet.kde.org/cornelius-schumacher-2026-05-17-55-041-902-lines-of-code/).\nThe [scc](https://github.com/boyter/scc#background) project has an extensive list of similar projects.\nYou may want to take a look at scc itself for git insight reports, which rcc does not offer in that form.\n\n## status / todo\n\nFun project, WIP. Open tasks:\n\n- [ ] fix: --branch option required; uses hard-coded \"main\" :/\n- [ ] add --list-languages / gocloc + rcc (auto-detect -\u003e test commands)\n- [ ] add option to disable LoC\n- [ ] add cli flag: output png dimensions\n- [ ] add JSON --append mode, to extend an exist json ouput file (/w 1 or more commits, based on range)\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschnoddelbotz%2Frcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschnoddelbotz%2Frcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschnoddelbotz%2Frcc/lists"}