🐱 About the Author
As a Japanese individual developer, I develop software from an artist's perspective

CodeGarden
JavaScript/TypeScript Code Visualizer
Introduction
CodeGarden is a desktop application that provides a bird's-eye view and analysis of JavaScript/TypeScript source structure through "stars and lines" visualization. Functions and blocks are drawn as nodes, while hierarchy and call relationships are expressed as edges. You can quickly find design and refactoring insights by switching between multiple render patterns and visual styles.
Quick Start
- Launch the app and click Open File in the top left, or drag and drop a JavaScript/TypeScript source file.
- Select Analyzer (Basic / CallGraph / MetricsExt / MultiLang / Category-Aware) and Render Pattern as needed.
- Use drag (move), wheel (zoom), and double-click (select & code display) on the canvas to explore.
Source Viewer Function

Source Viewer - Detailed function definition display

Source Viewer - Error handling section display

Actual CodeGarden application screen - Left control panel and right code visualization
Various Application Screens

Category-Aware Analysis

Pastel Style

Grid/Depth Pattern
Screen Layout
📱 Actual Application Screens
Main Screen

Left control panel and right code visualization
Star Density Function

Star Density slider for node density adjustment
Sidebar
- Controls: Open File / Save JSON / Reset View / Analyzer / Render Pattern / Visual Style
- Summary: File path, line count, function count, maximum depth
- Selection Summary: Statistics for selected node group (line count, cc, nest, score total, maximum depth, etc.)
- Documents: Various documents (XML specification/render pattern guide)
- Language: English / Japanese / Korean / Chinese / German / Hindi switch
Canvas
- Nodes and edges are drawn on a white starry background.
- When selected, labels and meta information (cc/nest/lines/score) are displayed.
- Selected subtrees are faintly highlighted, making the whole easier to follow.
Operations and Controls
File Operations
- Open File: Opens JS/TS files for analysis.
- Drag & Drop: Also works by dragging and dropping to the left pane.
- Save JSON: Saves current analysis results as JSON.
View Operations
- Reset View: Resets camera to center and 1:1 scale.
- Esc: Deselect. Double-click: Subtree selection & code display.
Node Density Adjustment
- Star Density: Can adjust the density of stars (nodes).
- Dense: Densify stars to display many information in limited space.
- Normal: Standard density for balance between visibility and information amount.
- Sparse: Distribute stars to display each node larger and check details more easily.

Star Density slider for dynamic node density adjustment
Analysis and Rendering
- Analyzer:
- Basic: Structure and complexity (cc/nest, etc.). Performs basic AST analysis, calculates hierarchy structure and complexity (cyclomatic complexity, nesting depth) for functions, classes, and blocks. Most lightweight and fast analysis. Also includes language detection and category determination.
- CallGraph: Function call relationships. Analyzes call relationships between functions and constructs dependency graphs. Provides metrics such as in-degree/out-degree, fan-in/fan-out for functions. Generates both hierarchy edges and call edges.
- MetricsExt: Detailed metrics like statements and branches. Calculates detailed metrics such as statement count, branch count, loop count, return statement count, exception handling count, switch statement count, etc. Converts code quality indicators to numerical form. Also detects language-specific syntax elements.
- MultiLang: Performs TypeScript support analysis, properly recognizes TypeScript-specific syntax elements (interfaces, generics, decorators, enums, type aliases, etc.). Supports language characteristics of both JavaScript and TypeScript.
- Category-Aware: Performs category-aware smart analysis, providing analysis results while considering node importance and relationships. Includes automatic calculation of category statistics and JavaScript/TypeScript-specific category mapping.
- Render Pattern: v1..v10 arrangement (described later).
- Visual Style: v1..v4 color, shape, and line representation (described later).
- Layout insights: The sidebar surfaces the current render pattern, selected analyzer, and star density after each change—handy for quick reviews or sharing presets with teammates.
- Layout presets: Three presets (Overview / CallGraph / Category) apply analyzer, render pattern, visual style, and density in one click. When a file is already loaded, the preset re-runs the appropriate analysis automatically.
- Extended metrics: Technical debt and code smell summary cards appear with drill-down lists that match the Quality Report. Each item shows the contributing issues for fast remediation.
- Call Graph panel: Appears when CallGraph data is available, listing up to 20 call relationships (callee, caller, line) in a sortable table for quick dependency inspection.
Recommended Layouts

Overview - Emphasize complexity and extended metrics

CallGraph - Highlight call relationships with a force layout

Category - Category bands and grouping
📊 Overview
- Analyzer: MetricsExt
- Pattern: v7 Sunburst
- Style: v2 Warm
- Use: Emphasize complexity and extended metrics
🔗 CallGraph
- Analyzer: CallGraph
- Pattern: v10 Call-focused
- Style: v3 High Contrast
- Use: Visualize call dependencies
🏷️ Category
- Analyzer: Category-Aware
- Pattern: v9 Category bands
- Style: v4 Pastel
- Use: Emphasize category grouping
Extended Metrics

Technical debt and code smells summary

Detailed issue list with severities
Documents

Sidebar Documents section

Manual language selection (6 languages)
Selection Summary

Shows nodes/functions/lines, avg cc/nest, score sum, max depth
Render Patterns (v1..v13)
Below is a summary of key points. For details, please refer to "Render Pattern Spec" in the app.
Basic Patterns
v1 Radial
Optimal for overall overview. Compact skeleton.
v2 Concentric Circles
Arranges layers by depth, good for comparison.
v3 Ring + Micro Jitter
Slightly breaks overlaps for improved visibility.
v4 Spiral
Overview of growth pattern and density atmosphere.
v5 Clustered around Parent
Displays related items in proximity.
Advanced Patterns
v6 Grid
Aligns by depth. Good for checking bias.
v7 Sunburst
Spreads based on weight (line count/descendant count).
v8 Depth Rings (Order Preserved)
Overview without breaking sibling relationships.
v9 Category Bands + Diffusion
Separates functions/blocks while suppressing overlaps.
v10 Call-Focused
Circular arrangement + simple force for CallGraph.
Highly Advanced Patterns
v11 TypeScript-Optimized
Specialized layout for TypeScript files, optimized for complex type structures and interfaces.
v12 Category-Enhanced
Importance-based band arrangement, subgrouping. Automatic arrangement based on category frequency.
v13 Extended Golden Angle
TypeScript/JavaScript-optimized golden angle arrangement. Category-based radius adjustment including optimized layout.
Visual Styles (v1..v4)
Overview
- v1: Base (cool color scheme).
- v2: Warm Sunset (warm colors + halo/sunburst).
- v3: High Contrast (vivid nodes / monochrome neon dashed edges).
- v4: Pastel (soft watercolor-like expression).
Legend
Actual Style Examples

Style v3 (High Contrast) - Vivid nodes, neon dashed edges

Style v4 (Pastel) - Soft watercolor-like expression
Summary/Selection Summary
Summary Panel
- File: Path of analyzed file
- Lines: Total line count
- Functions: Function count
- Max depth: Maximum depth of tree
- Language: Detected programming language
- Categories: Function, class, control flow breakdown
Selection Summary
- Nodes / Blocks / Functions
- Total lines and unique line count excluding duplicates
- Avg nest: Average nesting depth of selected nodes (indicates code complexity)
- Category breakdown: Detailed breakdown by function, class, control flow
- Duplicate removal algorithm: Automatically removes duplicate code blocks for accurate metrics
- Avg cc (average cyclomatic complexity), Avg nest
- Score sum (composite index for visibility), Max depth
Analysis Data XML (Summary)
Internally, the app converts analysis results to unified format (XML v2) and reconstructs them during rendering.
summary
totalLines
,filePath
,functionCount
,maxDepth
,deadCodeCount
node
- Attributes:
id
,kind
,category
,name
- loc:
start
,end
,lines
- complexity:
cyclomatic
,nestingDepth
- layout:
depth
,angle
,radius
- metrics (extended): Arbitrary numeric attributes including statement count, branch count, loop count, return count, exception count, switch count
- language: Detected programming language (JavaScript/TypeScript)
- category: Node category (function, class, control flow, etc.)
edge
- Attributes:
id
,kind
(hierarchy
/call
),from
,to
For details, see "XML Spec (XML_FORMAT.md)" in the app.
Data Format and Internal Processing
Internal Data Format
The application uses XML v2 format internally for data exchange and persistence. This format provides comprehensive information about code structure, metrics, and relationships.
Technical Specifications
- XML v2 Standard: Unified format for all analysis results
- Data Persistence: Analysis results can be saved and loaded
- Export Options: JSON format for external use, XML for internal specifications
- Version Compatibility: Backward compatible with previous formats
Performance and Tips
- For very large node counts, use v6 (grid) or v9 (category bands) for overview → zoom into areas of interest.
- Styles v2~v4 include decorations. They are automatically optimized based on zoom and node count.
- When there are many call lines, switching to something other than v10 makes it easier to see.
- For TypeScript files, use v11 or v13 for optimal performance and layout.
Troubleshooting
- Nothing displays: Source has little structure / parsing failed. Try with a different file.
- Slow: Decorations are optimized during overall display. Switch to v6 or v9 and zoom in to check details.
- Center shifts (v6): Latest version fixes grid to be centered on origin.
- Incomplete TypeScript analysis: Use MultiLang or Category-Aware analyzer for better TypeScript support.
- Slow rendering with large files: Use v12 (Performance-Focused) pattern for better performance.
FAQ
Q. What is score?
It's a visibility index that integrates line count, complexity, etc. Larger values are drawn as more prominent nodes and become focus candidates.
Q. Should I use XML or JSON?
JSON is convenient for reusing analysis outside the app. XML is the internal standard format, good for checking specifications.
Q. Which pattern should I choose?
Start with v1/v9 for overview → if density or relationships are concerning, try v10 → for detailed comparison, use v2/v6. For TypeScript files, v11/v13 provide optimized layouts.
Analyzer Details
Basic Analyzer
Performs basic AST analysis, calculates hierarchy structure and complexity (cyclomatic complexity, nesting depth) for functions, classes, and blocks. Most lightweight and fast analysis. Also includes language detection and category determination.
CallGraph Analyzer
Analyzes call relationships between functions and constructs dependency graphs. Provides metrics such as in-degree/out-degree, fan-in/fan-out for functions. Generates both hierarchy edges and call edges.
MetricsExt Analyzer
Calculates detailed metrics such as statement count, branch count, loop count, return statement count, exception handling count, switch statement count, etc. Converts code quality indicators to numerical form. Also detects language-specific syntax elements.
MultiLang Analyzer
Performs TypeScript support analysis, properly recognizes TypeScript-specific syntax elements (interfaces, generics, decorators, enums, type aliases, etc.). Supports language characteristics of both JavaScript and TypeScript.
Category-Aware Analyzer
Performs category-aware smart analysis, providing analysis results while considering node importance and relationships. Includes automatic calculation of category statistics and JavaScript/TypeScript-specific category mapping.
Quality Score System
Technical Debt
Calculates technical debt based on complexity, nesting depth, function length, and parameter count. The total grows with the codebase and is automatically classified into info / minor / major / critical bands to guide prioritisation:
- info: 0.00–1.99 — observation stage
- minor: 2.00–4.99 — medium priority improvement
- major: 5.00–9.99 — address soon
- critical: ≥10.00 — immediate action required
Code Smells
The following code smells are automatically detected:
- Long functions: 50+ lines (S138)
- Complex functions: Cyclomatic complexity 10+ (S1541)
- Deep nesting: Nesting depth 5+ (S134)
- Too many parameters: 5+ (S107)
- Magic numbers: Hardcoded numbers (S109)
- Unused variables: Defined but not used (S1481)
Maintainability Index
Maintainability index 0-100 based on Halstead Volume, complexity, function length, function count, and category diversity. Higher values indicate better maintainability.
Other Metrics
- Code duplication rate: Function name and line-based duplication detection
- Coupling: Strength of dependencies between modules
- Cohesion: Strength of relationships within modules
- Security score: Detection of dangerous function names and patterns
Actual Quality Report Screens

Quality Report Screen - Detailed code quality analysis with improvement suggestions
Language Support
Fully Supported Languages
JavaScript (ES6+)
- Basic syntax: functions, classes, objects, arrays
- ES6+ features: arrow functions, classes, modules, template literals
- JSX support: Complete support for JSX syntax like React
- Advanced features: asynchronous processing (async/await), decorators, dynamic imports
TypeScript
- Type system: interfaces, enums, generics, type aliases
- Advanced syntax: decorators, namespaces, module extensions
- JavaScript compatibility: Inherits all JavaScript features
- Type safety: compile-time type checking and error detection
Currently Supported Language-Specific Features
- JavaScript: ES6+ features, dynamic typing, prototype-based inheritance, asynchronous processing, arrow functions, spread/rest operators, destructuring assignment
- TypeScript: static typing, advanced type system, interfaces, generics, decorators, asynchronous processing, TS-specific syntax, type annotations
Quality Assurance and Test Results
📊 Test Results Overview
✅ Test Results
- Test suites: 28 all successful
- Test cases: 825 all successful
- Execution time: 5.858 seconds
- Snapshots: 0
📈 Test Coverage
- Statements: 66.74%
- Branches: 61.81%
- Functions: 72.98%
- Lines: 70.44%
🔧 Test Environment and Libraries
🧪 Test Frameworks
- Jest: main test framework (v30.0.5)
- Babel Jest: test support for ES6+ syntax
- Jest Environment JSDOM: browser environment simulation
- @types/jest: TypeScript type definitions support
⚙️ Development·Test Environment
- Node.js: JavaScript runtime environment
- Electron: desktop app framework (v38.1.2)
- Cross-env: environment variables cross-platform support
- Playwright: E2E testing browser automation (v1.54.2)
🔍 Test Types and Content
🧪 Test Types
- Unit tests: confirm individual functions one by one
- Integration tests: confirm collaborative working of multiple functions
- E2E tests: confirm proper working of entire app
- Coverage tests: confirm code testing extent
📋 Main Test Content
- Syntax parsing: JavaScript/TypeScript syntax parsing and AST construction
- Metrics calculation: complexity, line count, nesting depth calculation
- Rendering engine: graphics drawing, color management, text rendering
- Interaction: mouse operations, selection functions, zoom functions
📊 Detailed Test Results View
📋 Latest Test Execution Results
🧪 E2E Tests Detailed View
🚀 Electron Integration Tests (9 tests)
- Application startup: main process·renderer process normal startup confirmation
- IPC communication tests: inter-process communication action confirmation and error handling
- Window management: main window display·hide·resize
- File system: file reading·saving action confirmation
- Menu operations: application menu action confirmation
🔧 Function Integration Tests (32 tests)
- File analysis pipeline: file reading→analysis→display continuous flow
- Analyzer switching: Basic/CallGraph/MetricsExt/MultiLang action confirmation
- Render patterns: v1~v13 display patterns action confirmation
- Visual styles: v1~v4 style application action confirmation
- Settings management: user settings save·read·apply
🎨 Renderer Detailed Tests (14 tests)
- Rendering engine: canvas drawing·graphics drawing·text rendering
- Interaction: mouse operations·keyboard operations·touch operations
- Layout calculation: node layout·edge drawing·zoom·pan
- State management: selection state·view state·animation state
- Performance: large node drawing·memory usage·drawing speed
📊 Data Processing Tests (16 tests)
- XML export: analysis results XML format output·data integrity confirmation
- Metrics calculation: complexity·line count·nesting depth accuracy
- Category classification: functions·classes·control flow automatic identification
- Dependency analysis: function calls·inheritance relationships·module dependencies
- Error handling: invalid inputs·exception handling·recovery
🔄 Quality Improvement Challenges
📋 Quality Management Mechanisms
- Comprehensive testing: confirm existing functions action even when adding new features
- Automated testing: regular action confirmation quality maintain
- User feedback: improvements based on actual usage situations
- Continuous improvement: continue stability and reliability improvement
🎯 Quality Improvement Goals
- Reliability improvement: continuously guarantee stable operation of main functions
- User experience: improve ease of use and operability
- Performance: optimize processing speed and responsiveness
- Compatibility: guarantee operation in various environments
⚠️ Quality Assurance Limitations
🔍 Perfection Guarantee
Important Points: Coverage rates or test results are one of the quality indicators, but cannot guarantee perfection for the following reasons:
- Test limitations: realistically difficult to completely cover all execution paths or edge cases
- Environment dependency: difficult to completely guarantee operation in different OS, browsers, devices
- User operation diversity: difficult to completely predict unexpected user operation patterns
- External dependencies: difficult to completely respond to third-party libraries or system environment changes
✅ Best Effort Testing
Quality Improvement Challenges: Cannot guarantee perfection, but perform best effort comprehensive testing through the following methods:
- Multi-layer test strategy: comprehensive verification through unit·integration·E2E tests combination
- Main functions focus testing: guarantee high coverage of core functions (analysis·rendering·export)
- Edge cases consideration: testing abnormal inputs·error states·boundary conditions
- Continuous improvement: continuously strengthen tests based on test results analysis
- Practicality focus: focus testing on problems that may occur in actual usage scenarios
🔮 Quality Assurance Continuous Challenges
This application continuously challenges quality assurance to provide reliable services to users. 825 test cases comprehensive verification, main functions high quality guarantee, focus on actual usage scenarios stability.
OSS Used and Licenses
Main Dependencies
🚀 Core Frameworks
- Electron: Desktop app framework (v38.1.2) - MIT License
- Node.js: JavaScript runtime environment - MIT License
- @babel/parser: JavaScript/TypeScript parser - MIT License
🎨 UI Libraries
- monaco-editor: Code editor (VS Code engine) - MIT License
- p5: Creative coding library - LGPL-2.1-or-later
- marked: Markdown parser - MIT License
Development Tools
🧪 Testing Frameworks
- Jest: Test framework (v30.0.5) - MIT License
- @types/jest: TypeScript definitions - MIT License
- Playwright: E2E testing (v1.54.2) - Apache-2.0 License
⚙️ Build Tools
- Babel: JavaScript compiler - MIT License
- Cross-env: Environment variables - MIT License
- Electron-builder: App packaging - MIT License
License Details
📋 License Summary
OSS Contribution
This application fully utilizes the benefits of open source software. By using community-developed high-quality libraries, it improves development efficiency and guarantees reliability.
Dependency snapshot & licenses (as of Sep 2025)
Key npm packages used by the runtime and tooling. Most dependencies are MIT-licensed. Playwright packages use Apache License 2.0, and p5.js is LGPL-2.1-or-later.
Category | Package | License |
---|---|---|
Core runtime | Electron 38.1.2 | MIT |
monaco-editor 0.49.0 | MIT | |
marked 12.0.2 | MIT | |
p5 2.0.4 | LGPL-2.1-or-later | |
Analysis engine | @babel/parser 7.28.3 | MIT |
Babel toolchain (core / preset-env / plugin) | MIT | |
Build & testing | electron-builder 26.0.12 | MIT |
cross-env 7.0.3 | MIT | |
jest / babel-jest / @types/jest 30.x | MIT | |
@playwright/test 1.54.2 / playwright 1.54.2 | Apache License 2.0 | |
Asset generation | png2icons 2.0.1 | MIT |
For the full dependency tree, refer to package.json
and run the bundled analyze-dependencies.js
script.
MIT License (Full Text)
MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
LGPL v2.1 (Summary of Key Terms and Full Text)
Summary (for reference):
- Modification and redistribution of the library itself requires same license distribution and source disclosure.
- Applications that link and use the library are not affected by the license and can be distributed under their own license (though distribution that doesn't prevent library replacement is recommended).
- For full license text, see below and GNU site.
GNU Lesser General Public License v2.1 (Original)
LGPL v2.1 (Original Text - Expand for Full Text)
GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [... For full text reference, please check the original GNU site above ...]