{"id":51148882,"url":"https://github.com/floriankraemer/git-churn-calculator","last_synced_at":"2026-06-26T04:30:47.105Z","repository":{"id":351652920,"uuid":"1211903129","full_name":"floriankraemer/git-churn-calculator","owner":"floriankraemer","description":"A tool that calculates a Churn Risk Score for every file in a git repository by combining change frequency, author spread, and optional test coverage data.","archived":false,"fork":false,"pushed_at":"2026-05-09T21:53:48.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-09T23:26:12.471Z","etag":null,"topics":["churn","churn-analysis","csharp","csharp-app","git"],"latest_commit_sha":null,"homepage":"","language":"C#","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/floriankraemer.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-04-15T21:39:43.000Z","updated_at":"2026-05-09T21:13:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/floriankraemer/git-churn-calculator","commit_stats":null,"previous_names":["floriankraemer/csharp-git-churn-calculator","floriankraemer/git-churn-calculator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/floriankraemer/git-churn-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankraemer%2Fgit-churn-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankraemer%2Fgit-churn-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankraemer%2Fgit-churn-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankraemer%2Fgit-churn-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floriankraemer","download_url":"https://codeload.github.com/floriankraemer/git-churn-calculator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floriankraemer%2Fgit-churn-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34803678,"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-06-26T02:00:06.560Z","response_time":106,"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":["churn","churn-analysis","csharp","csharp-app","git"],"created_at":"2026-06-26T04:30:46.390Z","updated_at":"2026-06-26T04:30:47.095Z","avatar_url":"https://github.com/floriankraemer.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Churn Calculator\n\nIt calculates a **Churn Risk Score** for every file in a git repository by combining change frequency, author spread, and optional test coverage data.\n\n## Documentation\n\n- **[How churn is calculated](docs/churn-calculation.md)** — formulas, git-derived inputs, and Cobertura-to-repo file mapping.\n- **[Build, test, and publish](docs/build.md)** — solution layout, prerequisites, `dotnet` / `make.ps1` workflows, single-file publish, and coverage for this repo.\n\n## Usage\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- \u003crepo-path\u003e [options]\n```\n\n### Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `\u003crepo-path\u003e` | *(required)* | Path to the git repository to analyze |\n| `--format \u003ccsv\\|json\\|html\\|graph\u003e` | `csv` | Output format (`html` = Bootstrap-styled table page, `graph` = D3 time-series chart) |\n| `--coverage \u003cpath\u003e` | *(none)* | Path to a Cobertura XML coverage file |\n| `--output \u003cpath\u003e` | stdout | Write output to a file instead of stdout |\n| `--include \u003cregex\u003e` | *(none)* | Only include repo-relative file paths matching this regular expression |\n| `--exclude \u003cregex\u003e` | *(none)* | Exclude repo-relative file paths matching this regular expression |\n| `--series \u003cweek\\|month\u003e` | *(none)* | Produce a time series by stepping in week or month chunks. Requires `--from`. |\n| `--from \u003cyyyy-MM-dd\u003e` | *(none)* | Start date for time series (inclusive). Required when `--series` is used. |\n| `--to \u003cyyyy-MM-dd\u003e` | today | End date for time series (inclusive). Defaults to today when `--series` is used. |\n\n### Examples\n\nAnalyze a repository and print CSV to stdout:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo\n```\n\nOutput as JSON to a file:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo --format json --output churn.json\n```\n\nInclude Cobertura coverage data:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo --coverage coverage.cobertura.xml\n```\n\nHTML table report (Bootstrap via CDN; open the file in a browser):\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo --format html --output churn.html\n```\n\nLimit analysis to selected paths:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo \\\n  --include \"^(src|tests)/.*\\\\.cs$\" --exclude \"(bin|obj|coverage-report)/\"\n```\n\n### Time series\n\nProduce a weekly time series for a date range and save as JSON:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo \\\n  --series week --from 2024-01-01 --to 2024-03-01 \\\n  --format json --output series.json\n```\n\nMonthly time series as HTML (one collapsible section per month):\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo \\\n  --series month --from 2024-01-01 \\\n  --format html --output series.html\n```\n\nD3 multi-line graph with one line per top-risk file:\n\n```bash\ndotnet run --project GitChurnCalculator.Console -- /path/to/repo \\\n  --series week --from 2024-01-01 \\\n  --format graph --output churn-graph.html\n```\n\nTime series output includes all the same per-file columns as the single-snapshot report, with an additional `AsOf` column (CSV) or `asOf` field (JSON) identifying the bucket end date. Each time point's metrics — including rolling windows like `CommitsLast7Days` — are calculated relative to that point's date, not the current date. The `--format` flag selects the format for both single-snapshot and time series modes.\n\nThe `graph` format draws only the top 50 file series, ranked by each file's highest churn risk score across the selected time range. Hovering a line or file label shows the file path, nearest date, churn risk score, and change frequency.\n\n## Output Fields\n\n| Column | Description |\n|--------|-------------|\n| File | Tracked file path |\n| TotalCommits | Total commits touching this file |\n| FirstCommitDate | Date of the first commit |\n| LastCommitDate | Date of the most recent commit |\n| AgeDays | Days since first commit |\n| ChangesPerWeek | Average commits per week over the file's lifetime |\n| ChangesPerMonth | Average commits per month |\n| ChangesPerYear | Average commits per year |\n| CommitsLast7Days | Commits in the last 7 days |\n| CommitsLast30Days | Commits in the last 30 days |\n| CommitsLast365Days | Commits in the last 365 days |\n| TotalUniqueAuthors | Distinct authors (by email) who ever touched the file |\n| UniqueAuthorsLast7Days | Distinct authors in the last 7 days |\n| UniqueAuthorsLast30Days | Distinct authors in the last 30 days |\n| UniqueAuthorsLast365Days | Distinct authors in the last 365 days |\n| CoveragePercent | Line coverage from Cobertura XML (empty if not provided) |\n| ChurnRiskScore | Computed risk score, sorted descending |\n\nResults are always sorted by **ChurnRiskScore descending** so the highest-risk files appear first.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankraemer%2Fgit-churn-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloriankraemer%2Fgit-churn-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloriankraemer%2Fgit-churn-calculator/lists"}