{"id":48975136,"url":"https://github.com/tvinke/algorilla","last_synced_at":"2026-04-18T08:34:12.968Z","repository":{"id":343721258,"uuid":"1176061728","full_name":"tvinke/algorilla","owner":"tvinke","description":"Find the hidden O(n^2) in your codebase before your users do.","archived":false,"fork":false,"pushed_at":"2026-04-04T00:28:50.000Z","size":1597,"stargazers_count":2,"open_issues_count":27,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T02:21:05.115Z","etag":null,"topics":["code-quality","complexity","gradle-plugin","groovy","java","javascript","kotlin","linter","performance","static-analysis"],"latest_commit_sha":null,"homepage":"https://tvinke.github.io/algorilla/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tvinke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":null,"dco":null,"cla":null}},"created_at":"2026-03-08T15:09:55.000Z","updated_at":"2026-04-04T00:28:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tvinke/algorilla","commit_stats":null,"previous_names":["tvinke/algorilla"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tvinke/algorilla","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvinke%2Falgorilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvinke%2Falgorilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvinke%2Falgorilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvinke%2Falgorilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvinke","download_url":"https://codeload.github.com/tvinke/algorilla/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvinke%2Falgorilla/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31962398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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-quality","complexity","gradle-plugin","groovy","java","javascript","kotlin","linter","performance","static-analysis"],"created_at":"2026-04-18T08:34:12.255Z","updated_at":"2026-04-18T08:34:12.953Z","avatar_url":"https://github.com/tvinke.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Algorilla\n\n[![CI](https://img.shields.io/github/actions/workflow/status/tvinke/algorilla/ci.yml?branch=main\u0026logo=github\u0026label=CI)](https://github.com/tvinke/algorilla/actions/workflows/ci.yml)\n[![Docs](https://img.shields.io/badge/docs-algorilla-blue?logo=materialformkdocs)](https://tvinke.github.io/algorilla/)\n[![License](https://img.shields.io/github/license/tvinke/algorilla)](https://github.com/tvinke/algorilla/blob/main/LICENSE)\n[![Languages](https://img.shields.io/badge/Java%20%7C%20Kotlin%20%7C%20Groovy%20%7C%20JS%2FTS-supported-green)]()\n\n**Find the hidden O(n²) in your codebase before your users do.**\n\nAlgorilla scans your source code for algorithmic complexity anti-patterns — the kind of performance issues that pass code review, work fine with test data, and then surface under real load. It points out where to look; you decide what's worth fixing.\n\n## The problem\n\nThis code looks fine. It passes every code review:\n\n```java\nfor (Order order : orders) {\n    if (priorityIds.contains(order.getId())) {\n        ship(order);\n    }\n}\n```\n\nBut `List.contains()` is O(n). Inside that loop, the real cost is **O(orders × priorityIds)**. With 10,000 orders and 8,000 priority IDs, that's 80 million comparisons.\n\n## What algorilla finds\n\n```\n⏺ src/main/java/com/example/shop/service/OrderService.java (1 finding)\n\n     warning  · nested-lookup · Loop amplifiers · O(orders × priorityIds) → O(orders + priorityIds)\n    com.example.shop.service.OrderService:3\n\n      Linear contains on 'priorityIds' inside for-each loop\n      → Build a HashSet/Map from 'priorityIds' before the loop\n      ↗ https://tvinke.github.io/algorilla/rules/nested-lookup\n\n          2 │ for (Order order : orders) {\n          3 │     if (priorityIds.contains(order.getId())) {\n          4 │         ship(order);\n\n      ⎿  for-each loop over orders OrderService.java:2 O(orders)\n        ⎿  contains on 'priorityIds' OrderService.java:3 O(priorityIds) ← bottleneck\n```\n\nEvery finding shows the complexity before and after, a concrete suggestion, an evidence chain tracing the execution path, and a link to the [rule docs](https://tvinke.github.io/algorilla/rules/nested-lookup/). You judge whether the data sizes in your context actually make it matter — algorilla raises it, you call it.\n\n## Quick start\n\n```bash\nnpx algorilla .\n```\n\nThat's it. Scans the current project, auto-detects the build system, and reports findings. Bundles a JRE if Java isn't on your PATH.\n\nToo many findings? Start small:\n\n```bash\nnpx algorilla --limit 5 .\n```\n\n## Install\n\n**npm** (recommended):\n```bash\nnpm install -g algorilla\n```\n\n**Gradle plugin**:\n```kotlin\nplugins {\n    id(\"io.github.tvinke.algorilla\") version \"0.3.0\"\n}\n```\n```bash\n./gradlew algorilla\n```\n\n**GitHub Action** (uploads SARIF to Code Scanning automatically):\n```yaml\n- uses: tvinke/algorilla@v0.3.0\n  with:\n    paths: '.'\n```\n\n**Docker** / **JAR**: see [installation docs](https://tvinke.github.io/algorilla/getting-started/installation/).\n\n## What it detects\n\n29 rules across [6 categories](https://tvinke.github.io/algorilla/rules/). Not every finding is a bug — some patterns are fine at small scale. Algorilla flags the spots worth reviewing:\n\n- **Nested lookups** — `contains()`/`filter()` inside a loop turning O(n) into O(n×m)\n- **N+1 queries** — `findById()` or repository calls inside loops\n- **Sort abuse** — sorting an entire collection just to pick the first/last element\n- **IO in loops** — HTTP, DB, or file calls per iteration instead of batching\n- **Hidden nested loops** — method calls that hide an inner loop behind an innocuous name\n- **Redundant expensive calls** — same heavy computation repeated with the same arguments\n\nEach rule page explains the pattern, shows real examples, and discusses when the finding matters (and when it doesn't): **[browse all rules](https://tvinke.github.io/algorilla/rules/)**\n\n## How it works\n\nPure AST pattern matching — no AI, no ML, fully deterministic. Algorilla parses your code into an intermediate representation, runs rules against it, and follows call chains across files. Results are reproducible: same code, same findings, every time.\n\n**Languages**: Java (GA), Kotlin (Alpha), Groovy (Beta), JavaScript/TypeScript (Beta)\n**Output**: Console (default), SARIF for GitHub Code Scanning, JSON for tooling\n**Speed**: Incremental caching — only re-analyzes changed files\n\n## Confidence levels\n\nNot all findings are equally certain. Each one has a [confidence tier](https://tvinke.github.io/algorilla/guide/understanding-output/#confidence-levels):\n\n- **HIGH** — structurally proven, very few false positives\n- **MEDIUM** — likely correct, may need context\n- **LOW** — heuristic-based, worth investigating\n\nDefault output shows HIGH confidence only. Widen with `--confidence medium` or `--confidence low` as you work through them. See [triaging a large scan](https://tvinke.github.io/algorilla/guide/understanding-output/#triaging-a-large-scan) for the recommended workflow.\n\n## Stability\n\nPre-1.0. Breaking changes documented in the [CHANGELOG](CHANGELOG.md). CLI flags, rule IDs, JSON output, and exit codes are treated as stable — we avoid breaking them, and when we must, we call it out. See [Stability \u0026 Compatibility](https://tvinke.github.io/algorilla/stability/) for the full policy.\n\n## Documentation\n\nFull docs at **[tvinke.github.io/algorilla](https://tvinke.github.io/algorilla/)**\n\n- [Quick start](https://tvinke.github.io/algorilla/getting-started/quickstart/) — first scan in 2 minutes\n- [Understanding output](https://tvinke.github.io/algorilla/guide/understanding-output/) — what each part of a finding means\n- [Workflow](https://tvinke.github.io/algorilla/guide/workflow/) — scan, triage, fix or accept, repeat\n- [All rules](https://tvinke.github.io/algorilla/rules/) — 29 rules with examples and guidance\n- [CI/CD integration](https://tvinke.github.io/algorilla/guide/ci-integration/) — GitHub Actions, SARIF, quality gates\n- [Configuration](https://tvinke.github.io/algorilla/getting-started/configuration/) — `.algorilla.yml` reference\n\n## Building from source\n\n```bash\n./gradlew build        # compile + test + detekt + ktlint\n./gradlew shadowJar    # create executable JAR\n```\n\nRequires JDK 21. See [developer docs](https://tvinke.github.io/algorilla/developer/building/).\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvinke%2Falgorilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvinke%2Falgorilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvinke%2Falgorilla/lists"}