{"id":51470669,"url":"https://github.com/dekobon/big-code-analysis","last_synced_at":"2026-07-06T17:01:23.938Z","repository":{"id":360101136,"uuid":"1221647240","full_name":"dekobon/big-code-analysis","owner":"dekobon","description":"Tool to report source code metrics","archived":false,"fork":false,"pushed_at":"2026-06-28T22:54:49.000Z","size":30951,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-28T23:17:11.819Z","etag":null,"topics":["code-metrics","cyclomatic-complexity","static-analysis","static-code-analysis"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dekobon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-26T13:56:02.000Z","updated_at":"2026-06-28T22:54:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dekobon/big-code-analysis","commit_stats":null,"previous_names":["dekobon/big-code-analysis"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dekobon/big-code-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekobon%2Fbig-code-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekobon%2Fbig-code-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekobon%2Fbig-code-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekobon%2Fbig-code-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dekobon","download_url":"https://codeload.github.com/dekobon/big-code-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dekobon%2Fbig-code-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35199360,"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-06T02:00:07.184Z","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":["code-metrics","cyclomatic-complexity","static-analysis","static-code-analysis"],"created_at":"2026-07-06T17:01:23.039Z","updated_at":"2026-07-06T17:01:23.932Z","avatar_url":"https://github.com/dekobon.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# big-code-analysis\n\n[![crates.io](https://img.shields.io/crates/v/big-code-analysis.svg)](https://crates.io/crates/big-code-analysis)\n[![MSRV](https://img.shields.io/crates/msrv/big-code-analysis.svg)](Cargo.toml)\n[![CI](https://github.com/dekobon/big-code-analysis/actions/workflows/ci.yml/badge.svg?branch=main\u0026event=push)](https://github.com/dekobon/big-code-analysis/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush)\n[![codecov](https://codecov.io/gh/dekobon/big-code-analysis/graph/badge.svg)](https://codecov.io/gh/dekobon/big-code-analysis)\n[![CodeQL](https://github.com/dekobon/big-code-analysis/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/dekobon/big-code-analysis/actions/workflows/codeql.yml?query=branch%3Amain)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/dekobon/big-code-analysis/badge)](https://scorecard.dev/viewer/?uri=github.com/dekobon/big-code-analysis)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13461/badge)](https://www.bestpractices.dev/projects/13461)\n[![docs.rs](https://docs.rs/big-code-analysis/badge.svg)](https://docs.rs/big-code-analysis)\n[![License](https://img.shields.io/crates/l/big-code-analysis.svg)](LICENSE)\n\n**big-code-analysis** is a hard fork of the [rust-code-analysis](https://github.com/mozilla/rust-code-analysis) project.\nThis project is an unapologetic vibe-coded fork that seeks to add as many features and functions as fast as possible.\n\nNonetheless, it is still a Rust library to analyze and extract information\nfrom source code written in many different programming languages.\nIt is based on a parser generator tool and an incremental parsing library\ncalled\n\u003ca href=\"https://tree-sitter.github.io/tree-sitter/\" target=\"_blank\"\u003eTree Sitter\u003c/a\u003e.\n\nA command line tool called **bca** is provided to interact with the API of the library in an easy way.\n\nThis tool can be used to:\n\n- Call **big-code-analysis** API\n- Print nodes and metrics information\n- Export metrics in different formats\n- Generate a Markdown or HTML quality-metrics report (`bca report markdown` / `bca report html`)\n\nIn addition, we provide a **bca-web** tool to use the library through a REST API.\n\n## Live example reports\n\n`bca` runs against its own source on every push to `main` and publishes\nthe result alongside the documentation:\n\n- HTML hotspot report:\n  \u003chttps://dekobon.github.io/big-code-analysis/reports/index.html\u003e\n- Markdown PR/MR comment:\n  \u003chttps://dekobon.github.io/big-code-analysis/reports/report.md\u003e\n\nThe wiring lives in\n[`.github/workflows/pages.yml`](.github/workflows/pages.yml). For\ndownstream projects, the\n[CI integration recipe](https://dekobon.github.io/big-code-analysis/recipes/ci.html)\nis the canonical adoption guide — it documents the recommended\npinned-release install path (with `BCA_VERSION` + sha256 pin) plus\na `cargo install` alternative. The in-tree `pages.yml` workflow\nbuilds `bca` from the current checkout because main may carry CLI\nartifact schemas that no released `bca` supports yet — see the\nschema-compatibility note in the recipe before copying that pattern.\n\n## Usage\n\n**big-code-analysis** supports many types of programming languages and\ncomputes a great variety of metrics. You can find up to date documentation at\n\u003ca href=\"https://dekobon.github.io/big-code-analysis/index.html\" target=\"_blank\"\u003eDocumentation\u003c/a\u003e.\n\nOn the\n\u003ca href=\"https://dekobon.github.io/big-code-analysis/commands/index.html\" target=\"_blank\"\u003e\n    Commands\n\u003c/a\u003e page, there is a list of commands that can be run to get information\nabout metrics, nodes, and other general data provided by this software.\n\n## Using as a library\n\n`big-code-analysis` is published on crates.io and can be embedded\ndirectly. The crate is on the `1.x` line and ships under a written\nstability contract: the public API surface is held stable across\npatch and minor bumps, and breaking shape changes are reserved for\nthe next major bump. Metric *values* may still drift across minor\nbumps when a grammar pin moves or a metric definition is fixed —\nsee [STABILITY.md](./STABILITY.md) for the full versioning contract,\nMSRV policy, escape hatches, and exactly what we do and do not\npromise within `1.x`.\n\nFor task-oriented walkthroughs — quick start, in-memory analysis,\nwalking `FuncSpace` results, and error handling — see the\n[**Using as a Library**](https://dekobon.github.io/big-code-analysis/library/index.html)\nsection of the book.\n\nPython bindings (PyO3) live in\n[`big-code-analysis-py/`](./big-code-analysis-py/README.md) and ship\nthe same metric pipeline as a Python package. See the book's\n[**Python Bindings**](https://dekobon.github.io/big-code-analysis/python/index.html)\nsection for the install matrix, batch / async / SARIF recipes, and\nthe full error taxonomy.\n\n### Per-language Cargo features\n\nEvery tree-sitter grammar is gated behind a per-language Cargo\nfeature. The default feature set is `all-languages`, so a bare\n\n```toml\nbig-code-analysis = \"2.0.1\"\n```\n\npulls every grammar in (matching the library's historical behaviour\nand what the `bca` / `bca-web` binaries ship). Library consumers that\nonly need a subset of languages can opt out of the defaults and\nre-enable just the grammars they want:\n\n```toml\nbig-code-analysis = { version = \"2.0.1\", default-features = false, features = [\"rust\", \"typescript\"] }\n```\n\nSupported language features: `bash`, `c`, `cpp`, `csharp`, `elixir`,\n`go`, `groovy`, `irules`, `java`, `javascript`, `kotlin`, `lua`,\n`mozcpp`, `mozjs`, `perl`, `php`, `python`, `ruby`, `rust`, `tcl`,\n`typescript`. The `irules` feature adds F5 iRules (a Tcl\ndialect; extensions `.irule` / `.irules`). The\n`cpp` feature backs the `Cpp` LANG variant with the upstream\ncommunity `tree-sitter-cpp` grammar and, with the `Ccomment` and\n`Preproc` C-family helper variants, pulls in `tree-sitter-cpp`,\n`bca-tree-sitter-ccomment`, and `bca-tree-sitter-preproc` together.\nThe `c` feature (added in #721) backs the dedicated `C` LANG variant\nwith upstream `tree-sitter-c` and owns `.c`; it shares the same\n`ccomment` / `preproc` C-family helpers. `.h` stays on `Cpp`.\nThe opt-in `mozcpp` feature adds the `Mozcpp` LANG variant — the\nMozilla/Gecko C++ dialect (vendored `bca-tree-sitter-mozcpp` fork) —\nwhich owns no file extensions and is selected only by name\n(`--language mozcpp`, manifest, or API), mirroring `mozjs` for\n`.jsm`. Since #720 `cpp` no longer pulls `bca-tree-sitter-mozcpp`\n(a breaking dep-set change for `--no-default-features` consumers).\n\nThe `LANG` enum keeps every variant defined regardless of the active\nfeature set; selecting a [`LANG`] variant whose feature is off\nreturns `Err(MetricsError::LanguageDisabled(LANG))` from every\ndispatch entry point (`analyze`, `metrics_from_tree`, `action`,\n`get_ops`, the deprecated `get_function_spaces*` shims, and\n`LANG::tree_sitter_language`). The set of compiled-in variants\nis queryable via `LANG::is_enabled`.\n\n## Building\n\nThe repository ships a `Makefile` that wraps every common build, test,\nlint, and docs task. Run `make help` for the full list, and\n`make check-tools` to verify the optional tools are installed.\n\n```console\nmake build           # debug build of the entire workspace\nmake build-release   # optimised release build\n```\n\nIf you prefer to run cargo directly, or want to build a single crate:\n\n```console\ncargo build                              # library only\ncargo build -p big-code-analysis-cli     # CLI only\ncargo build -p big-code-analysis-web     # web server only\ncargo build --workspace                  # everything in one shot\n```\n\n## Testing\n\n```console\nmake test           # cargo test --workspace --all-features --lib --bins --tests\nmake test-doc      # cargo test --workspace --all-features --doc\nmake pre-commit    # full local gate: fmt-check, clippy, tests, udeps, lint families\n```\n\n`make pre-commit` is the recommended gate before committing — it is\nequivalent to what CI runs. If GNU Make 4 or any of the optional\ntools are unavailable, the raw cargo invocation still works:\n\n```console\ncargo test --workspace --all-features --verbose\n```\n\n### Updating insta tests\n\nWe use [insta](https://insta.rs), to update the snapshot tests you should install [cargo insta](https://crates.io/crates/cargo-insta)\n\n```console\nmake insta-review   # cargo insta test --review\n```\n\nWill run the tests, generate the new snapshot references and let you review them.\n\n### Updating grammars\n\nHave a look at\n\u003ca href=\"https://dekobon.github.io/big-code-analysis/developers/update-grammars.html\" target=\"_blank\"\u003eUpdate grammars guide\u003c/a\u003e\nto learn how to update languages grammars.\n\n## Contributing\n\nIf you want to contribute to the development of this software, have a look at the\nguidelines contained in our\n\u003ca href=\"https://dekobon.github.io/big-code-analysis/developers/index.html\" target=\"_blank\"\u003eDevelopers Guide\u003c/a\u003e.\n\n## Licenses\n\n- Mozilla-defined grammars are released under the MIT license.\n\n- **big-code-analysis**, **big-code-analysis-cli** and **big-code-analysis-web**\nare released under the\n\u003ca href=\"https://www.mozilla.org/MPL/2.0/\" target=\"_blank\"\u003eMozilla Public License v2.0\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekobon%2Fbig-code-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdekobon%2Fbig-code-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdekobon%2Fbig-code-analysis/lists"}