Skip to content

About

Semantic code graph and topology models for static analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

code2graph

Pure domain data models and graph query abstractions for static code analysis, extracted from code2llm.

Overview

code2graph defines standard, language-agnostic data structures to represent:

  • Control Flow & Data Flow: FlowNode, FlowEdge, DataFlow, Mutation
  • Source Code Structure: ModuleInfo, ClassInfo, FunctionInfo
  • Analysis & Health: AnalysisResult, Pattern, CodeSmell
  • Graph Queries: In-memory query API to inspect call chains, entry points, and reachability.

Installation

pip install code2graph

Usage

from code2graph import AnalysisResult, FunctionInfo, FlowEdge

result = AnalysisResult(project_path=".")
func = FunctionInfo(
    name="main",
    qualified_name="app.main",
    file="app.py",
    line=1,
)
result.functions["app.main"] = func

License

Apache-2.0

About

Semantic code graph and topology models for static analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages