Gallery ยท Architecture explained ยท Score ยท SQL
sqlc architecture: modules, API surface, dependency graph
Generate type-safe code from SQL. Generated from sqlc-dev/sqlc at 1911a76, MIT.
Scanned the SQL compiler and the example SQL. Generated language backends are not included.
- Files
- 401
- Modules
- 35
- API routes
- 0
- Documents
- 17
GoSQL
Executive Summary
At a Glance
| Aspect | Summary |
|---|---|
| What | sqlc is a early-stage command-line tool |
| Built With | general-purpose + Go, SQL |
| Scale | 35 modules across 401 files |
| Maturity | Early-stage (1/3 indicators) |
What This System Does
sqlc is a general-purpose command-line tool built with Go, SQL. It operates as a command-line interface, enabling users to interact with the system through terminal commands. This architecture is optimized for automation, scripting, and integration into CI/CD pipelines.
Business Capabilities
The system is organized around 6 functional domains, each representing a distinct business capability:
| Domain | Capability | Scale |
|---|---|---|
| Data Layer | path internal/sql/ast matches sql | 11 modules, 335 files |
| Other | Uncategorized module | 14 modules, 48 files |
| Search & Discovery | path internal/sql/catalog matches catalog | 4 modules, 12 files |
| Core Engine | path internal/compiler/engine.go matches engine | 3 modules, 3 files |
| Analysis & Detection | path internal/compiler/analyze.go matches analyz | 2 modules, 2 files |
| Rendering & Output | path internal/compiler/output_columns.go matches output | 1 modules, 1 files |
Technical Foundation
| Layer | Technologies | Purpose |
|---|---|---|
| Language | Go, SQL | Primary development language |
Module Composition
The codebase follows a layered architecture with clear separation of concerns:
| Layer | Count | Key Modules | Responsibility |
|---|---|---|---|
| Other Modules | 13 | ast, ondeck | General purpose functionality |
| analyzer | 1 | analyze.go | Supporting application functionality |
| core | 1 | catalog_core.go | Supporting application functionality |
Codebase Health
Overall Health: ๐ข 95/100
| Metric | Value | Status |
|---|---|---|
| Internal imports | 10632 edges | โ Connected |
| External Packages | 1 | โ Manageable |
| Circular Dependencies | cycle-free | โ None |
| Orphan Files | 2 | โ ๏ธ 2 unused |
Key Insights
- โ Clean module boundaries โ No circular dependencies detected, enabling safe refactoring and testing.
- โ
Healthy coupling โ Most-imported module (
internal/sql/format/format.go) serves 73 files without excessive centralization.
Key Data Flows
The system processes information through 6 identified flows:
- resolve.go Request Flow (critical) โ Import chain starting from
internal/compiler/resolve.goโ traces how this entry point depends on 2 downstream modules - output_columns.go Request Flow (critical) โ Import chain starting from
internal/compiler/output_columns.goโ traces how this entry point depends on 2 downstream modules - parse_core.go Request Flow (critical) โ Import chain starting from
internal/compiler/parse_core.goโ traces how this entry point depends on 2 downstream modules - query_catalog.go Request Flow (critical) โ Import chain starting from
internal/compiler/query_catalog.goโ traces how this entry point depends on 2 downstream modules - parse.go Request Flow (critical) โ Import chain starting from
internal/compiler/parse.goโ traces how this entry point depends on 2 downstream modules
Strategic Observations
- The codebase follows Core/kernel architecture โ `internal/compiler/catalog_core.go`, `internal/compiler/expand_core.go`, `internal/compiler/parse_core.go`, Multi-output publishing โ `internal/compiler/output_columns.go`, Analysis pipeline โ `internal/compiler/analyze.go`, Acyclic dependency graph โ clean layering architectural patterns, providing a familiar structure for developers.
- With 6 distinct domains, the system has clear separation of concerns suitable for team-based development.
- As a CLI tool, this system is automation-friendly and can integrate into existing workflows and pipelines.
This executive summary was generated from comprehensive repository analysis including dependency graphs, data flow detection, and architectural pattern recognition. Enable AI enhancement with `GITHUB_TOKEN` for strategic recommendations, risk assessments, and plain-language explanations tailored for non-technical stakeholders.
<!-- repolens:docs-badge -->  ยท Examples
System Overview
The Big Picture
sqlc is a medium-sized codebase with clear structure, containing 35 modules spread across 401 files.
| Dimension | Details |
|---|---|
| Total Files | 401 |
| Module Count | 35 |
| Functional Domains | 6 |
| Interface Type | Command-Line Tool |
Technology Stack
The system is built on a modern technology foundation:
| Layer | Technologies | Purpose |
|---|---|---|
| Language | Go, SQL | Primary development language |
Architecture Patterns
The codebase follows 4 identified architectural patterns:
- Core/kernel architecture โ `internal/compiler/catalog_core.go`, `internal/compiler/expand_core.go`, `internal/compiler/parse_core.go` โ A structured approach to organizing code and managing complexity.
- Multi-output publishing โ `internal/compiler/output_columns.go` โ A structured approach to organizing code and managing complexity.
- Analysis pipeline โ `internal/compiler/analyze.go` โ A structured approach to organizing code and managing complexity.
- Acyclic dependency graph โ clean layering โ The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.
Module Architecture
The system is organized into 3 architectural layers:
| Layer | Modules | Key Examples | Responsibility |
|---|---|---|---|
| Other Modules | 13 | ast, ondeck | General purpose functionality |
| analyzer | 1 | analyze.go | Supporting application functionality |
| core | 1 | catalog_core.go | Supporting application functionality |
Layer Details
Other Modules โ 13 modules
internal/sql/astโ 315 files โ Core application moduleexamples/ondeckโ 15 files โ Core application moduleexamples/authorsโ 14 files โ Authentication and authorization logicinternal/sql/catalogโ 9 files โ Core application module- +9 more modules
analyzer โ 1 module
internal/compiler/analyze.goโ 1 files โ Code analysis and inference
core โ 1 module
internal/compiler/catalog_core.goโ 1 files โ Core application module
Functional Domains
The following domains represent the largest functional areas by file count:
| Rank | Domain | Scale | Business Capability |
|---|---|---|---|
| 1 | Data Layer | 335 files | path internal/sql/ast matches sql |
| 2 | Other | 48 files | Uncategorized module |
| 3 | Search & Discovery | 12 files | path internal/sql/catalog matches catalog |
| 4 | Core Engine | 3 files | path internal/compiler/engine.go matches engine |
| 5 | Analysis & Detection | 2 files | path internal/compiler/analyze.go matches analyz |
| 6 | Rendering & Output | 1 files | path internal/compiler/output_columns.go matches output |
Dependency Graph
Codebase Health: ๐ข 95/100
| Metric | Value | Assessment |
|---|---|---|
| Internal Imports | 10632 | Modules are connected |
| External Packages | 1 | Lean dependencies |
| Circular Dependencies | 0 | โ Clean |
| Orphan Files | 2 | โ ๏ธ 2 unused |
Hub modules (most imported):
internal/sql/format/format.goโ imported by 73 files
This system overview was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative context, architectural rationale, technology trade-off analysis, and scalability recommendations.
<!-- repolens:docs-badge -->  ยท Examples
Business Domains
Overview
sqlc is organized into 6 functional domains, each representing a distinct area of business capability. This document maps the technical structure to business-oriented functional areas.
Quick Reference:
| Domain | Modules | Files | Primary Capability |
|---|---|---|---|
| Data Layer | 11 | 335 | Data persistence and modeling |
| Other | 14 | 48 | Supporting business operations |
| Search & Discovery | 4 | 12 | Search and content discovery |
| Core Engine | 3 | 3 | Supporting business operations |
| Analysis & Detection | 2 | 2 | Supporting business operations |
| Rendering & Output | 1 | 1 | Output generation and templating |
1. Data Layer
Business Capability
path internal/sql/ast matches sql
This is a major domain with 11 modules and 335 source files.
Key Modules
| Module | Purpose |
|---|---|
internal/sql/ast | Core application module |
internal/sql/astutils | Utility and helper functions |
internal/sql/preprocess | Core application module |
internal/sql/validate | Core application module |
internal/sql/named | Core application module |
Business Impact
- Change Frequency Impact: High โ Changes here affect 335 files
- Domain Complexity: Complex (multiple modules)
- Recommendation: Ensure comprehensive testing before modifying this domain
2. Other
Business Capability
Uncategorized module
This is a significant domain with 14 modules and 48 source files.
Key Modules
| Module | Purpose |
|---|---|
examples/ondeck | Core application module |
examples/authors | Authentication and authorization logic |
examples/booktest | Test infrastructure |
examples/batch | Core application module |
examples/jets | Core application module |
Business Impact
- Change Frequency Impact: Medium โ Changes here affect 48 files
- Domain Complexity: Complex (multiple modules)
3. Search & Discovery
Business Capability
path internal/sql/catalog matches catalog
This is a focused domain with 4 modules and 12 source files.
Key Modules
| Module | Purpose |
|---|---|
internal/sql/catalog | Core application module |
internal/compiler/catalog_core.go | Core application module |
internal/compiler/query.go | Core application module |
internal/compiler/query_catalog.go | Core application module |
Business Impact
- Change Frequency Impact: Low โ Changes here affect 12 files
- Domain Complexity: Moderate
4. Core Engine
Business Capability
path internal/compiler/engine.go matches engine
This is a focused domain with 3 modules and 3 source files.
Key Modules
| Module | Purpose |
|---|---|
internal/compiler/engine.go | Core application module |
internal/compiler/expand_core.go | Core application module |
internal/compiler/parse_core.go | Core application module |
Business Impact
- Change Frequency Impact: Low โ Changes here affect 3 files
- Domain Complexity: Moderate
5. Analysis & Detection
Business Capability
path internal/compiler/analyze.go matches analyz
This is a focused domain with 2 modules and 2 source files.
Key Modules
| Module | Purpose |
|---|---|
internal/compiler/analyze.go | Code analysis and inference |
internal/compiler/parse.go | Core application module |
Business Impact
- Change Frequency Impact: Low โ Changes here affect 2 files
- Domain Complexity: Simple
6. Rendering & Output
Business Capability
path internal/compiler/output_columns.go matches output
This is a focused domain with 1 module and 1 source file.
Key Modules
| Module | Purpose |
|---|---|
internal/compiler/output_columns.go | Core application module |
Business Impact
- Change Frequency Impact: Low โ Changes here affect 1 file
- Domain Complexity: Simple
Cross-Domain Dependencies
The following modules serve as shared infrastructure across multiple domains:
| Module | Consumers | Role |
|---|---|---|
internal/sql/format/format.go | 73 modules | Core application module |
Cross-Domain Integration Points
These modules facilitate communication and data sharing between domains:
- `internal/sql/format/format.go` serves as a central integration point, imported by 73 different modules. Changes to this module have wide-ranging impact and should be carefully coordinated.
Domain Health Summary
| Metric | Value | Assessment |
|---|---|---|
| Total Domains | 6 | Well-balanced |
| Avg Files/Domain | 67 | Appropriate size |
| Largest Domain | Data Layer (335 files) | Consider breaking down |
| Domain Concentration | 84% in largest | โ ๏ธ High concentration |
Domain mapping is based on directory naming conventions and code organization patterns. Enable AI enhancement with `GITHUB_TOKEN` for business-language descriptions, stakeholder impact analysis, strategic recommendations, and cross-domain relationship narratives.
<!-- repolens:docs-badge -->  ยท Examples
Architecture Overview
Architectural Philosophy
sqlc follows a Core/kernel architecture โ `internal/compiler/catalog_core.go`, `internal/compiler/expand_core.go`, `internal/compiler/parse_core.go` architecture with elements of Multi-output publishing โ `internal/compiler/output_columns.go`, Analysis pipeline โ `internal/compiler/analyze.go`, Acyclic dependency graph โ clean layering.
Pattern Analysis
Core/kernel architecture โ `internal/compiler/catalog_core.go`, `internal/compiler/expand_core.go`, `internal/compiler/parse_core.go`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Multi-output publishing โ `internal/compiler/output_columns.go`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Analysis pipeline โ `internal/compiler/analyze.go`
A structured approach to organizing code and managing complexity.
Benefits: Structured organization, maintainability, clarity
Acyclic dependency graph โ clean layering
The system operates as a command-line interface, accepting user input through terminal commands and producing structured output.
Benefits: Automation-friendly, scriptable, integrates with CI/CD pipelines
System Layers
The system is organized into 6 functional layers, each encapsulating a distinct area of responsibility:
| Layer | Responsibility | Scale | Key Insight |
|---|---|---|---|
| Data Layer | path internal/sql/ast matches sql | 335 files | Large domain โ consider breaking down |
| Other | Uncategorized module | 48 files | Standard domain |
| Search & Discovery | path internal/sql/catalog matches catalog | 12 files | Standard domain |
| Core Engine | path `internal/compiler/engine | 3 files | Standard domain |
| Analysis & Detection | path `internal/compiler/analyze | 2 files | Standard domain |
| Rendering & Output | path `internal/compiler/output_columns | 1 files | Standard domain |
Module Layers
Modules are classified into 3 architectural roles:
Other Modules
Role: General purpose functionality
| Module | Files | Description |
|---|---|---|
internal/sql/ast | 315 | Core application module |
examples/ondeck | 15 | Core application module |
examples/authors | 14 | Authentication and authorization logic |
internal/sql/catalog | 9 | Core application module |
examples/booktest | 6 | Test infrastructure |
| +8 more | โ | Additional modules |
analyzer
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
internal/compiler/analyze.go | 1 | Code analysis and inference |
core
Role: Supporting application functionality
| Module | Files | Description |
|---|---|---|
internal/compiler/catalog_core.go | 1 | Core application module |
Technology Foundation
| Layer | Technologies | Architectural Implication |
|---|---|---|
| Language | Go, SQL | Fast compilation, strong concurrency support |
Scale & Complexity Analysis
| Dimension | Value | Assessment |
|---|---|---|
| Total Files | 401 | large project |
| Module Count | 35 | medium complexity |
| Domain Spread | 6 domains | Good separation |
| Interface | CLI | Terminal-driven interaction |
Dependency Health
Architecture Health Score: ๐ข 95/100
| Metric | Value | Status | Recommendation |
|---|---|---|---|
| Import Edges | 10632 | โ | Healthy module connectivity |
| External Packages | 1 | โ | Lean dependency set |
| Circular Deps | 0 | โ | Clean module boundaries |
| Orphan Files | 2 | โ ๏ธ | Review for dead code |
Architectural Strengths
- Clean module boundaries โ No circular dependencies detected. This enables safe refactoring, isolated testing, and clear ownership boundaries.
- Balanced coupling โ No single module dominates the import graph. This reduces change risk and enables parallel development.
Hub modules (most imported):
internal/sql/format/format.goโ imported by 73 files
This architecture overview was generated from comprehensive dependency graph analysis and pattern detection. Enable AI enhancement with `GITHUB_TOKEN` for architectural narratives, design rationale explanations, scalability analysis, and refactoring recommendations.
<!-- repolens:docs-badge -->  ยท Examples
Module Catalog
A complete inventory of all code modules in the repository, organized by location and size. Each module represents a distinct area of responsibility within the codebase.
Total modules: 35
Module Inventory
| Module | Files | Role |
|---|---|---|
internal/sql/ast | 315 | Application module ยท Critical shared infrastructure (imported by 10362 modules) |
examples/ondeck | 15 | Application module |
examples/authors | 14 | Application module |
internal/sql/catalog | 9 | Application module ยท Critical shared infrastructure (imported by 90 modules) |
examples/booktest | 6 | Application module |
internal/sql/astutils | 4 | Application module ยท Critical shared infrastructure (imported by 44 modules) |
internal/sql/preprocess | 4 | Application module ยท Critical shared infrastructure (imported by 24 modules) |
internal/sql/validate | 4 | Application module ยท Shared infrastructure (imported by 12 modules) |
examples/batch | 2 | Application module |
examples/jets | 2 | Application module |
internal/sql/named | 2 | Application module ยท Shared infrastructure (imported by 8 modules) |
internal/compiler/analyze.go | 1 | Code analysis and intelligence ยท Orchestrator (coordinates 324 modules) |
internal/compiler/catalog_core.go | 1 | Core business logic and shared foundations ยท Orchestrator (coordinates 323 modules) |
internal/compiler/compat.go | 1 | Application module ยท Orchestrator (coordinates 318 modules) |
internal/compiler/compile.go | 1 | Application module ยท Orchestrator (coordinates 320 modules) |
internal/compiler/engine.go | 1 | Application module ยท Orchestrator (coordinates 9 modules) |
internal/compiler/expand.go | 1 | Application module ยท Orchestrator (coordinates 318 modules) |
internal/compiler/expand_core.go | 1 | Core business logic and shared foundations ยท Orchestrator (coordinates 314 modules) |
internal/compiler/find_params.go | 1 | Application module ยท Orchestrator (coordinates 318 modules) |
internal/compiler/output_columns.go | 1 | Application module ยท Orchestrator (coordinates 329 modules) |
internal/compiler/parse.go | 1 | Application module ยท Orchestrator (coordinates 326 modules) |
internal/compiler/parse_core.go | 1 | Core business logic and shared foundations ยท Orchestrator (coordinates 329 modules) |
internal/compiler/query.go | 1 | Application module ยท Orchestrator (coordinates 323 modules) |
internal/compiler/query_catalog.go | 1 | Application module ยท Orchestrator (coordinates 327 modules) |
internal/compiler/resolve.go | 1 | Application module ยท Orchestrator (coordinates 334 modules) |
internal/compiler/result.go | 1 | Application module ยท Orchestrator (coordinates 9 modules) |
internal/compiler/returning.go | 1 | Application module ยท Orchestrator (coordinates 314 modules) |
internal/compiler/selector.go | 1 | Application module ยท Isolated (no imports or importers) |
internal/compiler/to_column.go | 1 | Application module ยท Orchestrator (coordinates 318 modules) |
internal/sql/format | 1 | Application module ยท Critical shared infrastructure (imported by 73 modules) |
internal/sql/info | 1 | Application module ยท Orchestrator (coordinates 9 modules) |
internal/sql/lang | 1 | Application module ยท Leaf module (consumed only, 1 importer) |
internal/sql/sqlerr | 1 | Application module ยท Critical shared infrastructure (imported by 16 modules) |
internal/sql/sqlfile | 1 | Application module ยท Isolated (no imports or importers) |
internal/sql/sqlpath | 1 | Application module ยท Leaf module (consumed only, 1 importer) |
Module detection is based on the `module_roots` setting in your RepoLens configuration. Adjust this setting to change how modules are grouped.
<!-- repolens:docs-badge -->  ยท Examples
Route Map
A complete listing of user-facing pages and backend API endpoints. This map shows every URL a user or client can interact with, along with the source file that handles each route.
Route Detection
This project is a CLI tool โ it does not expose HTTP routes or serve web pages. This is expected behavior, not a detection failure.
CLI tools interact through terminal commands rather than URLs. See the System Overview or Developer Onboarding documents for command documentation.
<!-- repolens:docs-badge -->  ยท Examples
API Surface
This page documents both the API endpoints the application exposes and the external services it integrates with. Use it as a reference for understanding the system's interfaces.
Internal API Endpoints
These are the backend services the application provides to handle incoming requests.
No API routes were detected in this scan. If your project uses a routing framework (Express, Fastify, NestJS, etc.), ensure the relevant directories are included in your scan.include patterns.
External API Integrations
Third-party services the application connects to, grouped by category.
No external API integrations were detected. This section populates automatically when RepoLens identifies SDK imports or API client usage in your codebase.
HTTP method reference โ GET: retrieve data, POST: create, PUT/PATCH: update, DELETE: remove.
<!-- repolens:docs-badge -->  ยท Examples
Data Flows
Understanding Data Movement
Data flows describe how information moves through sqlc โ from external inputs through processing layers to storage or presentation. Understanding these flows is essential for debugging, performance optimization, and architectural decisions.
Flow Summary
6 data flows identified in the codebase:
| Flow | Type | Complexity | Critical |
|---|---|---|---|
| resolve.go Request Flow | Integration | Medium (3 steps) | ๐ด Yes |
| output_columns.go Request Flow | Integration | Medium (3 steps) | ๐ด Yes |
| parse_core.go Request Flow | Integration | Medium (3 steps) | ๐ด Yes |
| query_catalog.go Request Flow | Integration | Medium (3 steps) | ๐ด Yes |
| parse.go Request Flow | Integration | Medium (3 steps) | ๐ด Yes |
| Authentication Flow | Integration | Medium (5 steps) | ๐ด Yes |
1. resolve.go Request Flow ๐ด CRITICAL FLOW
Description
Import chain starting from internal/compiler/resolve.go โ traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | resolve.go (entry point, imports 334 modules) | Data acquisition |
| 2 | a_array_expr.go (shared infrastructure, used by 33 files) | Processing step |
| 3 | format.go (shared infrastructure, used by 73 files) | Output generation |
Flow Diagram
โโ START โโ
โ `resolve.go` (entry point, imports 334 modules) โ
โ โ
โ `a_array_expr.go` (shared infrastructure, used ... โ
โ โ
โ `format.go` (shared infrastructure, used by 73 ... โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
resolve.go | Core application module |
a_array_expr.go | Core application module |
format.go | Core application module |
Dependencies
Shared libraries used: internal/sql/astutils
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
2. output_columns.go Request Flow ๐ด CRITICAL FLOW
Description
Import chain starting from internal/compiler/output_columns.go โ traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | output_columns.go (entry point, imports 329 modules) | Data acquisition |
| 2 | a_array_expr.go (shared infrastructure, used by 33 files) | Processing step |
| 3 | format.go (shared infrastructure, used by 73 files) | Output generation |
Flow Diagram
โโ START โโ
โ `output_columns.go` (entry point, imports 329 m... โ
โ โ
โ `a_array_expr.go` (shared infrastructure, used ... โ
โ โ
โ `format.go` (shared infrastructure, used by 73 ... โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
output_columns.go | Core application module |
a_array_expr.go | Core application module |
format.go | Core application module |
Dependencies
Shared libraries used: internal/sql/astutils
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
3. parse_core.go Request Flow ๐ด CRITICAL FLOW
Description
Import chain starting from internal/compiler/parse_core.go โ traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | parse_core.go (entry point, imports 329 modules) | Data acquisition |
| 2 | a_array_expr.go (shared infrastructure, used by 33 files) | Processing step |
| 3 | format.go (shared infrastructure, used by 73 files) | Output generation |
Flow Diagram
โโ START โโ
โ `parse_core.go` (entry point, imports 329 modules) โ
โ โ
โ `a_array_expr.go` (shared infrastructure, used ... โ
โ โ
โ `format.go` (shared infrastructure, used by 73 ... โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
parse_core.go | Core application module |
a_array_expr.go | Core application module |
format.go | Core application module |
Dependencies
Shared libraries used: internal/sql/astutils
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
4. query_catalog.go Request Flow ๐ด CRITICAL FLOW
Description
Import chain starting from internal/compiler/query_catalog.go โ traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | query_catalog.go (entry point, imports 327 modules) | Data acquisition |
| 2 | a_array_expr.go (shared infrastructure, used by 33 files) | Processing step |
| 3 | format.go (shared infrastructure, used by 73 files) | Output generation |
Flow Diagram
โโ START โโ
โ `query_catalog.go` (entry point, imports 327 mo... โ
โ โ
โ `a_array_expr.go` (shared infrastructure, used ... โ
โ โ
โ `format.go` (shared infrastructure, used by 73 ... โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
query_catalog.go | Core application module |
a_array_expr.go | Core application module |
format.go | Core application module |
Dependencies
Shared libraries used: internal/sql/astutils
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
5. parse.go Request Flow ๐ด CRITICAL FLOW
Description
Import chain starting from internal/compiler/parse.go โ traces how this entry point depends on 2 downstream modules
Characteristics
| Property | Value |
|---|---|
| Steps | 3 |
| Modules Involved | 3 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | parse.go (entry point, imports 326 modules) | Data acquisition |
| 2 | a_array_expr.go (shared infrastructure, used by 33 files) | Processing step |
| 3 | format.go (shared infrastructure, used by 73 files) | Output generation |
Flow Diagram
โโ START โโ
โ `parse.go` (entry point, imports 326 modules) โ
โ โ
โ `a_array_expr.go` (shared infrastructure, used ... โ
โ โ
โ `format.go` (shared infrastructure, used by 73 ... โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
parse.go | Core application module |
a_array_expr.go | Core application module |
format.go | Core application module |
Dependencies
Shared libraries used: internal/sql/astutils
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
6. Authentication Flow ๐ด CRITICAL FLOW
Description
User authentication and session management
Characteristics
| Property | Value |
|---|---|
| Steps | 5 |
| Modules Involved | 1 |
| Criticality | Critical |
Processing Steps
| Step | Action | Purpose |
|---|---|---|
| 1 | User submits login credentials | Security check |
| 2 | Auth API validates credentials | Input validation |
| 3 | Session is created and stored | Data persistence |
| 4 | User is redirected to authenticated area | Security check |
| 5 | Subsequent requests include auth token | Security check |
Flow Diagram
โโ START โโ
โ User submits login credentials โ
โ โ
โ Auth API validates credentials โ
โ โ
โ Session is created and stored โ
โ โ
โ User is redirected to authenticated area โ
โ โ
โ Subsequent requests include auth token โ
โโ END โโโโ
Involved Modules
| Module | Role |
|---|---|
authors | Authentication and authorization logic |
Dependencies
Shared libraries used: internal/sql/astutils
External services: Authentication service
Insights
- โ ๏ธ Critical path โ Failures here have significant business impact
- ๐ Consider adding monitoring and alerting
- ๐งช Ensure comprehensive test coverage
Import Network
The system has 10632 internal import edges connecting 362 source files.
Network Topology
| Metric | Value | Meaning |
|---|---|---|
| Total Edges | 10632 | Direct import relationships |
| Hub Count | 1 | Central integration points |
| Avg Connections | ~29.4 per file | Coupling density |
Key Integration Points
These modules aggregate data from multiple sources:
| Hub | Inbound | Role |
|---|---|---|
format.go | 73 files | Core application module |
Flow detection uses naming conventions, import patterns, and dependency graph analysis. Enable AI enhancement with `GITHUB_TOKEN` for end-to-end flow narratives, failure mode analysis, data transformation descriptions, and performance bottleneck identification.
<!-- repolens:docs-badge -->  ยท Examples
Architecture Diff
No changes detected.
<!-- repolens:docs-badge -->  ยท Examples
System Map
What is this? This visual diagram shows how different parts of your codebase connect to each other. Arrows indicate dependencies (which modules use which).
Showing: 30 modules and 50 relationships
Source: Real import analysis
Architecture Diagram
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐๏ธ SYSTEM ARCHITECTURE MAP โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ๏ธ CORE LOGIC
โ
โโโ catalog_core.go (1 file)
โ โ ast
โ โ catalog
โโโ expand_core.go (1 file)
โ โ ast
โโโ parse_core.go (1 file)
โ ast
โ astutils
โ named
... +2 more
โ
๐ ANALYSIS
โ
โโโ analyze.go (1 file)
โ ast
โ named
โ preprocess
... +1 more
โ
๐ RENDERING
โ
โโโ format (1 file)
โ
๐ค PUBLISHING
โ
โโโ output_columns.go (1 file)
โ ast
โ astutils
โ catalog
โ
๐ ๏ธ UTILITIES
โ
โโโ astutils (4 files)
โ ast
โ
โ
TESTING
โ
โโโ booktest (6 files)
โ
๐ฆ OTHER
โ
โโโ ast (315 files)
โ โ format
โโโ ondeck (15 files)
โโโ authors (14 files)
โโโ catalog (9 files)
โ โ ast
โโโ preprocess (4 files)
โ โ ast
โ โ named
โโโ validate (4 files)
โ โ ast
โ โ astutils
โ โ catalog
โโโ batch (2 files)
โโโ jets (2 files)
โโโ named (2 files)
โโโ compat.go (1 file)
โ โ ast
โ โ astutils
โโโ compile.go (1 file)
โ โ ast
โ โ preprocess
โโโ engine.go (1 file)
โ โ catalog
โโโ expand.go (1 file)
โ โ ast
โ โ astutils
โโโ find_params.go (1 file)
โ โ ast
โ โ astutils
โโโ parse.go (1 file)
โ โ ast
โ โ astutils
โ โ preprocess
โ ... +1 more
โโโ query.go (1 file)
โ โ ast
โ โ catalog
โโโ query_catalog.go (1 file)
โ โ ast
โ โ catalog
โ โ preprocess
โโโ resolve.go (1 file)
โ โ ast
โ โ astutils
โ โ catalog
โ ... +2 more
โโโ result.go (1 file)
โ โ catalog
โโโ returning.go (1 file)
โ โ ast
โโโ selector.go (1 file)
โโโ to_column.go (1 file)
โ ast
โ astutils
โ
Legend:
โ imports / depends on
โโ tests
Key Connections
Most depended-on modules (highest import count):
| Module | Imported by |
|---|---|
internal/sql/ast | 10362 modules |
internal/sql/catalog | 81 modules |
internal/sql/format | 73 modules |
internal/sql/astutils | 44 modules |
internal/sql/preprocess | 24 modules |
Most dependent modules (highest dependency count):
| Module | Depends on |
|---|---|
internal/sql/catalog | 2826 modules |
internal/sql/validate | 1286 modules |
internal/sql/astutils | 1256 modules |
internal/compiler/resolve.go | 333 modules |
internal/compiler/parse_core.go | 328 modules |
<!-- repolens:docs-badge -->  ยท Examples
Developer Onboarding
Welcome to sqlc! ๐
This guide will help you get up to speed quickly. sqlc is a general-purpose tools project built with Go, SQL, containing 35 modules across 401 files.
What You'll Learn
- โ Repository structure and organization
- โ Technology stack and tools
- โ Key modules to understand first
- โ How data flows through the system
- โ How to start contributing
Quick Reference Card
| Aspect | Details |
|---|---|
| Languages | Go, SQL |
| Frameworks | general-purpose tools |
| Build Tools | Standard toolchain |
| Size | 35 modules, 401 files |
| Domains | 6 functional areas |
| Type | Command-line interface |
Repository Structure
Understanding the directory layout is your first step to navigating the codebase:
| Directory | Purpose | Start Here? |
|---|---|---|
internal/compiler | Project files | โ |
internal/sql | Project files | โ |
examples | Project files | โ |
Where to Begin
Start by exploring the main src/ directory or look for entry point files like index.js, main.js, or app.js.
Technology Stack
| Layer | Technologies | What to Learn |
|---|---|---|
| Language | Go, SQL | Review language idioms used in the codebase |
Core Modules to Understand
These are the most important modules by size and centrality. Understanding them will unlock the rest of the codebase:
| Priority | Module | Files | Type | Why It Matters |
|---|---|---|---|---|
| โญ High | internal/sql/ast | 315 | Other Modules | Large module โ core functionality |
| โญ High | examples/ondeck | 15 | Other Modules | Key system component |
| โญ High | examples/authors | 14 | Other Modules | Key system component |
| Medium | internal/sql/catalog | 9 | Other Modules | Key system component |
| Medium | examples/booktest | 6 | Other Modules | Key system component |
| Medium | internal/sql/astutils | 4 | Other Modules | Key system component |
| Low | internal/sql/preprocess | 4 | Other Modules | Key system component |
| Low | internal/sql/validate | 4 | Other Modules | Key system component |
| Low | examples/batch | 2 | Other Modules | Key system component |
| Low | examples/jets | 2 | Other Modules | Key system component |
Key Integration Points
These modules are imported by many other files. Changes here have wide impact:
- `internal/sql/format/format.go` โ Used by 73 files โ Core application module
โ ๏ธ Caution: Be extra careful when modifying these files. Consider the ripple effects.
How Data Flows
Understanding these flows helps you see how the system processes information end-to-end:
| Flow | Description | Key Modules |
|---|---|---|
| resolve.go Request Flow | Import chain starting from internal/compiler/resolve.go โ ... | resolve.go, a_array_expr.go |
| output_columns.go Request Flow | Import chain starting from `internal/compiler/output_columns... | output_columns.go, a_array_expr.go |
| parse_core.go Request Flow | Import chain starting from internal/compiler/parse_core.go... | parse_core.go, a_array_expr.go |
| query_catalog.go Request Flow | Import chain starting from `internal/compiler/query_catalog.... | query_catalog.go, a_array_expr.go |
| parse.go Request Flow | Import chain starting from internal/compiler/parse.go โ tr... | parse.go, a_array_expr.go |
Debugging tip: When investigating issues, trace the data flow from input to output to identify where problems occur.
Getting Started Checklist
Follow these steps to set up your development environment:
1. Clone and Install
git clone <repository-url>
cd sqlc
npm install # or yarn, pnpm
2. Explore the Structure
- Review the directory structure above
- Open the
README.mdfor project-specific instructions - Look for
CONTRIBUTING.mdfor contribution guidelines
3. Understand Core Modules
Start with the high-priority modules listed above. Read the code and comments to understand:
- What problem each module solves
- How modules interact with each other
- What data structures are used
4. Make Your First Change
Start small:
- Find a small bug or typo to fix
- Make the change in a feature branch
- Run tests to ensure nothing breaks
- Submit a pull request for review
Common Pitfalls
New contributors often run into these issues:
- Environment setup โ Check for
.env.examplefiles and ensure you have all required environment variables. - Branch naming โ Follow the team's branch naming conventions (usually
feature/,fix/,docs/).
Additional Resources
| Resource | Purpose |
|---|---|
README.md | Project overview and quick start |
CONTRIBUTING.md | Contribution guidelines (if exists) |
CHANGELOG.md | Recent changes and release history |
package.json | Available scripts and dependencies |
This onboarding guide was generated from comprehensive repository analysis. Enable AI enhancement with `GITHUB_TOKEN` for narrative walkthroughs, common pitfall documentation, debugging tips, architecture deep-dives, and personalized contribution recommendations.
Welcome to the team! Happy coding! ๐
<!-- repolens:docs-badge -->  ยท Examples
GraphQL Schema
No GraphQL schema was detected in this repository.
RepoLens scans for .graphql and .gql schema files, inline SDL via tagged template literals (e.g. gql\...\``), resolver patterns, and popular GraphQL libraries including Apollo, Yoga, Nexus, Pothos, Mercurius, type-graphql, Relay, and urql.
If your project uses GraphQL, ensure the relevant source directories are included in your scan.include configuration.
<!-- repolens:docs-badge -->  ยท Examples
TypeScript Type Graph
No TypeScript type declarations were detected in this repository.
RepoLens analyzes .ts and .tsx files for interface declarations, type aliases, classes, and enums. Ensure your TypeScript source directories are included in the scan.include configuration.
<!-- repolens:docs-badge -->  ยท Examples
Dependency Graph
362 files ยท 10632 imports ยท 1 external packages ยท โ no circular dependencies ยท 2 orphan file(s)
This document maps every import relationship in the codebase, identifies the most-connected modules, and flags circular dependencies that may complicate refactoring or increase build times.
Overview
| Metric | Value |
|---|---|
| Source files | 362 |
| Import edges | 10632 |
| External packages | 1 |
| Circular dependencies | 0 |
| Orphan files (no imports or importers) | 2 |
Hub Modules
These are the most-imported modules in the codebase. Changes to hub modules have the widest blast radius and should be reviewed carefully:
| Module | Imported By |
|---|---|
internal/sql/format/format.go | 73 files |
External Dependencies
The codebase imports 1 external package. These are third-party modules (not the language standard library):
| Package |
| --------- |
golang.org/x/sync/errgroup |
Generated by RepoLens import analysis. Dependency detection covers JavaScript and TypeScript (ES modules, dynamic import, CommonJS, re-exports; comments, strings, and type-only imports are skipped), Python (`import` / `from ... import`, including relative imports), and Go (`go.mod` module paths). Go `_test.go` files are not part of the graph.*
<!-- repolens:docs-badge -->  ยท Examples
Architecture Drift
No baseline found. Run
repolens publishonce to establish a baseline.
A baseline snapshot of the current architecture has been saved. On subsequent runs, this report will track structural changes across the following dimensions:
| Dimension | What is Tracked |
|---|---|
| Modules | New, removed, or significantly resized modules |
| API Endpoints | Added or removed backend routes |
| Dependencies | Changes to external package imports |
| Frameworks | Technology stack additions or removals |
| Circular Dependencies | Increases in dependency cycles |
| GraphQL Schema | Type additions or removals |
| Codebase Scale | Overall file count changes |
<!-- repolens:docs-badge -->  ยท Examples
Security Hotspots
No security anti-patterns were detected in the scanned source files.
RepoLens scans JavaScript and TypeScript source files for common security risks including code injection (eval), XSS (innerHTML), SQL injection, command injection, prototype pollution, hardcoded credentials, and insecure randomness.
Test files, configs, and build outputs are excluded from analysis to reduce false positives.
<!-- repolens:docs-badge -->  ยท Examples
Code Health Report
362 files analyzed ยท Average health: 94/100 ยท 325 A, 13 B, 19 C, 5 D, 0 F
This report synthesizes complexity, coupling, documentation, and security signals into a single health score per module. Lower scores indicate higher risk and maintenance burden.
Overview
| Metric | Value |
|---|---|
| Files analyzed | 362 |
| Average health score | 94/100 |
| Average complexity | 9 |
| Hotspots (score < 60) | 20 |
Grade Distribution
| Grade | Count | Meaning |
|---|---|---|
| ๐ข A (80โ100) | 325 | Healthy โ low complexity, well-documented |
| ๐ต B (60โ79) | 13 | Acceptable โ minor improvements possible |
| ๐ก C (40โ59) | 19 | Needs attention โ elevated complexity or coupling |
| ๐ D (20โ39) | 5 | At risk โ multiple quality signals degraded |
| ๐ด F (0โ19) | 0 | Critical โ immediate refactoring recommended |
Hotspots โ Priority Refactoring Targets
These modules have the lowest health scores and should be prioritized for improvement:
| Module | Score | Grade | Complexity | Coupling | Doc% | Security |
|---|---|---|---|---|---|---|
internal/sql/astutils/rewrite.go | 30 | ๐ D | 269 | 11โ 314โ | โ | โ |
internal/sql/astutils/walk.go | 30 | ๐ D | 796 | 11โ 314โ | โ | โ |
internal/sql/catalog/table.go | 30 | ๐ D | 110 | 10โ 315โ | โ | โ |
internal/sql/catalog/types.go | 31 | ๐ D | 71 | 10โ 315โ | โ | โ |
internal/sql/preprocess/preprocess.go | 39 | ๐ D | 48 | 6โ 317โ | โ | โ |
internal/sql/catalog/catalog.go | 41 | ๐ก C | 33 | 10โ 314โ | โ | โ |
internal/sql/ast/a_expr.go | 43 | ๐ก C | 46 | 33โ 1โ | โ | โ |
internal/sql/ast/comment.go | 43 | ๐ก C | 38 | 33โ 1โ | โ | โ |
internal/compiler/compile.go | 45 | ๐ก C | 49 | 0โ 320โ | โ | โ |
internal/compiler/expand.go | 45 | ๐ก C | 44 | 0โ 318โ | โ | โ |
internal/compiler/find_params.go | 45 | ๐ก C | 54 | 0โ 318โ | โ | โ |
internal/compiler/output_columns.go | 45 | ๐ก C | 190 | 0โ 329โ | โ | โ |
internal/compiler/parse_core.go | 45 | ๐ก C | 38 | 0โ 329โ | โ | โ |
internal/compiler/resolve.go | 45 | ๐ก C | 112 | 0โ 334โ | โ | โ |
internal/sql/lang/operator.go | 45 | ๐ก C | 41 | 1โ 0โ | โ | โ |
internal/sql/preprocess/scan.go | 45 | ๐ก C | 47 | 6โ 1โ | โ | โ |
internal/sql/sqlfile/split.go | 45 | ๐ก C | 58 | 0โ 0โ | โ | โ |
internal/sql/preprocess/lexer.go | 46 | ๐ก C | 85 | 6โ 0โ | โ | โ |
internal/sql/validate/insert_stmt.go | 47 | ๐ก C | 31 | 3โ 324โ | โ | โ |
internal/sql/ast/print.go | 51 | ๐ก C | 44 | 33โ 2โ | โ | โ |
Most Complex Functions
These functions have the highest cyclomatic complexity and are the most likely sources of bugs:
| Function | File | Line | Complexity |
|---|---|---|---|
Walk() | internal/sql/astutils/walk.go | 20 | 796 |
apply() | internal/sql/astutils/rewrite.go | 121 | 262 |
resolveCatalogRefs() | internal/compiler/resolve.go | 24 | 111 |
outputColumns() | internal/compiler/output_columns.go | 55 | 102 |
Visit() | internal/compiler/find_params.go | 55 | 53 |
Split() | internal/sql/sqlfile/split.go | 18 | 43 |
sourceTables() | internal/compiler/output_columns.go | 493 | 35 |
Update() | internal/sql/catalog/catalog.go | 45 | 30 |
createTable() | internal/sql/catalog/table.go | 256 | 27 |
Format() | internal/sql/ast/update_stmt.go | 33 | 26 |
expandStmt() | internal/compiler/expand.go | 113 | 25 |
AttachComments() | internal/sql/ast/comment.go | 128 | 25 |
Format() | internal/sql/ast/select_stmt.go | 39 | 25 |
IsComparisonOperator() | internal/sql/lang/operator.go | 5 | 24 |
parseQuery() | internal/compiler/parse.go | 22 | 22 |
All Modules by Health Score
Showing 50 of 362 modules (sorted worst-first)
| Module | Score | Grade | Lines | Complexity | Fan-In | Fan-Out |
|---|---|---|---|---|---|---|
internal/sql/astutils/rewrite.go | 30 | ๐ D | 1272 | 269 | 11 | 314 |
internal/sql/astutils/walk.go | 30 | ๐ D | 2201 | 796 | 11 | 314 |
internal/sql/catalog/table.go | 30 | ๐ D | 512 | 110 | 10 | 315 |
internal/sql/catalog/types.go | 31 | ๐ D | 375 | 71 | 10 | 315 |
internal/sql/preprocess/preprocess.go | 39 | ๐ D | 399 | 48 | 6 | 317 |
internal/sql/catalog/catalog.go | 41 | ๐ก C | 143 | 33 | 10 | 314 |
internal/sql/ast/a_expr.go | 43 | ๐ก C | 179 | 46 | 33 | 1 |
internal/sql/ast/comment.go | 43 | ๐ก C | 236 | 38 | 33 | 1 |
internal/compiler/compile.go | 45 | ๐ก C | 301 | 49 | 0 | 320 |
internal/compiler/expand.go | 45 | ๐ก C | 212 | 44 | 0 | 318 |
internal/compiler/find_params.go | 45 | ๐ก C | 215 | 54 | 0 | 318 |
internal/compiler/output_columns.go | 45 | ๐ก C | 813 | 190 | 0 | 329 |
internal/compiler/parse_core.go | 45 | ๐ก C | 214 | 38 | 0 | 329 |
internal/compiler/resolve.go | 45 | ๐ก C | 639 | 112 | 0 | 334 |
internal/sql/lang/operator.go | 45 | ๐ก C | 64 | 41 | 1 | 0 |
internal/sql/preprocess/scan.go | 45 | ๐ก C | 210 | 47 | 6 | 1 |
internal/sql/sqlfile/split.go | 45 | ๐ก C | 242 | 58 | 0 | 0 |
internal/sql/preprocess/lexer.go | 46 | ๐ก C | 285 | 85 | 6 | 0 |
internal/sql/validate/insert_stmt.go | 47 | ๐ก C | 142 | 31 | 3 | 324 |
internal/sql/ast/print.go | 51 | ๐ก C | 270 | 44 | 33 | 2 |
internal/sql/validate/cmd.go | 51 | ๐ก C | 89 | 29 | 3 | 318 |
internal/sql/catalog/public.go | 53 | ๐ก C | 134 | 27 | 10 | 315 |
internal/compiler/parse.go | 56 | ๐ก C | 202 | 33 | 0 | 326 |
internal/compiler/analyze.go | 59 | ๐ก C | 215 | 32 | 0 | 324 |
internal/compiler/returning.go | 62 | ๐ต B | 139 | 31 | 0 | 314 |
internal/sql/catalog/schema.go | 65 | ๐ต B | 135 | 30 | 10 | 315 |
internal/sql/ast/printer/printer.go | 66 | ๐ต B | 251 | 29 | 1 | 0 |
internal/sql/ast/update_stmt.go | 67 | ๐ต B | 165 | 26 | 33 | 1 |
internal/compiler/engine.go | 68 | ๐ต B | 200 | 27 | 0 | 9 |
internal/sql/ast/select_stmt.go | 68 | ๐ต B | 184 | 25 | 33 | 1 |
internal/sql/catalog/func.go | 70 | ๐ต B | 123 | 21 | 10 | 315 |
internal/compiler/compat.go | 72 | ๐ต B | 138 | 23 | 0 | 318 |
internal/sql/ast/window_def.go | 73 | ๐ต B | 117 | 20 | 33 | 1 |
internal/sql/ast/bool_expr.go | 75 | ๐ต B | 71 | 18 | 33 | 1 |
internal/sql/ast/def_elem.go | 76 | ๐ต B | 71 | 17 | 33 | 1 |
internal/sql/ast/sql_value_function.go | 76 | ๐ต B | 42 | 17 | 33 | 1 |
internal/compiler/query_catalog.go | 79 | ๐ต B | 110 | 19 | 0 | 327 |
internal/sql/catalog/view.go | 81 | ๐ข A | 53 | 10 | 10 | 315 |
internal/sql/catalog/comment_on.go | 82 | ๐ข A | 77 | 13 | 10 | 315 |
internal/sql/ast/create_table_stmt.go | 85 | ๐ข A | 107 | 13 | 33 | 1 |
internal/sql/astutils/join.go | 85 | ๐ข A | 22 | 4 | 11 | 314 |
internal/sql/astutils/search.go | 85 | ๐ข A | 22 | 2 | 11 | 314 |
internal/sql/catalog/extension.go | 85 | ๐ข A | 42 | 7 | 10 | 314 |
internal/sql/validate/func_call.go | 85 | ๐ข A | 49 | 7 | 3 | 328 |
internal/sql/validate/slice.go | 85 | ๐ข A | 71 | 9 | 3 | 319 |
internal/sql/sqlpath/read.go | 87 | ๐ข A | 67 | 13 | 1 | 0 |
internal/sql/ast/delete_stmt.go | 91 | ๐ข A | 92 | 11 | 33 | 1 |
internal/sql/ast/func_call.go | 91 | ๐ข A | 69 | 11 | 33 | 1 |
internal/sql/ast/on_conflict_clause.go | 91 | ๐ข A | 76 | 11 | 33 | 1 |
internal/sql/ast/type_name.go | 91 | ๐ข A | 77 | 11 | 33 | 1 |
Scoring Methodology
The health score (0โ100) is computed from four dimensions:
| Factor | Weight | How It's Measured |
|---|---|---|
| Complexity | โ1/pt above 10, โ2/pt above 30 | Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST) |
| Function complexity | โ2/pt above 8 per function | Highest complexity function in the file |
| Coupling | โ1/5 units above 20 | Fan-in ร Fan-out (import connections) |
| Documentation | โ10 if <50%, โ5 if <80% | JSDoc/TSDoc coverage of exports |
| Security | โ10/high, โ5/medium finding | Security anti-pattern findings in file |
Generated by RepoLens code health analysis. Complexity covers JavaScript/TypeScript, Python, and Go. It is regex-based and may differ from AST-based tools. Scores are relative indicators, not absolute quality measures.
<!-- repolens:docs-badge -->  ยท Examples