RepoLens

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

Stakeholders ยท High-level overview for leadership, product, and stakeholders

At a Glance

AspectSummary
Whatsqlc is a early-stage command-line tool
Built Withgeneral-purpose + Go, SQL
Scale35 modules across 401 files
MaturityEarly-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:

DomainCapabilityScale
Data Layerpath internal/sql/ast matches sql11 modules, 335 files
OtherUncategorized module14 modules, 48 files
Search & Discoverypath internal/sql/catalog matches catalog4 modules, 12 files
Core Enginepath internal/compiler/engine.go matches engine3 modules, 3 files
Analysis & Detectionpath internal/compiler/analyze.go matches analyz2 modules, 2 files
Rendering & Outputpath internal/compiler/output_columns.go matches output1 modules, 1 files

Technical Foundation

LayerTechnologiesPurpose
LanguageGo, SQLPrimary development language

Module Composition

The codebase follows a layered architecture with clear separation of concerns:

LayerCountKey ModulesResponsibility
Other Modules13ast, ondeckGeneral purpose functionality
analyzer1analyze.goSupporting application functionality
core1catalog_core.goSupporting application functionality

Codebase Health

Overall Health: ๐ŸŸข 95/100

MetricValueStatus
Internal imports10632 edgesโœ… Connected
External Packages1โœ… Manageable
Circular Dependenciescycle-freeโœ… None
Orphan Files2โš ๏ธ 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

System Overview

Mixed audience ยท Concise technical overview readable by all

The Big Picture

sqlc is a medium-sized codebase with clear structure, containing 35 modules spread across 401 files.

DimensionDetails
Total Files401
Module Count35
Functional Domains6
Interface TypeCommand-Line Tool

Technology Stack

The system is built on a modern technology foundation:

LayerTechnologiesPurpose
LanguageGo, SQLPrimary 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:

LayerModulesKey ExamplesResponsibility
Other Modules13ast, ondeckGeneral purpose functionality
analyzer1analyze.goSupporting application functionality
core1catalog_core.goSupporting application functionality
Layer Details

Other Modules โ€” 13 modules

  • internal/sql/ast โ€” 315 files โ€” Core application module
  • examples/ondeck โ€” 15 files โ€” Core application module
  • examples/authors โ€” 14 files โ€” Authentication and authorization logic
  • internal/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:

RankDomainScaleBusiness Capability
1Data Layer335 filespath internal/sql/ast matches sql
2Other48 filesUncategorized module
3Search & Discovery12 filespath internal/sql/catalog matches catalog
4Core Engine3 filespath internal/compiler/engine.go matches engine
5Analysis & Detection2 filespath internal/compiler/analyze.go matches analyz
6Rendering & Output1 filespath internal/compiler/output_columns.go matches output

Dependency Graph

Codebase Health: ๐ŸŸข 95/100

MetricValueAssessment
Internal Imports10632Modules are connected
External Packages1Lean dependencies
Circular Dependencies0โœ… Clean
Orphan Files2โš ๏ธ 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Business Domains

Mixed audience ยท Codebase structure translated into business language

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:

DomainModulesFilesPrimary Capability
Data Layer11335Data persistence and modeling
Other1448Supporting business operations
Search & Discovery412Search and content discovery
Core Engine33Supporting business operations
Analysis & Detection22Supporting business operations
Rendering & Output11Output 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
ModulePurpose
internal/sql/astCore application module
internal/sql/astutilsUtility and helper functions
internal/sql/preprocessCore application module
internal/sql/validateCore application module
internal/sql/namedCore 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
ModulePurpose
examples/ondeckCore application module
examples/authorsAuthentication and authorization logic
examples/booktestTest infrastructure
examples/batchCore application module
examples/jetsCore 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
ModulePurpose
internal/sql/catalogCore application module
internal/compiler/catalog_core.goCore application module
internal/compiler/query.goCore application module
internal/compiler/query_catalog.goCore 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
ModulePurpose
internal/compiler/engine.goCore application module
internal/compiler/expand_core.goCore application module
internal/compiler/parse_core.goCore 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
ModulePurpose
internal/compiler/analyze.goCode analysis and inference
internal/compiler/parse.goCore 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
ModulePurpose
internal/compiler/output_columns.goCore 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:

ModuleConsumersRole
internal/sql/format/format.go73 modulesCore 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

MetricValueAssessment
Total Domains6Well-balanced
Avg Files/Domain67Appropriate size
Largest DomainData Layer (335 files)Consider breaking down
Domain Concentration84% 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Overview

Engineers ยท Layered architecture and design patterns

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:

LayerResponsibilityScaleKey Insight
Data Layerpath internal/sql/ast matches sql335 filesLarge domain โ€” consider breaking down
OtherUncategorized module48 filesStandard domain
Search & Discoverypath internal/sql/catalog matches catalog12 filesStandard domain
Core Enginepath `internal/compiler/engine3 filesStandard domain
Analysis & Detectionpath `internal/compiler/analyze2 filesStandard domain
Rendering & Outputpath `internal/compiler/output_columns1 filesStandard domain

Module Layers

Modules are classified into 3 architectural roles:

Other Modules

Role: General purpose functionality

ModuleFilesDescription
internal/sql/ast315Core application module
examples/ondeck15Core application module
examples/authors14Authentication and authorization logic
internal/sql/catalog9Core application module
examples/booktest6Test infrastructure
+8 moreโ€”Additional modules
analyzer

Role: Supporting application functionality

ModuleFilesDescription
internal/compiler/analyze.go1Code analysis and inference
core

Role: Supporting application functionality

ModuleFilesDescription
internal/compiler/catalog_core.go1Core application module

Technology Foundation

LayerTechnologiesArchitectural Implication
LanguageGo, SQLFast compilation, strong concurrency support

Scale & Complexity Analysis

DimensionValueAssessment
Total Files401large project
Module Count35medium complexity
Domain Spread6 domainsGood separation
InterfaceCLITerminal-driven interaction

Dependency Health

Architecture Health Score: ๐ŸŸข 95/100

MetricValueStatusRecommendation
Import Edges10632โœ…Healthy module connectivity
External Packages1โœ…Lean dependency set
Circular Deps0โœ…Clean module boundaries
Orphan Files2โš ๏ธ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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Module Catalog

Engineers ยท Complete inventory of code modules with AI explanations

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

ModuleFilesRole
internal/sql/ast315Application module ยท Critical shared infrastructure (imported by 10362 modules)
examples/ondeck15Application module
examples/authors14Application module
internal/sql/catalog9Application module ยท Critical shared infrastructure (imported by 90 modules)
examples/booktest6Application module
internal/sql/astutils4Application module ยท Critical shared infrastructure (imported by 44 modules)
internal/sql/preprocess4Application module ยท Critical shared infrastructure (imported by 24 modules)
internal/sql/validate4Application module ยท Shared infrastructure (imported by 12 modules)
examples/batch2Application module
examples/jets2Application module
internal/sql/named2Application module ยท Shared infrastructure (imported by 8 modules)
internal/compiler/analyze.go1Code analysis and intelligence ยท Orchestrator (coordinates 324 modules)
internal/compiler/catalog_core.go1Core business logic and shared foundations ยท Orchestrator (coordinates 323 modules)
internal/compiler/compat.go1Application module ยท Orchestrator (coordinates 318 modules)
internal/compiler/compile.go1Application module ยท Orchestrator (coordinates 320 modules)
internal/compiler/engine.go1Application module ยท Orchestrator (coordinates 9 modules)
internal/compiler/expand.go1Application module ยท Orchestrator (coordinates 318 modules)
internal/compiler/expand_core.go1Core business logic and shared foundations ยท Orchestrator (coordinates 314 modules)
internal/compiler/find_params.go1Application module ยท Orchestrator (coordinates 318 modules)
internal/compiler/output_columns.go1Application module ยท Orchestrator (coordinates 329 modules)
internal/compiler/parse.go1Application module ยท Orchestrator (coordinates 326 modules)
internal/compiler/parse_core.go1Core business logic and shared foundations ยท Orchestrator (coordinates 329 modules)
internal/compiler/query.go1Application module ยท Orchestrator (coordinates 323 modules)
internal/compiler/query_catalog.go1Application module ยท Orchestrator (coordinates 327 modules)
internal/compiler/resolve.go1Application module ยท Orchestrator (coordinates 334 modules)
internal/compiler/result.go1Application module ยท Orchestrator (coordinates 9 modules)
internal/compiler/returning.go1Application module ยท Orchestrator (coordinates 314 modules)
internal/compiler/selector.go1Application module ยท Isolated (no imports or importers)
internal/compiler/to_column.go1Application module ยท Orchestrator (coordinates 318 modules)
internal/sql/format1Application module ยท Critical shared infrastructure (imported by 73 modules)
internal/sql/info1Application module ยท Orchestrator (coordinates 9 modules)
internal/sql/lang1Application module ยท Leaf module (consumed only, 1 importer)
internal/sql/sqlerr1Application module ยท Critical shared infrastructure (imported by 16 modules)
internal/sql/sqlfile1Application module ยท Isolated (no imports or importers)
internal/sql/sqlpath1Application 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Route Map

Mixed audience ยท Application routes and API endpoints with context

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

API Surface

Engineers ยท Backend API endpoints with usage examples

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Data Flows

Mixed audience ยท Major information flows through the system

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:

FlowTypeComplexityCritical
resolve.go Request FlowIntegrationMedium (3 steps)๐Ÿ”ด Yes
output_columns.go Request FlowIntegrationMedium (3 steps)๐Ÿ”ด Yes
parse_core.go Request FlowIntegrationMedium (3 steps)๐Ÿ”ด Yes
query_catalog.go Request FlowIntegrationMedium (3 steps)๐Ÿ”ด Yes
parse.go Request FlowIntegrationMedium (3 steps)๐Ÿ”ด Yes
Authentication FlowIntegrationMedium (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
PropertyValue
Steps3
Modules Involved3
CriticalityCritical
Processing Steps
StepActionPurpose
1resolve.go (entry point, imports 334 modules)Data acquisition
2a_array_expr.go (shared infrastructure, used by 33 files)Processing step
3format.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
ModuleRole
resolve.goCore application module
a_array_expr.goCore application module
format.goCore 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
PropertyValue
Steps3
Modules Involved3
CriticalityCritical
Processing Steps
StepActionPurpose
1output_columns.go (entry point, imports 329 modules)Data acquisition
2a_array_expr.go (shared infrastructure, used by 33 files)Processing step
3format.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
ModuleRole
output_columns.goCore application module
a_array_expr.goCore application module
format.goCore 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
PropertyValue
Steps3
Modules Involved3
CriticalityCritical
Processing Steps
StepActionPurpose
1parse_core.go (entry point, imports 329 modules)Data acquisition
2a_array_expr.go (shared infrastructure, used by 33 files)Processing step
3format.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
ModuleRole
parse_core.goCore application module
a_array_expr.goCore application module
format.goCore 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
PropertyValue
Steps3
Modules Involved3
CriticalityCritical
Processing Steps
StepActionPurpose
1query_catalog.go (entry point, imports 327 modules)Data acquisition
2a_array_expr.go (shared infrastructure, used by 33 files)Processing step
3format.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
ModuleRole
query_catalog.goCore application module
a_array_expr.goCore application module
format.goCore 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
PropertyValue
Steps3
Modules Involved3
CriticalityCritical
Processing Steps
StepActionPurpose
1parse.go (entry point, imports 326 modules)Data acquisition
2a_array_expr.go (shared infrastructure, used by 33 files)Processing step
3format.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
ModuleRole
parse.goCore application module
a_array_expr.goCore application module
format.goCore 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
PropertyValue
Steps5
Modules Involved1
CriticalityCritical
Processing Steps
StepActionPurpose
1User submits login credentialsSecurity check
2Auth API validates credentialsInput validation
3Session is created and storedData persistence
4User is redirected to authenticated areaSecurity check
5Subsequent requests include auth tokenSecurity 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
ModuleRole
authorsAuthentication 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
MetricValueMeaning
Total Edges10632Direct import relationships
Hub Count1Central integration points
Avg Connections~29.4 per fileCoupling density
Key Integration Points

These modules aggregate data from multiple sources:

HubInboundRole
format.go73 filesCore 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Diff

Mixed audience ยท Git diff analysis and impact assessment

No changes detected.

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

System Map

Mixed audience ยท Visual dependency graph with explanation

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):

ModuleImported by
internal/sql/ast10362 modules
internal/sql/catalog81 modules
internal/sql/format73 modules
internal/sql/astutils44 modules
internal/sql/preprocess24 modules

Most dependent modules (highest dependency count):

ModuleDepends on
internal/sql/catalog2826 modules
internal/sql/validate1286 modules
internal/sql/astutils1256 modules
internal/compiler/resolve.go333 modules
internal/compiler/parse_core.go328 modules

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Developer Onboarding

Engineers ยท Quick start guide for new developers

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
  1. โœ… Repository structure and organization
  2. โœ… Technology stack and tools
  3. โœ… Key modules to understand first
  4. โœ… How data flows through the system
  5. โœ… How to start contributing

Quick Reference Card

AspectDetails
LanguagesGo, SQL
Frameworksgeneral-purpose tools
Build ToolsStandard toolchain
Size35 modules, 401 files
Domains6 functional areas
TypeCommand-line interface

Repository Structure

Understanding the directory layout is your first step to navigating the codebase:

DirectoryPurposeStart Here?
internal/compilerProject filesโ€”
internal/sqlProject filesโ€”
examplesProject 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

LayerTechnologiesWhat to Learn
LanguageGo, SQLReview 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:

PriorityModuleFilesTypeWhy It Matters
โญ Highinternal/sql/ast315Other ModulesLarge module โ€” core functionality
โญ Highexamples/ondeck15Other ModulesKey system component
โญ Highexamples/authors14Other ModulesKey system component
Mediuminternal/sql/catalog9Other ModulesKey system component
Mediumexamples/booktest6Other ModulesKey system component
Mediuminternal/sql/astutils4Other ModulesKey system component
Lowinternal/sql/preprocess4Other ModulesKey system component
Lowinternal/sql/validate4Other ModulesKey system component
Lowexamples/batch2Other ModulesKey system component
Lowexamples/jets2Other ModulesKey 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:

FlowDescriptionKey Modules
resolve.go Request FlowImport chain starting from internal/compiler/resolve.go โ€” ...resolve.go, a_array_expr.go
output_columns.go Request FlowImport chain starting from `internal/compiler/output_columns...output_columns.go, a_array_expr.go
parse_core.go Request FlowImport chain starting from internal/compiler/parse_core.go...parse_core.go, a_array_expr.go
query_catalog.go Request FlowImport chain starting from `internal/compiler/query_catalog....query_catalog.go, a_array_expr.go
parse.go Request FlowImport 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.md for project-specific instructions
  • Look for CONTRIBUTING.md for 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:

  1. Find a small bug or typo to fix
  2. Make the change in a feature branch
  3. Run tests to ensure nothing breaks
  4. Submit a pull request for review

Common Pitfalls

New contributors often run into these issues:

  • Environment setup โ€” Check for .env.example files and ensure you have all required environment variables.
  • Branch naming โ€” Follow the team's branch naming conventions (usually feature/, fix/, docs/).

Additional Resources

ResourcePurpose
README.mdProject overview and quick start
CONTRIBUTING.mdContribution guidelines (if exists)
CHANGELOG.mdRecent changes and release history
package.jsonAvailable 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

GraphQL Schema

Engineers ยท GraphQL types, queries, mutations, and resolver map

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

TypeScript Type Graph

Engineers ยท TypeScript interfaces, types, classes, and relationships

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Dependency Graph

Engineers ยท Module dependency analysis with cycle detection

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

MetricValue
Source files362
Import edges10632
External packages1
Circular dependencies0
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:

ModuleImported By
internal/sql/format/format.go73 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Architecture Drift

Mixed audience ยท Structural changes compared to baseline snapshot

No baseline found. Run repolens publish once 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:

DimensionWhat is Tracked
ModulesNew, removed, or significantly resized modules
API EndpointsAdded or removed backend routes
DependenciesChanges to external package imports
FrameworksTechnology stack additions or removals
Circular DependenciesIncreases in dependency cycles
GraphQL SchemaType additions or removals
Codebase ScaleOverall file count changes

<!-- repolens:docs-badge --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Security Hotspots

Engineers ยท Security anti-pattern detection with CWE classification

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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples

Code Health Report

Mixed audience ยท Per-module health scores from complexity, coupling, docs, and security

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

MetricValue
Files analyzed362
Average health score94/100
Average complexity9
Hotspots (score < 60)20

Grade Distribution

GradeCountMeaning
๐ŸŸข A (80โ€“100)325Healthy โ€” low complexity, well-documented
๐Ÿ”ต B (60โ€“79)13Acceptable โ€” minor improvements possible
๐ŸŸก C (40โ€“59)19Needs attention โ€” elevated complexity or coupling
๐ŸŸ  D (20โ€“39)5At risk โ€” multiple quality signals degraded
๐Ÿ”ด F (0โ€“19)0Critical โ€” immediate refactoring recommended

Hotspots โ€” Priority Refactoring Targets

These modules have the lowest health scores and should be prioritized for improvement:

ModuleScoreGradeComplexityCouplingDoc%Security
internal/sql/astutils/rewrite.go30๐ŸŸ  D26911โ†“ 314โ†‘โ€”โ€”
internal/sql/astutils/walk.go30๐ŸŸ  D79611โ†“ 314โ†‘โ€”โ€”
internal/sql/catalog/table.go30๐ŸŸ  D11010โ†“ 315โ†‘โ€”โ€”
internal/sql/catalog/types.go31๐ŸŸ  D7110โ†“ 315โ†‘โ€”โ€”
internal/sql/preprocess/preprocess.go39๐ŸŸ  D486โ†“ 317โ†‘โ€”โ€”
internal/sql/catalog/catalog.go41๐ŸŸก C3310โ†“ 314โ†‘โ€”โ€”
internal/sql/ast/a_expr.go43๐ŸŸก C4633โ†“ 1โ†‘โ€”โ€”
internal/sql/ast/comment.go43๐ŸŸก C3833โ†“ 1โ†‘โ€”โ€”
internal/compiler/compile.go45๐ŸŸก C490โ†“ 320โ†‘โ€”โ€”
internal/compiler/expand.go45๐ŸŸก C440โ†“ 318โ†‘โ€”โ€”
internal/compiler/find_params.go45๐ŸŸก C540โ†“ 318โ†‘โ€”โ€”
internal/compiler/output_columns.go45๐ŸŸก C1900โ†“ 329โ†‘โ€”โ€”
internal/compiler/parse_core.go45๐ŸŸก C380โ†“ 329โ†‘โ€”โ€”
internal/compiler/resolve.go45๐ŸŸก C1120โ†“ 334โ†‘โ€”โ€”
internal/sql/lang/operator.go45๐ŸŸก C411โ†“ 0โ†‘โ€”โ€”
internal/sql/preprocess/scan.go45๐ŸŸก C476โ†“ 1โ†‘โ€”โ€”
internal/sql/sqlfile/split.go45๐ŸŸก C580โ†“ 0โ†‘โ€”โ€”
internal/sql/preprocess/lexer.go46๐ŸŸก C856โ†“ 0โ†‘โ€”โ€”
internal/sql/validate/insert_stmt.go47๐ŸŸก C313โ†“ 324โ†‘โ€”โ€”
internal/sql/ast/print.go51๐ŸŸก C4433โ†“ 2โ†‘โ€”โ€”

Most Complex Functions

These functions have the highest cyclomatic complexity and are the most likely sources of bugs:

FunctionFileLineComplexity
Walk()internal/sql/astutils/walk.go20796
apply()internal/sql/astutils/rewrite.go121262
resolveCatalogRefs()internal/compiler/resolve.go24111
outputColumns()internal/compiler/output_columns.go55102
Visit()internal/compiler/find_params.go5553
Split()internal/sql/sqlfile/split.go1843
sourceTables()internal/compiler/output_columns.go49335
Update()internal/sql/catalog/catalog.go4530
createTable()internal/sql/catalog/table.go25627
Format()internal/sql/ast/update_stmt.go3326
expandStmt()internal/compiler/expand.go11325
AttachComments()internal/sql/ast/comment.go12825
Format()internal/sql/ast/select_stmt.go3925
IsComparisonOperator()internal/sql/lang/operator.go524
parseQuery()internal/compiler/parse.go2222

All Modules by Health Score

Showing 50 of 362 modules (sorted worst-first)

ModuleScoreGradeLinesComplexityFan-InFan-Out
internal/sql/astutils/rewrite.go30๐ŸŸ  D127226911314
internal/sql/astutils/walk.go30๐ŸŸ  D220179611314
internal/sql/catalog/table.go30๐ŸŸ  D51211010315
internal/sql/catalog/types.go31๐ŸŸ  D3757110315
internal/sql/preprocess/preprocess.go39๐ŸŸ  D399486317
internal/sql/catalog/catalog.go41๐ŸŸก C1433310314
internal/sql/ast/a_expr.go43๐ŸŸก C17946331
internal/sql/ast/comment.go43๐ŸŸก C23638331
internal/compiler/compile.go45๐ŸŸก C301490320
internal/compiler/expand.go45๐ŸŸก C212440318
internal/compiler/find_params.go45๐ŸŸก C215540318
internal/compiler/output_columns.go45๐ŸŸก C8131900329
internal/compiler/parse_core.go45๐ŸŸก C214380329
internal/compiler/resolve.go45๐ŸŸก C6391120334
internal/sql/lang/operator.go45๐ŸŸก C644110
internal/sql/preprocess/scan.go45๐ŸŸก C2104761
internal/sql/sqlfile/split.go45๐ŸŸก C2425800
internal/sql/preprocess/lexer.go46๐ŸŸก C2858560
internal/sql/validate/insert_stmt.go47๐ŸŸก C142313324
internal/sql/ast/print.go51๐ŸŸก C27044332
internal/sql/validate/cmd.go51๐ŸŸก C89293318
internal/sql/catalog/public.go53๐ŸŸก C1342710315
internal/compiler/parse.go56๐ŸŸก C202330326
internal/compiler/analyze.go59๐ŸŸก C215320324
internal/compiler/returning.go62๐Ÿ”ต B139310314
internal/sql/catalog/schema.go65๐Ÿ”ต B1353010315
internal/sql/ast/printer/printer.go66๐Ÿ”ต B2512910
internal/sql/ast/update_stmt.go67๐Ÿ”ต B16526331
internal/compiler/engine.go68๐Ÿ”ต B2002709
internal/sql/ast/select_stmt.go68๐Ÿ”ต B18425331
internal/sql/catalog/func.go70๐Ÿ”ต B1232110315
internal/compiler/compat.go72๐Ÿ”ต B138230318
internal/sql/ast/window_def.go73๐Ÿ”ต B11720331
internal/sql/ast/bool_expr.go75๐Ÿ”ต B7118331
internal/sql/ast/def_elem.go76๐Ÿ”ต B7117331
internal/sql/ast/sql_value_function.go76๐Ÿ”ต B4217331
internal/compiler/query_catalog.go79๐Ÿ”ต B110190327
internal/sql/catalog/view.go81๐ŸŸข A531010315
internal/sql/catalog/comment_on.go82๐ŸŸข A771310315
internal/sql/ast/create_table_stmt.go85๐ŸŸข A10713331
internal/sql/astutils/join.go85๐ŸŸข A22411314
internal/sql/astutils/search.go85๐ŸŸข A22211314
internal/sql/catalog/extension.go85๐ŸŸข A42710314
internal/sql/validate/func_call.go85๐ŸŸข A4973328
internal/sql/validate/slice.go85๐ŸŸข A7193319
internal/sql/sqlpath/read.go87๐ŸŸข A671310
internal/sql/ast/delete_stmt.go91๐ŸŸข A9211331
internal/sql/ast/func_call.go91๐ŸŸข A6911331
internal/sql/ast/on_conflict_clause.go91๐ŸŸข A7611331
internal/sql/ast/type_name.go91๐ŸŸข A7711331

Scoring Methodology

The health score (0โ€“100) is computed from four dimensions:

FactorWeightHow It's Measured
Complexityโ€“1/pt above 10, โ€“2/pt above 30Cyclomatic complexity for JavaScript/TypeScript, Python, and Go (regex, not AST)
Function complexityโ€“2/pt above 8 per functionHighest complexity function in the file
Couplingโ€“1/5 units above 20Fan-in ร— Fan-out (import connections)
Documentationโ€“10 if <50%, โ€“5 if <80%JSDoc/TSDoc coverage of exports
Securityโ€“10/high, โ€“5/medium findingSecurity 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 --> ![Docs by RepoLens](https://github.com/CHAPIBUNNY/repolens) ยท Examples