docs: update architecture diagrams

This commit is contained in:
Archlens Bot
2026-06-17 07:56:20 +00:00
parent fdd85011a4
commit b2ce4b4ee9
7 changed files with 467 additions and 308 deletions

View File

@@ -1,10 +1,10 @@
graph TD graph TD
Adapters[Adapters]
Application[Application]
Domain[Domain] Domain[Domain]
Adapters[Adapters]
Presentation[Presentation] Presentation[Presentation]
Presentation --> Application Application[Application]
Application --> Domain Adapters --|"24 deps"| Domain
Presentation --> Adapters Presentation --|"1 dep"| Application
Adapters --> Domain Application --|"2 deps"| Domain
Presentation --> Domain Presentation --|"11 deps"| Adapters
Presentation --|"1 dep"| Domain

View File

@@ -11,18 +11,24 @@ graph TD
archlens_stdout_writer[archlens-stdout-writer] archlens_stdout_writer[archlens-stdout-writer]
archlens_toml_config[archlens-toml-config] archlens_toml_config[archlens-toml-config]
archlens_cargo_workspace[archlens-cargo-workspace] archlens_cargo_workspace[archlens-cargo-workspace]
archlens_python_project[archlens-python-project]
archlens_d2[archlens-d2]
archlens_html[archlens-html]
end end
archlens_application --> archlens_domain archlens_application --> archlens_domain
archlens --> archlens_cargo_workspace
archlens --> archlens_walkdir
archlens --> archlens_ascii
archlens --> archlens_application
archlens --> archlens_domain
archlens --> archlens_tree_sitter archlens --> archlens_tree_sitter
archlens --> archlens_mermaid archlens --> archlens_application
archlens --> archlens_file_writer
archlens --> archlens_stdout_writer
archlens --> archlens_toml_config archlens --> archlens_toml_config
archlens --> archlens_file_writer
archlens --> archlens_ascii
archlens --> archlens_html
archlens --> archlens_walkdir
archlens --> archlens_d2
archlens --> archlens_stdout_writer
archlens --> archlens_domain
archlens --> archlens_python_project
archlens --> archlens_mermaid
archlens --> archlens_cargo_workspace
archlens_tree_sitter --> archlens_domain archlens_tree_sitter --> archlens_domain
archlens_walkdir --> archlens_domain archlens_walkdir --> archlens_domain
archlens_mermaid --> archlens_domain archlens_mermaid --> archlens_domain
@@ -31,3 +37,6 @@ graph TD
archlens_stdout_writer --> archlens_domain archlens_stdout_writer --> archlens_domain
archlens_toml_config --> archlens_domain archlens_toml_config --> archlens_domain
archlens_cargo_workspace --> archlens_domain archlens_cargo_workspace --> archlens_domain
archlens_python_project --> archlens_domain
archlens_d2 --> archlens_domain
archlens_html --> archlens_domain

View File

@@ -2,6 +2,11 @@ classDiagram
namespace Adapters { namespace Adapters {
class MermaidRenderer class MermaidRenderer
class AsciiRenderer class AsciiRenderer
class PythonProjectAnalyzer
class ProjectSection
class PoetrySection
class ToolSection
class PyprojectToml
class WalkdirDiscovery class WalkdirDiscovery
class TreeSitterAnalyzer class TreeSitterAnalyzer
class LanguageExtractor class LanguageExtractor
@@ -10,10 +15,16 @@ classDiagram
class FileOutputWriter class FileOutputWriter
class OutputPath class OutputPath
class StdoutOutputWriter class StdoutOutputWriter
class RawRules
class RawConfig class RawConfig
class RawAnalysis class RawAnalysis
class RawOutput class RawOutput
class TomlConfigLoader class TomlConfigLoader
class D2Renderer
class HtmlRenderer
class GraphData
class NodeData
class EdgeData
class CargoWorkspaceAnalyzer class CargoWorkspaceAnalyzer
class WorkspaceToml class WorkspaceToml
class WorkspaceSection class WorkspaceSection
@@ -21,33 +32,53 @@ classDiagram
class PackageSection class PackageSection
} }
MermaidRenderer : level: DiagramLevel MermaidRenderer : level: DiagramLevel
MermaidRenderer : +new() MermaidRenderer : show_weights: bool
MermaidRenderer : +with_level() MermaidRenderer : +new() -> Self
MermaidRenderer : -format_element_name() MermaidRenderer : +with_level(level: DiagramLevel) -> Self
MermaidRenderer : -format_visibility() MermaidRenderer : +with_weights(show: bool) -> Self
MermaidRenderer : -render_class_diagram() MermaidRenderer : -display_name(qualified: &str) -> &str
MermaidRenderer : -push_class_lines() MermaidRenderer : -format_element_name(element: &CodeElement) -> String
MermaidRenderer : -render_module_flowchart() MermaidRenderer : -format_visibility(visibility: Visibility) -> &'static str
MermaidRenderer : -render_project_flowchart() MermaidRenderer : -render_class_diagram(graph: &CodeGraph) -> String
MermaidRenderer : -sanitize_id() MermaidRenderer : -push_class_lines(lines: &mut Vec<String>, deferred: &mut Vec<String>, element: &CodeElement, indent: &str, in_namespace: bool)
AsciiRenderer : +new() MermaidRenderer : -render_module_flowchart(graph: &CodeGraph) -> String
AsciiRenderer : -format_kind() MermaidRenderer : -render_project_flowchart(graph: &CodeGraph) -> String
WalkdirDiscovery : +new() MermaidRenderer : -sanitize_id(name: &str) -> String
WalkdirDiscovery : -detect_language() AsciiRenderer : +new() -> Self
WalkdirDiscovery : -is_excluded() AsciiRenderer : -format_kind(element: &CodeElement) -> &'static str
PythonProjectAnalyzer : +new() -> Self
<<private>> ProjectSection
ProjectSection : name: Option
ProjectSection : dependencies: Vec
<<private>> PoetrySection
PoetrySection : name: Option
PoetrySection : dependencies: HashMap
<<private>> ToolSection
ToolSection : poetry: PoetrySection
<<private>> PyprojectToml
PyprojectToml : project: Option
PyprojectToml : tool: ToolSection
WalkdirDiscovery : +new() -> Self
WalkdirDiscovery : -detect_language(path: &Path) -> Option<Language>
WalkdirDiscovery : -is_test_file(path: &Path, language: Language) -> bool
WalkdirDiscovery : -is_excluded(path: &Path, root: &Path, excludes: &[String]) -> bool
TreeSitterAnalyzer : rust: RustExtractor TreeSitterAnalyzer : rust: RustExtractor
TreeSitterAnalyzer : python: PythonExtractor TreeSitterAnalyzer : python: PythonExtractor
TreeSitterAnalyzer : +new() TreeSitterAnalyzer : +new() -> Self
TreeSitterAnalyzer : -extractor_for() TreeSitterAnalyzer : -extractor_for(language: Language) -> Option<&dyn LanguageExtractor>
FileOutputWriter : output_path: OutputPath FileOutputWriter : output_path: OutputPath
FileOutputWriter : +new() FileOutputWriter : +new(output_dir: PathBuf) -> Self
FileOutputWriter : +single_file() FileOutputWriter : +single_file(path: PathBuf) -> Self
<<private>> OutputPath <<private>> OutputPath
StdoutOutputWriter : +new() StdoutOutputWriter : +new() -> Self
<<private>> RawRules
RawRules : allow: Vec
RawRules : deny: Vec
<<private>> RawConfig <<private>> RawConfig
RawConfig : analysis: RawAnalysis RawConfig : analysis: RawAnalysis
RawConfig : output: RawOutput RawConfig : output: RawOutput
RawConfig : modules: HashMap RawConfig : modules: HashMap
RawConfig : rules: RawRules
<<private>> RawAnalysis <<private>> RawAnalysis
RawAnalysis : exclude: Vec RawAnalysis : exclude: Vec
RawAnalysis : level: Option RawAnalysis : level: Option
@@ -56,9 +87,27 @@ classDiagram
RawOutput : path: Option RawOutput : path: Option
RawOutput : split_by_module: bool RawOutput : split_by_module: bool
TomlConfigLoader : raw: RawConfig TomlConfigLoader : raw: RawConfig
TomlConfigLoader : +from_path() TomlConfigLoader : +from_path(path: &Path) -> Result<Self, DomainError>
TomlConfigLoader : -parse_level() TomlConfigLoader : -parse_level(level: &Option<String>) -> DiagramLevel
CargoWorkspaceAnalyzer : +new() D2Renderer : level: DiagramLevel
D2Renderer : +new() -> Self
D2Renderer : +with_level(level: DiagramLevel) -> Self
HtmlRenderer : +new() -> Self
<<private>> GraphData
GraphData : nodes: Vec
GraphData : edges: Vec
<<private>> NodeData
NodeData : id: String
NodeData : label: String
NodeData : module: String
NodeData : kind: String
NodeData : fields: Vec
NodeData : methods: Vec
<<private>> EdgeData
EdgeData : source: String
EdgeData : target: String
EdgeData : kind: String
CargoWorkspaceAnalyzer : +new() -> Self
<<private>> WorkspaceToml <<private>> WorkspaceToml
WorkspaceToml : workspace: Option WorkspaceToml : workspace: Option
<<private>> WorkspaceSection <<private>> WorkspaceSection
@@ -68,6 +117,8 @@ classDiagram
MemberToml : dependencies: HashMap MemberToml : dependencies: HashMap
<<private>> PackageSection <<private>> PackageSection
PackageSection : name: String PackageSection : name: String
ToolSection --> PoetrySection
PyprojectToml --> ToolSection
TreeSitterAnalyzer --> RustExtractor TreeSitterAnalyzer --> RustExtractor
TreeSitterAnalyzer --> PythonExtractor TreeSitterAnalyzer --> PythonExtractor
RustExtractor <|-- LanguageExtractor RustExtractor <|-- LanguageExtractor
@@ -75,4 +126,12 @@ classDiagram
FileOutputWriter --> OutputPath FileOutputWriter --> OutputPath
RawConfig --> RawAnalysis RawConfig --> RawAnalysis
RawConfig --> RawOutput RawConfig --> RawOutput
RawConfig --> RawRules
TomlConfigLoader --> RawConfig TomlConfigLoader --> RawConfig
class adapters_module["Adapters"] {
<<module>>
}
class domain_module["Domain"] {
<<module>>
}
adapters_module --> domain_module : 13 deps

View File

@@ -2,29 +2,19 @@ classDiagram
namespace Application { namespace Application {
class AnalyzeCodebase class AnalyzeCodebase
class AnalyzeCodebaseResult class AnalyzeCodebaseResult
class FakeFileDiscovery
class FakeOutputWriter
class FakeDiagramRenderer
class FakeResponse
class FakeSourceAnalyzer
} }
AnalyzeCodebase : file_discovery: F AnalyzeCodebase : file_discovery: F
AnalyzeCodebase : source_analyzer: S AnalyzeCodebase : source_analyzer: S
AnalyzeCodebase : +new() AnalyzeCodebase : +new(file_discovery: F, source_analyzer: S) -> Self
AnalyzeCodebase : +execute() AnalyzeCodebase : +execute(root: &Path, config: &AnalysisConfig) -> Result<AnalyzeCodebaseResult, DomainError>
AnalyzeCodebaseResult : graph: CodeGraph AnalyzeCodebaseResult : graph: CodeGraph
AnalyzeCodebaseResult : warnings: Vec AnalyzeCodebaseResult : warnings: Vec
AnalyzeCodebaseResult : +graph() AnalyzeCodebaseResult : +graph() -> &CodeGraph
AnalyzeCodebaseResult : +warnings() AnalyzeCodebaseResult : +warnings() -> &[AnalysisWarning]
FakeFileDiscovery : files: Vec class application_module["Application"] {
FakeFileDiscovery : +new() <<module>>
FakeFileDiscovery : +empty() }
FakeOutputWriter : written: RefCell class domain_module["Domain"] {
FakeOutputWriter : +new() <<module>>
FakeOutputWriter : +written_outputs() }
FakeDiagramRenderer : +new() application_module --> domain_module : 1 dep
<<private>> FakeResponse
FakeSourceAnalyzer : results: HashMap
FakeSourceAnalyzer : +new()
FakeSourceAnalyzer : +with_result()
FakeSourceAnalyzer : +with_error()

View File

@@ -11,6 +11,9 @@ classDiagram
class RelationshipKind class RelationshipKind
class Visibility class Visibility
class CodeElementKind class CodeElementKind
class RuleKind
class RuleViolation
class BoundaryRule
class AnalysisConfig class AnalysisConfig
class AnalysisResult class AnalysisResult
class AnalysisWarning class AnalysisWarning
@@ -27,70 +30,91 @@ classDiagram
} }
OutputConfig : split_by_module: bool OutputConfig : split_by_module: bool
OutputConfig : output_path: Option OutputConfig : output_path: Option
OutputConfig : +with_split_by_module() OutputConfig : +with_split_by_module(split: bool) -> Self
OutputConfig : +with_output_path() OutputConfig : +with_output_path(path: String) -> Self
OutputConfig : +split_by_module() OutputConfig : +split_by_module() -> bool
OutputConfig : +output_path() OutputConfig : +output_path() -> Option<&str>
RenderOutput : files: Vec RenderOutput : files: Vec
RenderOutput : +new() RenderOutput : +new(files: Vec<RenderedFile>) -> Self
RenderOutput : +single() RenderOutput : +single(file: RenderedFile) -> Self
RenderOutput : +files() RenderOutput : +files() -> &[RenderedFile]
RenderedFile : name: String RenderedFile : name: String
RenderedFile : content: String RenderedFile : content: String
RenderedFile : +new() RenderedFile : +new(name: &str, content: &str) -> Result<Self, DomainError>
RenderedFile : +name() RenderedFile : +name() -> &str
RenderedFile : +content() RenderedFile : +content() -> &str
SourceFile : path: FilePath SourceFile : path: FilePath
SourceFile : language: Language SourceFile : language: Language
SourceFile : +new() SourceFile : +new(path: FilePath, language: Language) -> Self
SourceFile : +path() SourceFile : +path() -> &FilePath
SourceFile : +language() SourceFile : +language() -> Language
ModuleName : +new() ModuleName : +new(value: &str) -> Result<Self, DomainError>
ModuleName : +from_path() ModuleName : +from_path(file_path: &str, root: &Path, module_mappings: &HashMap<String, String>) -> Option<Self>
ModuleName : +from_directory_group() ModuleName : +from_directory_group(member_path: &str) -> Option<Self>
ModuleName : +capitalize() ModuleName : +capitalize(s: &str) -> String
ModuleName : +as_str() ModuleName : +as_str() -> &str
Language : +name() Language : +name() -> &'static str
FilePath : +new() FilePath : +new(value: &str) -> Result<Self, DomainError>
FilePath : +as_str() FilePath : +as_str() -> &str
RuleViolation : source_module: String
RuleViolation : target_module: String
RuleViolation : kind: RuleKind
RuleViolation : +new(source_module: &str, target_module: &str, kind: RuleKind) -> Self
RuleViolation : +source_module() -> &str
RuleViolation : +target_module() -> &str
RuleViolation : +kind() -> &RuleKind
RuleViolation : +message() -> String
BoundaryRule : source: String
BoundaryRule : target: String
BoundaryRule : +parse(s: &str) -> Option<Self>
BoundaryRule : +source() -> &str
BoundaryRule : +target() -> &str
BoundaryRule : +matches(src_module: &str, tgt_module: &str) -> bool
AnalysisConfig : excludes: Vec AnalysisConfig : excludes: Vec
AnalysisConfig : level: DiagramLevel AnalysisConfig : level: DiagramLevel
AnalysisConfig : module_mappings: HashMap AnalysisConfig : module_mappings: HashMap
AnalysisConfig : scope: Option AnalysisConfig : scope: Option
AnalysisConfig : +with_excludes() AnalysisConfig : include_tests: bool
AnalysisConfig : +with_level() AnalysisConfig : changed_files: Option
AnalysisConfig : +with_module_mappings() AnalysisConfig : +with_excludes(excludes: Vec<String>) -> Self
AnalysisConfig : +excludes() AnalysisConfig : +with_level(level: DiagramLevel) -> Self
AnalysisConfig : +level() AnalysisConfig : +with_module_mappings(mappings: HashMap<String, String>) -> Self
AnalysisConfig : +with_scope() AnalysisConfig : +excludes() -> &[String]
AnalysisConfig : +module_mappings() AnalysisConfig : +level() -> DiagramLevel
AnalysisConfig : +scope() AnalysisConfig : +with_scope(scope: String) -> Self
AnalysisConfig : +module_mappings() -> &HashMap<String, String>
AnalysisConfig : +scope() -> Option<&str>
AnalysisConfig : +with_include_tests(include: bool) -> Self
AnalysisConfig : +include_tests() -> bool
AnalysisConfig : +with_changed_files(files: HashSet<String>) -> Self
AnalysisConfig : +changed_files() -> Option<&HashSet<String>>
AnalysisResult : elements: Vec AnalysisResult : elements: Vec
AnalysisResult : relationships: Vec AnalysisResult : relationships: Vec
AnalysisResult : warnings: Vec AnalysisResult : warnings: Vec
AnalysisResult : +new() AnalysisResult : +new(elements: Vec<CodeElement>, relationships: Vec<Relationship>, warnings: Vec<AnalysisWarning>) -> Self
AnalysisResult : +empty() AnalysisResult : +empty() -> Self
AnalysisResult : +elements() AnalysisResult : +elements() -> &[CodeElement]
AnalysisResult : +relationships() AnalysisResult : +relationships() -> &[Relationship]
AnalysisResult : +warnings() AnalysisResult : +warnings() -> &[AnalysisWarning]
AnalysisWarning : file_path: FilePath AnalysisWarning : file_path: FilePath
AnalysisWarning : line: usize AnalysisWarning : line: usize
AnalysisWarning : message: String AnalysisWarning : message: String
AnalysisWarning : +new() AnalysisWarning : +new(file_path: FilePath, line: usize, message: &str) -> Result<Self, DomainError>
AnalysisWarning : +file_path() AnalysisWarning : +file_path() -> &FilePath
AnalysisWarning : +line() AnalysisWarning : +line() -> usize
AnalysisWarning : +message() AnalysisWarning : +message() -> &str
Relationship : source: String Relationship : source: String
Relationship : target: String Relationship : target: String
Relationship : kind: RelationshipKind Relationship : kind: RelationshipKind
Relationship : source_file: Option Relationship : source_file: Option
Relationship : +new() Relationship : +new(source: &str, target: &str, kind: RelationshipKind) -> Result<Self, DomainError>
Relationship : +with_source_file() Relationship : +with_source_file(file: FilePath) -> Self
Relationship : +source() Relationship : +source() -> &str
Relationship : +target() Relationship : +target() -> &str
Relationship : +kind() Relationship : +kind() -> RelationshipKind
Relationship : +source_file() Relationship : +source_file() -> Option<&FilePath>
CodeElement : name: String CodeElement : name: String
CodeElement : qualified_name: Option
CodeElement : kind: CodeElementKind CodeElement : kind: CodeElementKind
CodeElement : file_path: FilePath CodeElement : file_path: FilePath
CodeElement : line: usize CodeElement : line: usize
@@ -100,37 +124,42 @@ classDiagram
CodeElement : attributes: Vec CodeElement : attributes: Vec
CodeElement : fields: Vec CodeElement : fields: Vec
CodeElement : methods: Vec CodeElement : methods: Vec
CodeElement : +new() CodeElement : +new(name: &str, kind: CodeElementKind, file_path: FilePath, line: usize) -> Result<Self, DomainError>
CodeElement : +with_visibility() CodeElement : +with_visibility(visibility: Visibility) -> Self
CodeElement : +with_module() CodeElement : +with_module(module: ModuleName) -> Self
CodeElement : +with_generics() CodeElement : +with_generics(generics: Vec<String>) -> Self
CodeElement : +with_attributes() CodeElement : +with_attributes(attributes: Vec<String>) -> Self
CodeElement : +name() CodeElement : +with_qualified_name(qn: String) -> Self
CodeElement : +kind() CodeElement : +name() -> &str
CodeElement : +file_path() CodeElement : +qualified_name() -> &str
CodeElement : +line() CodeElement : +kind() -> CodeElementKind
CodeElement : +visibility() CodeElement : +file_path() -> &FilePath
CodeElement : +module() CodeElement : +line() -> usize
CodeElement : +generics() CodeElement : +visibility() -> Visibility
CodeElement : +attributes() CodeElement : +module() -> Option<&ModuleName>
CodeElement : +with_fields() CodeElement : +generics() -> &[String]
CodeElement : +with_methods() CodeElement : +attributes() -> &[String]
CodeElement : +fields() CodeElement : +with_fields(fields: Vec<String>) -> Self
CodeElement : +methods() CodeElement : +with_methods(methods: Vec<String>) -> Self
CodeElement : +fields() -> &[String]
CodeElement : +methods() -> &[String]
CodeGraph : elements: Vec CodeGraph : elements: Vec
CodeGraph : relationships: Vec CodeGraph : relationships: Vec
CodeGraph : +new() CodeGraph : +new() -> Self
CodeGraph : +add_element() CodeGraph : +add_element(element: CodeElement)
CodeGraph : +add_relationship() CodeGraph : +add_relationship(relationship: Relationship)
CodeGraph : +elements() CodeGraph : +elements() -> &[CodeElement]
CodeGraph : +relationships() CodeGraph : +relationships() -> &[Relationship]
CodeGraph : +modules() CodeGraph : +modules() -> Vec<ModuleName>
CodeGraph : +elements_by_module() CodeGraph : +elements_by_module() -> (HashMap<String, Vec<&CodeElement>>, Vec<&CodeElement>)
CodeGraph : +resolve_relationships() CodeGraph : +resolve_relationships() -> CodeGraph
CodeGraph : +filter_external_imports() CodeGraph : +filter_external_imports(known_modules: &HashSet<String>) -> CodeGraph
CodeGraph : +subgraph_by_module() CodeGraph : +qualify() -> CodeGraph
CodeGraph : +cross_module_deps_for(module: &ModuleName) -> Vec<(ModuleName, usize)>
CodeGraph : +subgraph_by_module(module: &ModuleName) -> CodeGraph
SourceFile --> FilePath SourceFile --> FilePath
SourceFile --> Language SourceFile --> Language
RuleViolation --> RuleKind
AnalysisConfig --> DiagramLevel AnalysisConfig --> DiagramLevel
AnalysisWarning --> FilePath AnalysisWarning --> FilePath
Relationship --> RelationshipKind Relationship --> RelationshipKind

View File

@@ -1,4 +1,36 @@
classDiagram classDiagram
namespace Adapters {
class MermaidRenderer
class AsciiRenderer
class PythonProjectAnalyzer
class ProjectSection
class PoetrySection
class ToolSection
class PyprojectToml
class WalkdirDiscovery
class TreeSitterAnalyzer
class LanguageExtractor
class RustExtractor
class PythonExtractor
class FileOutputWriter
class OutputPath
class StdoutOutputWriter
class RawRules
class RawConfig
class RawAnalysis
class RawOutput
class TomlConfigLoader
class D2Renderer
class HtmlRenderer
class GraphData
class NodeData
class EdgeData
class CargoWorkspaceAnalyzer
class WorkspaceToml
class WorkspaceSection
class MemberToml
class PackageSection
}
namespace Domain { namespace Domain {
class OutputConfig class OutputConfig
class DiagramLevel class DiagramLevel
@@ -11,6 +43,9 @@ classDiagram
class RelationshipKind class RelationshipKind
class Visibility class Visibility
class CodeElementKind class CodeElementKind
class RuleKind
class RuleViolation
class BoundaryRule
class AnalysisConfig class AnalysisConfig
class AnalysisResult class AnalysisResult
class AnalysisWarning class AnalysisWarning
@@ -28,189 +63,59 @@ classDiagram
namespace Application { namespace Application {
class AnalyzeCodebase class AnalyzeCodebase
class AnalyzeCodebaseResult class AnalyzeCodebaseResult
class FakeFileDiscovery
class FakeOutputWriter
class FakeDiagramRenderer
class FakeResponse
class FakeSourceAnalyzer
}
namespace Adapters {
class MermaidRenderer
class AsciiRenderer
class WalkdirDiscovery
class TreeSitterAnalyzer
class LanguageExtractor
class RustExtractor
class PythonExtractor
class FileOutputWriter
class OutputPath
class StdoutOutputWriter
class RawConfig
class RawAnalysis
class RawOutput
class TomlConfigLoader
class CargoWorkspaceAnalyzer
class WorkspaceToml
class WorkspaceSection
class MemberToml
class PackageSection
} }
namespace Presentation { namespace Presentation {
class Cli class Cli
class Command class Command
} }
OutputConfig : split_by_module: bool
OutputConfig : output_path: Option
OutputConfig : +with_split_by_module()
OutputConfig : +with_output_path()
OutputConfig : +split_by_module()
OutputConfig : +output_path()
RenderOutput : files: Vec
RenderOutput : +new()
RenderOutput : +single()
RenderOutput : +files()
RenderedFile : name: String
RenderedFile : content: String
RenderedFile : +new()
RenderedFile : +name()
RenderedFile : +content()
SourceFile : path: FilePath
SourceFile : language: Language
SourceFile : +new()
SourceFile : +path()
SourceFile : +language()
ModuleName : +new()
ModuleName : +from_path()
ModuleName : +from_directory_group()
ModuleName : +capitalize()
ModuleName : +as_str()
Language : +name()
FilePath : +new()
FilePath : +as_str()
AnalysisConfig : excludes: Vec
AnalysisConfig : level: DiagramLevel
AnalysisConfig : module_mappings: HashMap
AnalysisConfig : scope: Option
AnalysisConfig : +with_excludes()
AnalysisConfig : +with_level()
AnalysisConfig : +with_module_mappings()
AnalysisConfig : +excludes()
AnalysisConfig : +level()
AnalysisConfig : +with_scope()
AnalysisConfig : +module_mappings()
AnalysisConfig : +scope()
AnalysisResult : elements: Vec
AnalysisResult : relationships: Vec
AnalysisResult : warnings: Vec
AnalysisResult : +new()
AnalysisResult : +empty()
AnalysisResult : +elements()
AnalysisResult : +relationships()
AnalysisResult : +warnings()
AnalysisWarning : file_path: FilePath
AnalysisWarning : line: usize
AnalysisWarning : message: String
AnalysisWarning : +new()
AnalysisWarning : +file_path()
AnalysisWarning : +line()
AnalysisWarning : +message()
Relationship : source: String
Relationship : target: String
Relationship : kind: RelationshipKind
Relationship : source_file: Option
Relationship : +new()
Relationship : +with_source_file()
Relationship : +source()
Relationship : +target()
Relationship : +kind()
Relationship : +source_file()
CodeElement : name: String
CodeElement : kind: CodeElementKind
CodeElement : file_path: FilePath
CodeElement : line: usize
CodeElement : visibility: Visibility
CodeElement : module: Option
CodeElement : generics: Vec
CodeElement : attributes: Vec
CodeElement : fields: Vec
CodeElement : methods: Vec
CodeElement : +new()
CodeElement : +with_visibility()
CodeElement : +with_module()
CodeElement : +with_generics()
CodeElement : +with_attributes()
CodeElement : +name()
CodeElement : +kind()
CodeElement : +file_path()
CodeElement : +line()
CodeElement : +visibility()
CodeElement : +module()
CodeElement : +generics()
CodeElement : +attributes()
CodeElement : +with_fields()
CodeElement : +with_methods()
CodeElement : +fields()
CodeElement : +methods()
CodeGraph : elements: Vec
CodeGraph : relationships: Vec
CodeGraph : +new()
CodeGraph : +add_element()
CodeGraph : +add_relationship()
CodeGraph : +elements()
CodeGraph : +relationships()
CodeGraph : +modules()
CodeGraph : +elements_by_module()
CodeGraph : +resolve_relationships()
CodeGraph : +filter_external_imports()
CodeGraph : +subgraph_by_module()
AnalyzeCodebase : file_discovery: F
AnalyzeCodebase : source_analyzer: S
AnalyzeCodebase : +new()
AnalyzeCodebase : +execute()
AnalyzeCodebaseResult : graph: CodeGraph
AnalyzeCodebaseResult : warnings: Vec
AnalyzeCodebaseResult : +graph()
AnalyzeCodebaseResult : +warnings()
FakeFileDiscovery : files: Vec
FakeFileDiscovery : +new()
FakeFileDiscovery : +empty()
FakeOutputWriter : written: RefCell
FakeOutputWriter : +new()
FakeOutputWriter : +written_outputs()
FakeDiagramRenderer : +new()
<<private>> FakeResponse
FakeSourceAnalyzer : results: HashMap
FakeSourceAnalyzer : +new()
FakeSourceAnalyzer : +with_result()
FakeSourceAnalyzer : +with_error()
MermaidRenderer : level: DiagramLevel MermaidRenderer : level: DiagramLevel
MermaidRenderer : +new() MermaidRenderer : show_weights: bool
MermaidRenderer : +with_level() MermaidRenderer : +new() -> Self
MermaidRenderer : -format_element_name() MermaidRenderer : +with_level(level: DiagramLevel) -> Self
MermaidRenderer : -format_visibility() MermaidRenderer : +with_weights(show: bool) -> Self
MermaidRenderer : -render_class_diagram() MermaidRenderer : -display_name(qualified: &str) -> &str
MermaidRenderer : -push_class_lines() MermaidRenderer : -format_element_name(element: &CodeElement) -> String
MermaidRenderer : -render_module_flowchart() MermaidRenderer : -format_visibility(visibility: Visibility) -> &'static str
MermaidRenderer : -render_project_flowchart() MermaidRenderer : -render_class_diagram(graph: &CodeGraph) -> String
MermaidRenderer : -sanitize_id() MermaidRenderer : -push_class_lines(lines: &mut Vec<String>, deferred: &mut Vec<String>, element: &CodeElement, indent: &str, in_namespace: bool)
AsciiRenderer : +new() MermaidRenderer : -render_module_flowchart(graph: &CodeGraph) -> String
AsciiRenderer : -format_kind() MermaidRenderer : -render_project_flowchart(graph: &CodeGraph) -> String
WalkdirDiscovery : +new() MermaidRenderer : -sanitize_id(name: &str) -> String
WalkdirDiscovery : -detect_language() AsciiRenderer : +new() -> Self
WalkdirDiscovery : -is_excluded() AsciiRenderer : -format_kind(element: &CodeElement) -> &'static str
PythonProjectAnalyzer : +new() -> Self
<<private>> ProjectSection
ProjectSection : name: Option
ProjectSection : dependencies: Vec
<<private>> PoetrySection
PoetrySection : name: Option
PoetrySection : dependencies: HashMap
<<private>> ToolSection
ToolSection : poetry: PoetrySection
<<private>> PyprojectToml
PyprojectToml : project: Option
PyprojectToml : tool: ToolSection
WalkdirDiscovery : +new() -> Self
WalkdirDiscovery : -detect_language(path: &Path) -> Option<Language>
WalkdirDiscovery : -is_test_file(path: &Path, language: Language) -> bool
WalkdirDiscovery : -is_excluded(path: &Path, root: &Path, excludes: &[String]) -> bool
TreeSitterAnalyzer : rust: RustExtractor TreeSitterAnalyzer : rust: RustExtractor
TreeSitterAnalyzer : python: PythonExtractor TreeSitterAnalyzer : python: PythonExtractor
TreeSitterAnalyzer : +new() TreeSitterAnalyzer : +new() -> Self
TreeSitterAnalyzer : -extractor_for() TreeSitterAnalyzer : -extractor_for(language: Language) -> Option<&dyn LanguageExtractor>
FileOutputWriter : output_path: OutputPath FileOutputWriter : output_path: OutputPath
FileOutputWriter : +new() FileOutputWriter : +new(output_dir: PathBuf) -> Self
FileOutputWriter : +single_file() FileOutputWriter : +single_file(path: PathBuf) -> Self
<<private>> OutputPath <<private>> OutputPath
StdoutOutputWriter : +new() StdoutOutputWriter : +new() -> Self
<<private>> RawRules
RawRules : allow: Vec
RawRules : deny: Vec
<<private>> RawConfig <<private>> RawConfig
RawConfig : analysis: RawAnalysis RawConfig : analysis: RawAnalysis
RawConfig : output: RawOutput RawConfig : output: RawOutput
RawConfig : modules: HashMap RawConfig : modules: HashMap
RawConfig : rules: RawRules
<<private>> RawAnalysis <<private>> RawAnalysis
RawAnalysis : exclude: Vec RawAnalysis : exclude: Vec
RawAnalysis : level: Option RawAnalysis : level: Option
@@ -219,9 +124,27 @@ classDiagram
RawOutput : path: Option RawOutput : path: Option
RawOutput : split_by_module: bool RawOutput : split_by_module: bool
TomlConfigLoader : raw: RawConfig TomlConfigLoader : raw: RawConfig
TomlConfigLoader : +from_path() TomlConfigLoader : +from_path(path: &Path) -> Result<Self, DomainError>
TomlConfigLoader : -parse_level() TomlConfigLoader : -parse_level(level: &Option<String>) -> DiagramLevel
CargoWorkspaceAnalyzer : +new() D2Renderer : level: DiagramLevel
D2Renderer : +new() -> Self
D2Renderer : +with_level(level: DiagramLevel) -> Self
HtmlRenderer : +new() -> Self
<<private>> GraphData
GraphData : nodes: Vec
GraphData : edges: Vec
<<private>> NodeData
NodeData : id: String
NodeData : label: String
NodeData : module: String
NodeData : kind: String
NodeData : fields: Vec
NodeData : methods: Vec
<<private>> EdgeData
EdgeData : source: String
EdgeData : target: String
EdgeData : kind: String
CargoWorkspaceAnalyzer : +new() -> Self
<<private>> WorkspaceToml <<private>> WorkspaceToml
WorkspaceToml : workspace: Option WorkspaceToml : workspace: Option
<<private>> WorkspaceSection <<private>> WorkspaceSection
@@ -231,6 +154,143 @@ classDiagram
MemberToml : dependencies: HashMap MemberToml : dependencies: HashMap
<<private>> PackageSection <<private>> PackageSection
PackageSection : name: String PackageSection : name: String
OutputConfig : split_by_module: bool
OutputConfig : output_path: Option
OutputConfig : +with_split_by_module(split: bool) -> Self
OutputConfig : +with_output_path(path: String) -> Self
OutputConfig : +split_by_module() -> bool
OutputConfig : +output_path() -> Option<&str>
RenderOutput : files: Vec
RenderOutput : +new(files: Vec<RenderedFile>) -> Self
RenderOutput : +single(file: RenderedFile) -> Self
RenderOutput : +files() -> &[RenderedFile]
RenderedFile : name: String
RenderedFile : content: String
RenderedFile : +new(name: &str, content: &str) -> Result<Self, DomainError>
RenderedFile : +name() -> &str
RenderedFile : +content() -> &str
SourceFile : path: FilePath
SourceFile : language: Language
SourceFile : +new(path: FilePath, language: Language) -> Self
SourceFile : +path() -> &FilePath
SourceFile : +language() -> Language
ModuleName : +new(value: &str) -> Result<Self, DomainError>
ModuleName : +from_path(file_path: &str, root: &Path, module_mappings: &HashMap<String, String>) -> Option<Self>
ModuleName : +from_directory_group(member_path: &str) -> Option<Self>
ModuleName : +capitalize(s: &str) -> String
ModuleName : +as_str() -> &str
Language : +name() -> &'static str
FilePath : +new(value: &str) -> Result<Self, DomainError>
FilePath : +as_str() -> &str
RuleViolation : source_module: String
RuleViolation : target_module: String
RuleViolation : kind: RuleKind
RuleViolation : +new(source_module: &str, target_module: &str, kind: RuleKind) -> Self
RuleViolation : +source_module() -> &str
RuleViolation : +target_module() -> &str
RuleViolation : +kind() -> &RuleKind
RuleViolation : +message() -> String
BoundaryRule : source: String
BoundaryRule : target: String
BoundaryRule : +parse(s: &str) -> Option<Self>
BoundaryRule : +source() -> &str
BoundaryRule : +target() -> &str
BoundaryRule : +matches(src_module: &str, tgt_module: &str) -> bool
AnalysisConfig : excludes: Vec
AnalysisConfig : level: DiagramLevel
AnalysisConfig : module_mappings: HashMap
AnalysisConfig : scope: Option
AnalysisConfig : include_tests: bool
AnalysisConfig : changed_files: Option
AnalysisConfig : +with_excludes(excludes: Vec<String>) -> Self
AnalysisConfig : +with_level(level: DiagramLevel) -> Self
AnalysisConfig : +with_module_mappings(mappings: HashMap<String, String>) -> Self
AnalysisConfig : +excludes() -> &[String]
AnalysisConfig : +level() -> DiagramLevel
AnalysisConfig : +with_scope(scope: String) -> Self
AnalysisConfig : +module_mappings() -> &HashMap<String, String>
AnalysisConfig : +scope() -> Option<&str>
AnalysisConfig : +with_include_tests(include: bool) -> Self
AnalysisConfig : +include_tests() -> bool
AnalysisConfig : +with_changed_files(files: HashSet<String>) -> Self
AnalysisConfig : +changed_files() -> Option<&HashSet<String>>
AnalysisResult : elements: Vec
AnalysisResult : relationships: Vec
AnalysisResult : warnings: Vec
AnalysisResult : +new(elements: Vec<CodeElement>, relationships: Vec<Relationship>, warnings: Vec<AnalysisWarning>) -> Self
AnalysisResult : +empty() -> Self
AnalysisResult : +elements() -> &[CodeElement]
AnalysisResult : +relationships() -> &[Relationship]
AnalysisResult : +warnings() -> &[AnalysisWarning]
AnalysisWarning : file_path: FilePath
AnalysisWarning : line: usize
AnalysisWarning : message: String
AnalysisWarning : +new(file_path: FilePath, line: usize, message: &str) -> Result<Self, DomainError>
AnalysisWarning : +file_path() -> &FilePath
AnalysisWarning : +line() -> usize
AnalysisWarning : +message() -> &str
Relationship : source: String
Relationship : target: String
Relationship : kind: RelationshipKind
Relationship : source_file: Option
Relationship : +new(source: &str, target: &str, kind: RelationshipKind) -> Result<Self, DomainError>
Relationship : +with_source_file(file: FilePath) -> Self
Relationship : +source() -> &str
Relationship : +target() -> &str
Relationship : +kind() -> RelationshipKind
Relationship : +source_file() -> Option<&FilePath>
CodeElement : name: String
CodeElement : qualified_name: Option
CodeElement : kind: CodeElementKind
CodeElement : file_path: FilePath
CodeElement : line: usize
CodeElement : visibility: Visibility
CodeElement : module: Option
CodeElement : generics: Vec
CodeElement : attributes: Vec
CodeElement : fields: Vec
CodeElement : methods: Vec
CodeElement : +new(name: &str, kind: CodeElementKind, file_path: FilePath, line: usize) -> Result<Self, DomainError>
CodeElement : +with_visibility(visibility: Visibility) -> Self
CodeElement : +with_module(module: ModuleName) -> Self
CodeElement : +with_generics(generics: Vec<String>) -> Self
CodeElement : +with_attributes(attributes: Vec<String>) -> Self
CodeElement : +with_qualified_name(qn: String) -> Self
CodeElement : +name() -> &str
CodeElement : +qualified_name() -> &str
CodeElement : +kind() -> CodeElementKind
CodeElement : +file_path() -> &FilePath
CodeElement : +line() -> usize
CodeElement : +visibility() -> Visibility
CodeElement : +module() -> Option<&ModuleName>
CodeElement : +generics() -> &[String]
CodeElement : +attributes() -> &[String]
CodeElement : +with_fields(fields: Vec<String>) -> Self
CodeElement : +with_methods(methods: Vec<String>) -> Self
CodeElement : +fields() -> &[String]
CodeElement : +methods() -> &[String]
CodeGraph : elements: Vec
CodeGraph : relationships: Vec
CodeGraph : +new() -> Self
CodeGraph : +add_element(element: CodeElement)
CodeGraph : +add_relationship(relationship: Relationship)
CodeGraph : +elements() -> &[CodeElement]
CodeGraph : +relationships() -> &[Relationship]
CodeGraph : +modules() -> Vec<ModuleName>
CodeGraph : +elements_by_module() -> (HashMap<String, Vec<&CodeElement>>, Vec<&CodeElement>)
CodeGraph : +resolve_relationships() -> CodeGraph
CodeGraph : +filter_external_imports(known_modules: &HashSet<String>) -> CodeGraph
CodeGraph : +qualify() -> CodeGraph
CodeGraph : +cross_module_deps_for(module: &ModuleName) -> Vec<(ModuleName, usize)>
CodeGraph : +subgraph_by_module(module: &ModuleName) -> CodeGraph
AnalyzeCodebase : file_discovery: F
AnalyzeCodebase : source_analyzer: S
AnalyzeCodebase : +new(file_discovery: F, source_analyzer: S) -> Self
AnalyzeCodebase : +execute(root: &Path, config: &AnalysisConfig) -> Result<AnalyzeCodebaseResult, DomainError>
AnalyzeCodebaseResult : graph: CodeGraph
AnalyzeCodebaseResult : warnings: Vec
AnalyzeCodebaseResult : +graph() -> &CodeGraph
AnalyzeCodebaseResult : +warnings() -> &[AnalysisWarning]
Cli : command: Option Cli : command: Option
Cli : path: PathBuf Cli : path: PathBuf
Cli : level: String Cli : level: String
@@ -239,12 +299,17 @@ classDiagram
Cli : config: Option Cli : config: Option
Cli : scope: Option Cli : scope: Option
Cli : exclude: Vec Cli : exclude: Vec
Cli : include_tests: bool
Cli : no_weights: bool
Cli : watch: bool
Cli : since: Option
Cli : split_by_module: bool Cli : split_by_module: bool
Cli : strict: bool Cli : strict: bool
Cli : check: bool Cli : check: bool
Cli : verbose: u8 Cli : verbose: u8
SourceFile --> FilePath SourceFile --> FilePath
SourceFile --> Language SourceFile --> Language
RuleViolation --> RuleKind
AnalysisConfig --> DiagramLevel AnalysisConfig --> DiagramLevel
AnalysisWarning --> FilePath AnalysisWarning --> FilePath
Relationship --> RelationshipKind Relationship --> RelationshipKind
@@ -254,6 +319,9 @@ classDiagram
MermaidRenderer --> DiagramLevel MermaidRenderer --> DiagramLevel
MermaidRenderer <|-- DiagramRenderer MermaidRenderer <|-- DiagramRenderer
AsciiRenderer <|-- DiagramRenderer AsciiRenderer <|-- DiagramRenderer
ToolSection --> PoetrySection
PyprojectToml --> ToolSection
PythonProjectAnalyzer <|-- ProjectAnalyzer
WalkdirDiscovery <|-- FileDiscovery WalkdirDiscovery <|-- FileDiscovery
TreeSitterAnalyzer --> RustExtractor TreeSitterAnalyzer --> RustExtractor
TreeSitterAnalyzer --> PythonExtractor TreeSitterAnalyzer --> PythonExtractor
@@ -265,11 +333,11 @@ classDiagram
StdoutOutputWriter <|-- OutputWriter StdoutOutputWriter <|-- OutputWriter
RawConfig --> RawAnalysis RawConfig --> RawAnalysis
RawConfig --> RawOutput RawConfig --> RawOutput
RawConfig --> RawRules
TomlConfigLoader --> RawConfig TomlConfigLoader --> RawConfig
TomlConfigLoader <|-- ConfigLoader TomlConfigLoader <|-- ConfigLoader
D2Renderer --> DiagramLevel
D2Renderer <|-- DiagramRenderer
HtmlRenderer <|-- DiagramRenderer
CargoWorkspaceAnalyzer <|-- ProjectAnalyzer CargoWorkspaceAnalyzer <|-- ProjectAnalyzer
AnalyzeCodebaseResult --> CodeGraph AnalyzeCodebaseResult --> CodeGraph
FakeFileDiscovery <|-- FileDiscovery
FakeOutputWriter <|-- OutputWriter
FakeDiagramRenderer <|-- DiagramRenderer
FakeSourceAnalyzer <|-- SourceAnalyzer

View File

@@ -11,6 +11,10 @@ classDiagram
Cli : config: Option Cli : config: Option
Cli : scope: Option Cli : scope: Option
Cli : exclude: Vec Cli : exclude: Vec
Cli : include_tests: bool
Cli : no_weights: bool
Cli : watch: bool
Cli : since: Option
Cli : split_by_module: bool Cli : split_by_module: bool
Cli : strict: bool Cli : strict: bool
Cli : check: bool Cli : check: bool