Programming Languages and Frameworks Supported by code-review-graph: Complete Parser & Enrichment Guide

code-review-graph supports 40+ programming languages via Tree-sitter grammars and detects framework entry points for Python (FastAPI, Flask, Celery), Java (Spring), JavaScript/TypeScript (Express, NestJS), and Android/Kotlin through decorator pattern matching.

The code-review-graph repository automatically parses source files and enriches execution-flow graphs with framework-specific semantics. Understanding which programming languages and frameworks supported by code-review-graph are available ensures you can leverage its full static analysis capabilities across polyglot codebases. The system combines extension-based language detection in code_review_graph/parser.py with decorator pattern matching in code_review_graph/flows.py to build semantically rich code graphs.

Language Support via Tree-sitter in parser.py

The core language detection logic resides in code_review_graph/parser.py (lines 13-83), which maps file extensions to Tree-sitter grammars. When CodeParser.detect_language() encounters a file, it first checks the extension against an internal mapping table before falling back to shebang analysis.

Supported Programming Languages and Extensions

The parser recognizes over 40 languages covering web, systems, mobile, and data science ecosystems:

  • Python: .py, .ipynb (Jupyter notebooks)
  • JavaScript/TypeScript: .js, .jsx, .mjs, .ts, .tsx, .astro, .vue, .svelte
  • Systems languages: .go, .rs (Rust), .c, .h, .cpp, .cc, .cxx, .hpp, .hh, .zig
  • JVM ecosystem: .java, .kt (Kotlin), .scala, .dart, .groovy (implied by standard patterns)
  • Mobile: .swift, .m (Objective-C)
  • Web/Scripting: .php, .rb (Ruby), .pl, .pm, .t (Perl), .lua, .luau
  • Data/Config: .r, .jl (Julia), .sql, .tf, .hcl, .yml, .yaml, .properties, .nix
  • Enterprise: .cs (C#), .vb (VB.NET), .ps1, .psm1, .psd1 (PowerShell)
  • Specialized: .sol (Solidity), .gd (GDScript), .res, .resi (ReScript), .sv, .svh, .v, .vh (Verilog), .ex, .exs (Elixir)
  • Shell: .sh, .bash, .zsh, .ksh

Shebang Detection for Extensionless Files

For files without extensions, the parser falls back to shebang probing using the SHEBANG_INTERPRETER_TO_LANGUAGE table in code_review_graph/parser.py. For example, a script beginning with #!/usr/bin/env python resolves to the python language, while #!/bin/bash maps to bash.

Framework Detection and Entry Point Enrichment

Beyond parsing, code-review-graph identifies framework-specific entry points in code_review_graph/flows.py (lines 27-72). The detect_entry_points() function scans function decorators against regex patterns to mark HTTP handlers, background tasks, and event listeners.

Python Web and Task Frameworks

The detector recognizes patterns for FastAPI, Flask, Starlette, and Sanic through route decorators like app.get, router.post, and blueprint.route. It also identifies Celery tasks via the regex (celery\.)?(task|shared_task|periodic_task), Click CLI commands through click.command|group, and Pydantic validators via (field|model)_(serializer|validator).

Additional Python support includes Django signals (receiver), Django REST (api_view), pytest fixtures (pytest.fixture|mark), and SQLAlchemy event listeners ((event\.)?listens_for).

Java Spring and Enterprise Patterns

For Java applications, the parser matches Spring annotations including (Get|Post|Put|Delete|Patch|RequestMapping)Mapping, Scheduled, EventListener, Bean, Configuration, and KafkaListener. Temporal workflow patterns like WorkflowMethod and ActivityMethod are also supported.

JavaScript, TypeScript, and Mobile Frameworks

JS/TS detection covers Express, Koa, and Hono through patterns like (app|router).(get|post|put|delete|patch|use|all). Angular and NestJS are recognized via Component|Injectable|Controller|Module|Guard|Pipe and GraphQL patterns (Subscribe|Mutation|Query|Resolver).

Android and Kotlin support includes @Override, @OnLifecycleEvent, @Composable, HiltViewModel, AndroidEntryPoint, and Inject.

AI and Agent Frameworks

Emerging AI frameworks like LangChain and pydantic-ai are recognized through tool|tool_plain|system_prompt|result_validator decorator patterns, enabling semantic analysis of AI agent codepaths.

Middleware and Exception Handling

The system detects FastAPI and Starlette middleware through middleware|exception_handler|on_exception patterns, ensuring async request/response flows are properly captured in the graph.

Practical Implementation Examples

Detecting a File's Language

from code_review_graph.parser import CodeParser
from pathlib import Path

parser = CodeParser()

# Shebang-based detection for extensionless scripts

lang = parser.detect_language(Path("my_script"))

# → "python" (if the script starts with `#!/usr/bin/env python`)

# Extension-based lookup

lang = parser.detect_language(Path("app.py"))

# → "python"

Building Graphs with Framework Entry Points

from code_review_graph.graph import GraphStore, parse_repo
from code_review_graph.flows import detect_entry_points

# Parse a repository (tree-sitter parsers are selected automatically)

store = GraphStore()
parse_repo(Path("/path/to/repo"), store)

# Find all entry points, including those annotated with framework decorators

entries = detect_entry_points(store)          # default: exclude test nodes

print([e.qualified_name for e in entries])

# Example output:

#   ['app.py::main', 'src/api.py::get_user', 'src/tasks.py::process_data']

Extending Language Support

Create a languages.toml file in the repository root to add custom languages:

[[languages]]
name = "mydsl"
extensions = [".mydsl"]
class_node_types = ["class_declaration"]
function_node_types = ["function_declaration"]
import_node_types = ["import_statement"]
call_node_types = ["call_expression"]

When CodeParser is instantiated with repo_root=Path("."), it automatically loads the custom mapping:

parser = CodeParser(repo_root=Path("."))
parser.detect_language(Path("example.mydsl"))   # → "mydsl"

Summary

  • 40+ languages are supported through Tree-sitter grammars mapped in code_review_graph/parser.py (lines 13-83), covering Python, JavaScript, Go, Rust, Java, and specialized languages like Solidity and Verilog.
  • Shebang detection provides fallback language identification for extensionless executable scripts using the SHEBANG_INTERPRETER_TO_LANGUAGE table.
  • Framework enrichment occurs in code_review_graph/flows.py (lines 27-72), where detect_entry_points() identifies HTTP handlers, background tasks, and event listeners via decorator regex matching.
  • Extensible architecture allows custom language definitions via languages.toml, enabling analysis of domain-specific languages without modifying core source code.
  • Polyglot framework support spans Python web stacks (FastAPI, Flask), Java Spring, JS/TS ecosystems (Express, NestJS), mobile frameworks (Android/Kotlin), and emerging AI tools (LangChain).

Frequently Asked Questions

How does code-review-graph handle files without extensions?

The detect_language() method in code_review_graph/parser.py falls back to shebang analysis when no extension is present. It reads the first line of the file and matches it against the SHEBANG_INTERPRETER_TO_LANGUAGE dictionary to determine the language (e.g., #!/usr/bin/env python3 resolves to python). If no shebang is found, the method returns None and the file is excluded from graph construction.

Can I add support for a custom programming language not in the default list?

Yes, create a languages.toml file in your repository root defining the language name, file extensions, and Tree-sitter node types for classes, functions, imports, and calls. When you instantiate CodeParser with repo_root=Path("."), it automatically loads this configuration and treats the specified extensions as your custom language without requiring modifications to the core library.

Which Python web frameworks are recognized as entry points?

The system recognizes FastAPI, Flask, Starlette, and Sanic through route decorators (app.get, router.post, blueprint.route), Celery tasks, Click CLI commands, Django signals and REST views, and Pydantic validators. The detect_entry_points() function matches these using compiled regex patterns in code_review_graph/flows.py, marking matched functions as framework entry points in the execution graph.

Does code-review-graph support infrastructure-as-code and configuration files?

Yes, the parser handles Terraform and HCL (.tf, .hcl), SQL (.sql), YAML (.yml, .yaml), Properties files, and Nix expressions (.nix). These are mapped to their respective Tree-sitter grammars in code_review_graph/parser.py, allowing the graph builder to include configuration and schema definitions alongside application code.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →