README
ΒΆ
funcfinder
Stop mastering grep. Run one script. Get the full picture.
./build.sh && ./funcfinder --dir . --all --json > map.json
Why?
| Without funcfinder | With funcfinder |
|---|---|
| AI reads README, avoids code (too expensive) | AI sees full structure, reads only what matters |
| Hours browsing files: "what depends on what?" | map.json + one jq query = instant answer |
| 80% API budget on exploration | 99% reduction β map once, extract targeted |
| ctags + LSP + grep + manual work | One binary, 15 languages, zero setup |
| Learn tools, then teach model | Drop map.json in context β model just works |
Time + Money + Understanding + Simplicity = One command.
π Production Features
- π Directory Mode β NEW:
--dir ./projectscans entire repositories with automatic language detection - β‘ Parallel Processing:
--workers 8for 4-8x speedup on large codebases - π― Smart Filtering: Automatic
.gitignoresupport, skipnode_modules,vendor, etc. - π Three Analysis Modes:
--map(default): Find all functions--struct: Find only classes/structs/types--all: Both functions and types
- π Output Formats: grep-style, JSON, tree, tree-full, extract bodies
- π¨ Multi-language: Single command analyzes mixed Go/Python/C++/Java projects
- πͺ Cross-platform: Linux, macOS, Windowsβzero dependencies
π Real-World Performance
# Small project (21 files, mixed languages)
funcfinder -dir test_examples --all --map
β 273 functions + 438 types in ~30-45ms
# Medium project (25 Go files)
funcfinder -dir internal --all --json
β 228 functions + 69 classes in ~40ms
# Parallel speedup
--workers 1: 45ms β --workers 4: 29ms (1.55x faster)
π Core Capabilities
- π Single File Analysis:
--inp file.go --mapfor targeted extraction - π Directory Scanning:
--dir ./src --allfor entire codebases - ποΈ Type Extraction:
--structfinds classes, structs, interfaces, enums - π Combined Analysis:
--allgets both functions and types in one pass - πΊοΈ Codebase Mapping:
--treeshows hierarchical structure - π Precise Extraction:
--lines 50:100for specific code ranges - π€ Body Extraction:
--extractpulls complete function bodies - π JSON Export:
--jsonfor programmatic processing - β‘ Performance: 763K lines/sec sanitizer, parallel worker pools
- π― Zero Dependencies: Single static binary
π Supported Languages (15)
| Category | Languages |
|---|---|
| Systems | C, C++, Rust, Go, D |
| JVM | Java, Kotlin, Scala |
| Web | JavaScript, TypeScript, PHP |
| Scripting | Python, Ruby |
| Mobile | Swift, C# |
π¦ Installation
Via Go Install (Recommended)
go install github.com/ruslano69/funcfinder@latest
Pre-built Binaries
Download from Releases:
# Linux
wget https://github.com/ruslano69/funcfinder/releases/download/v1.6.0/funcfinder-linux-amd64.tar.gz
tar -xzf funcfinder-linux-amd64.tar.gz
sudo mv funcfinder /usr/local/bin/
# macOS
wget https://github.com/ruslano69/funcfinder/releases/download/v1.6.0/funcfinder-darwin-amd64.tar.gz
tar -xzf funcfinder-darwin-amd64.tar.gz
sudo mv funcfinder /usr/local/bin/
# Windows
# Download funcfinder-windows-amd64.zip and add to PATH
From Source
git clone https://github.com/ruslano69/funcfinder.git
cd funcfinder
# Linux/macOS: Build all utilities (funcfinder, stat, deps, complexity)
./build.sh
# Windows (PowerShell): Build all utilities
.\build.ps1
# Or build funcfinder only
go build # Now works! β
β
Fixed: go build now works without errors! Other utilities use build tags and are built via build.sh/build.ps1.
For Windows-specific instructions, see docs/WINDOWS.md.
π Quick Start
Directory Mode (β Most Powerful)
# Scan entire project (auto-detects languages)
funcfinder --dir ./myproject --map --tree
# Find all functions + classes in repository
funcfinder --dir ./src --all --json > codebase.json
# Fast parallel scan with 8 workers
funcfinder --dir . --map --workers 8
# Only structs/classes (skip functions)
funcfinder --dir ./models --struct --map
# Output:
# INFO: Scanning directory: ./src (mode=all, workers=8, gitignore=true)
# βββ src
# βββ main.go
# β βββ def main (line 10)
# β βββ class Server (line 25)
# βββ handler.py
# β βββ def process (line 5)
# β βββ class Handler (line 20)
# INFO: Processed 15 files, found 45 functions, 12 classes/types
Single File Mode
Check version
funcfinder --version
# Output: funcfinder version 1.6.0
Map all functions in a file
funcfinder --inp main.go --source go --map
# Output: main: 10-25; Handler: 45-78; helper: 65-72;
Find specific functions
funcfinder --inp api.go --source go --func Handler,Middleware
# Output: Handler: 45-78; Middleware: 80-95;
JSON output for AI
funcfinder --inp api.go --source go --map --json
{
"Handler": {"start": 45, "end": 78},
"Middleware": {"start": 80, "end": 95}
}
Extract function body
funcfinder --inp api.go --source go --func Handler --extract
// Handler: 45-78
func Handler(w http.ResponseWriter, r *http.Request) {
// function body...
}
Find structs/classes/types (NEW in v1.5.0)
# Map all types in a Go file
funcfinder --inp models.go --source go --struct --map
# Output: User: 10-15; fields: ID, Name, Email Address: 20-25; fields: Street, City, Zip
# Find specific types
funcfinder --inp models.go --source go --struct --type User,Address
# Output: User: 10-15; fields: ID, Name, Email Address: 20-25; fields: Street, City, Zip
# JSON output for types
funcfinder --inp models.py --source py --struct --map --json
{
"filename": "models.py",
"types": [
{
"name": "User",
"kind": "class",
"start": 5,
"end": 12,
"fields": [
{"name": "id", "type": "int", "line": 6},
{"name": "name", "type": "str", "line": 7}
]
}
]
}
Combined mode: functions + structs (NEW in v1.5.0)
# Get complete file structure in one call
funcfinder --inp service.go --source go --all --map
# Output:
# === FUNCTIONS ===
# NewService: 30-35; Process: 40-55; Validate: 60-70;
#
# === TYPES ===
# Service: 10-15; fields: db, cache Config: 20-25; fields: Host, Port
# JSON output with both functions and types
funcfinder --inp api.go --source go --all --json
{
"filename": "api.go",
"functions": [
{"name": "NewService", "start": 30, "end": 35},
{"name": "Process", "start": 40, "end": 55}
],
"types": [
{
"name": "Service",
"kind": "struct",
"start": 10,
"end": 15,
"fields": [
{"name": "db", "type": "*sql.DB", "line": 11},
{"name": "cache", "type": "Cache", "line": 12}
]
}
]
}
ποΈ Architecture: Why Not Just Regex?
The Problem with Simple Regex Parsers
Most code parsers use naive regex patterns and fail on edge cases:
// β Simple regex breaks here:
string path = @"C:\Users\Test"; // C# verbatim string
string msg = @"He said ""Hello"""; // Escaped quotes in verbatim
// β Regex truncates this:
query := `SELECT * FROM users // not a comment` // Go raw string
// β Regex sees 6 quotes, not 1 docstring:
"""This is a Python docstring"""
funcfinder's Solution: Factory + State Machine
Input File β Language Factory β Parser Factory β Enhanced Sanitizer β Pattern Matching
β β β β β
file.go GoConfig Finder State Machine Find Functions
file.py PythonConfig PythonFinder (763K lines/sec) Extract Bodies
file.cs CSharpConfig Finder Handles verbatim Output
Key Components:
-
Language Factory (
languages.json)- Auto-detects language by extension
- Loads correct parser config (brace-based vs indent-based)
- Supports 15+ languages with language-specific features
-
Enhanced Sanitizer (State Machine, not regex)
- 7 states: Normal, LineComment, BlockComment, String, RawString, CharLiteral, MultiLineString
- Correctly handles: C#
@"...", Python""", Go`...`, nested comments - Performance: 763,000 lines/sec
- Technical deep-dive
-
Parser Factory
CreateFinder()β Brace-based (Go, Java, C++) or Indent-based (Python)CreateStructFinder()β Type extraction with field parsing- Unified API regardless of language
-
Directory Processor
- Worker pool for parallel processing
.gitignorepattern matching- Language detection per file
- Result aggregation
Result: Handles production code that breaks simple regex parsers.
Proof: Test Results
# C# verbatim strings (broken in most tools)
funcfinder --inp test.cs --source cs --map
β
Correctly handles @"C:\Users" and @"He said ""Hello"""
# Python docstrings (often counted as 6 separate strings)
funcfinder --inp test.py --source py --map
β
Treats """...""" as single multiline string
# Go raw strings with comment-like content
funcfinder --inp test.go --source go --map
β
`SELECT // not comment` parsed correctly
π€ AI Agent Integration
mini-SWE-agent Support
funcfinder provides perfect CLI tools for mini-SWE-agent - a minimalist AI coding agent that uses only bash commands.
Why perfect match:
- β Pure bash interface (no special tool-calling)
- β Stateless execution (each command independent)
- β
JSON output everywhere (
--jsonflag) - β 99% token reduction vs reading full files
Quick Example:
# Agent workflow: Fix bug in auth/middleware.go
# 1. Get COMPLETE structure - functions + types (50 tokens vs 5000) β NEW
funcfinder --inp auth/middleware.go --source go --all --json
# 2. Extract buggy function (150 tokens vs 5000)
funcfinder --inp auth/middleware.go --source go --func ValidateToken --extract
# 3. Check related types (understand data structures)
funcfinder --inp auth/middleware.go --source go --struct --type TokenData --extract
# 4. Check complexity
complexity auth/middleware.go -j | jq '.functions[] | select(.name=="ValidateToken")'
# 5. Make targeted fix with 99% token savings! π
Why --all is perfect for AI agents:
- β One call = complete context (functions + data structures)
- β Understand both behavior (functions) and state (types)
- β Minimal tokens for maximum insight
- β Perfect for code understanding and refactoring tasks
See: AI Agent Guide | Example Workflows
π‘ Use Cases
AI-Driven Development
Problem: AI reading 10,000 lines when it needs 250
Solution:
# 1. Get file structure (minimal tokens)
funcfinder --inp large_file.go --source go --map --json
# 2. AI selects needed function from map
# 3. Extract only that function (97.5% token savings!)
funcfinder --inp large_file.go --source go --func ProcessData --extract
Code Navigation
# Find all methods in a C# file
funcfinder --inp Controller.cs --source cs --map --json > functions.json
# Extract specific method for review
funcfinder --inp Controller.cs --source cs --func CreateUser --extract
JavaScript/TypeScript Support
# Find all functions in a JavaScript file
funcfinder --inp app.js --source js --map --json
# Extract async function from TypeScript
funcfinder --inp api.ts --source ts --func fetchUser --extract
# Find generator functions
funcfinder --inp generators.js --source js --func simpleGenerator --extract
# Extract arrow functions
funcfinder --inp utils.js --source js --func arrowFunc,asyncArrow --extract
# Find React component methods
funcfinder --inp Component.jsx --source js --func render,componentDidMount
Python Support with Decorators
# Map all functions in Python file
funcfinder --inp api.py --source py --map
# Extract function with decorators
funcfinder --inp api.py --source py --func cached_function --extract
# JSON output includes decorators
funcfinder --inp api.py --source py --func get_user --json
{
"get_user": {
"decorators": [
"@require_auth",
"@validate_input"
],
"end": 42,
"start": 35
}
}
# Find async functions and generators
funcfinder --inp utils.py --source py --func async_generator,fibonacci --extract
Struct/Type Finding (NEW in v1.5.0)
# Find all types in a Go file
funcfinder --inp models.go --source go --struct --map
# Output: User: 10-20; fields: ID, Name, Email Config: 25-30; fields: Host, Port
# Find specific structs/classes
funcfinder --inp models.py --source py --struct --type User,Product --extract
# Get complete file structure (functions + types)
funcfinder --inp service.go --source go --all --json
{
"functions": [{"name": "NewService", "start": 35, "end": 45}],
"types": [
{
"name": "Service",
"kind": "struct",
"fields": [{"name": "db", "type": "*sql.DB", "line": 12}]
}
]
}
# Find C++ classes and structs
funcfinder --inp widget.cpp --source cpp --struct --map
# Find Java classes and interfaces
funcfinder --inp api.java --source java --struct --map
# Find Python classes with fields
funcfinder --inp models.py --source py --struct --tree
# Output:
# class User (10-25)
# βββ field id: int (line 11)
# βββ field name: str (line 12)
# βββ field email: str (line 13)
Why struct finding is useful:
- ποΈ Understand data structures before modifying code
- π Find type definitions across large codebases
- π JSON output for AI-powered refactoring
- π Combined with functions for complete context
Tree Visualization for Classes
# Display class hierarchy in tree format
funcfinder --inp Calculator.java --source java --tree
# Output:
# class Calculator (1-20)
# βββ method add (5-7)
# βββ method subtract (9-11)
# βββ method multiply (13-15)
# class Helper (22-30)
# βββ method assist (23-25)
# βββ method process (27-29)
# Tree with full signatures
funcfinder --inp api.ts --source ts --tree-full
# Visualize Python classes (with decorators!)
funcfinder --inp models.py --source py --tree
Line Range Filtering (v1.4.0+)
# Standalone mode: Fast file slicing (works on ANY file, no --source needed)
funcfinder --inp app.log --lines 1000:1100
# Output: Lines 1000-1100 with line numbers
# JSON output for line ranges
funcfinder --inp config.yaml --lines :50 --json
# Filter mode: Narrow function search to specific lines
funcfinder --inp large_file.go --source go --map --lines 500:1000
# Only shows functions within lines 500-1000
# Find function in specific area (much faster for large files)
funcfinder --inp server.js --source js --func handleAPI --lines 100:500 --extract
# Tree view of limited scope
funcfinder --inp Calculator.java --source java --tree --lines 1:100
# Windows-compatible sed alternative (10-50x faster than PowerShell)
funcfinder --inp server.log --lines 5000: # From line 5000 to EOF
funcfinder --inp debug.txt --lines :1000 # First 1000 lines
funcfinder --inp trace.log --lines 500 # Single line 500
Why --lines is useful:
- πͺ Cross-platform: Works on Windows without sed
- β‘ Performance: 10-50x faster than PowerShell alternatives
- π― Precision: Combine with --map/--func/--tree to narrow search scope
- π Any file: Standalone mode works on logs, configs, any text file
Integration with Other Tools
# Combine with grep/mgrep for comprehensive analysis
mgrep "authentication" api.go
funcfinder --inp api.go --source go --func AuthHandler --extract
# Get function start line in scripts
START=$(funcfinder --inp api.go --source go --func Handler --json | jq '.Handler.start')
π Usage Scenarios
Git Hooks Integration: "Commit Once, Search Instantly Forever"
Automatically update your code map on every commit. Set up once β instant search forever.
1. Create post-commit hook:
# .git/hooks/post-commit
#!/bin/bash
funcfinder --dir . --all --json > .codemap.json 2>/dev/null
git add .codemap.json 2>/dev/null
chmod +x .git/hooks/post-commit
2. Add project configuration (optional):
# .funcfinder.config
EXCLUDE_DIRS="node_modules,vendor,.git,dist,build"
WORKERS=8
OUTPUT_FORMAT="json"
3. Result:
| Approach | Search Time | Context |
|---|---|---|
grep -r "func" |
~2-5 sec | Text only |
funcfinder + hooks |
instant | Structure + boundaries + types |
Benefits:
- π Code map always up-to-date
- β‘ Instant search via
.codemap.json - π AI agents get structure without parsing
- πΎ Minimal overhead (JSON ~50KB for medium project)
Using the map:
# Find functions in auth module
jq '.files[] | select(.path | contains("auth")) | .functions[]' .codemap.json
# List all classes with paths
jq '.files[] | .path as $p | .types[] | "\($p):\(.name)"' .codemap.json
# Project statistics
jq '{files: (.files | length), functions: [.files[].functions[]] | length}' .codemap.json
π Usage
funcfinder --inp <file> [--source <lang>] [OPTIONS]
Required:
--inp <file> Source file to analyze
--source <lang> Language: go/c/cpp/cs/java/d/js/ts/py/rust/swift/kotlin/php/ruby/scala
(optional when using --lines alone)
Work modes (choose one):
(default) Find functions (default behavior)
--struct Find structs/classes/types instead of functions β NEW
--all Find both functions and structs β NEW
Search modes (choose one):
--func <names> Find specific functions (comma-separated)
--type <names> Find specific types (comma-separated, requires --struct) β NEW
--map Map all functions/types in file
--tree Display in tree format (shows class hierarchy)
--tree-full Display in tree format with signatures
Filtering:
--lines <range> Extract/filter by line range (standalone or with --source)
Formats: 100:150, :50, 100:, 100
Output formats:
(default) grep-style: name: n1-n2;
--json JSON format
--extract Extract function/type bodies
Options:
--raw Don't ignore raw strings in brace counting
--version Print version and exit
Examples of flag combinations:
# Functions (default mode)
funcfinder --inp file.go --source go --map # Map all functions
funcfinder --inp file.go --source go --func Handler # Find specific function
# Structs mode
funcfinder --inp file.go --source go --struct --map # Map all types
funcfinder --inp file.go --source go --struct --type User # Find specific type
# Combined mode (--all requires --map, --tree, or --json)
funcfinder --inp file.go --source go --all --map # Map functions + types
funcfinder --inp file.go --source go --all --json # JSON with both
funcfinder --inp file.go --source go --all --extract # Extract both
# Invalid combinations (will error)
funcfinder --inp file.go --source go --struct --all # Mutually exclusive
funcfinder --inp file.go --source go --func foo --struct # Can't mix modes
funcfinder --inp file.go --source go --type User # Need --struct or --all
π― Token Reduction Examples
Example 1: Large Codebase Analysis
Traditional approach:
- AI reads entire codebase: 100,000 lines = 150,000 tokens
- Cost: $0.45 (at $0.003/1K tokens)
- Time: Multiple AI requests, ~5-10 seconds
With funcfinder:
# 1. Get structure (280,000 lines/sec)
funcfinder --inp . --source go --map --json
- Analysis time: 0.36 seconds for 100K lines
- Tokens sent to AI: ~500 tokens (JSON structure)
- Cost: $0.0015
- Token savings: 99.67% | Cost savings: 300x | Time: faster than 1 AI request!
Example 2: Targeted Function Extraction
Traditional approach:
- AI reads entire file: 5,000 lines = 7,500 tokens
With funcfinder:
# 1. Map functions
funcfinder --inp api.go --source go --map --json
# 2. AI selects function from structure (50 tokens)
# 3. Extract only that function
funcfinder --inp api.go --source go --func ProcessData --extract
- Tokens used: 50 (structure) + 375 (function body) = 425 tokens
- Token savings: 94%
ποΈ Architecture
funcfinder/
βββ cmd/ # CLI entry points
β βββ funcfinder/main.go # Main tool
β βββ stat/main.go # Call counter
β βββ deps/main.go # Dependency analyzer
β βββ complexity/main.go # Complexity analyzer
βββ internal/ # Core logic
β βββ config.go # Language configuration
β βββ languages.json # 15 language patterns (embedded)
β βββ finder.go # Function boundary detection
β βββ structfinder.go # Class/struct detection
β βββ enhanced_sanitizer.go # State-machine parser
β βββ dirprocessor.go # Directory scanning
β βββ python_finder.go # Python-specific logic
β βββ formatter.go # Output formatting
β βββ tree.go # Tree visualization
βββ examples/
β βββ analyze.sh # Full project analysis
βββ docs/ # Documentation
βββ test_examples/ # Test files (15 languages)
π§ Configuration
Language patterns are defined in languages.json (embedded in binary):
{
"go": {
"func_pattern": "^\\s*func\\s+(\\([^)]*\\)\\s+)?(\\w+)\\s*\\(",
"line_comment": "//",
"block_comment_start": "/*",
"block_comment_end": "*/",
"string_chars": ["\""],
"raw_string_chars": ["`"],
"escape_char": "\\"
}
}
π§ͺ Testing
Tested on:
- Go standard library (
fmt/print.go) - Production C# code (TELB project)
- Real-world codebases with complex nesting
# Run tests
go test ./...
# Test on sample file
funcfinder --inp config.go --source go --map
π οΈ Additional Utilities
funcfinder ships with additional utilities for comprehensive code analysis. All utilities share a unified architecture with common configuration and error handling modules.
Quick Start
# Build all utilities
./build.sh
# Full project analysis in one command
./examples/analyze.sh
# AI agent workflow
funcfinder --inp api.go --source go --map # Code structure
stat api.go -l go -n 10 # Hotspots
deps . -l go -j # Dependency graph
complexity api.go -l go # Cognitive complexity
Utilities
| Utility | Purpose | Languages | Output |
|---|---|---|---|
| funcfinder | Code structure (functions, classes, boundaries) | 15 | grep/JSON/extract |
| stat | Function call analysis + file metrics | 15 | text |
| deps | Module dependency analysis (stdlib/external/internal) | 15 | text/JSON |
| complexity | Cognitive complexity analyzer (nesting depth) | 15 | colored text |
π§ complexity - Cognitive Complexity Analyzer
Philosophy: Deep nesting (not branch count) is the real complexity.
# Analyze single file
complexity main.go -l go
# Analyze directory
complexity . -l go
# JSON output for automation
complexity api.py -l py --json
# Top N most complex functions
complexity . -l go -n 10
Complexity Levels:
- β SIMPLE (depth β€ 2) - Flat code, easy to understand
- β οΈ MODERATE (depth = 3) - One nesting level
- πΆ HIGH (depth β₯ 4) - Two+ nesting levels
- π΄ CRITICAL (depth β₯ 6) - Needs refactoring
Formula: NDC = 2^(maxDepth - 1)
π Full Analysis with analyze.sh
./examples/analyze.sh
Report includes:
- π File statistics (lines, size, code/comments/blank ratio)
- π Function inventory
- π₯ Call hotspots (top functions by frequency)
- π¦ Dependency graph (stdlib vs external vs internal)
- π§ Complexity distribution (SIMPLE/MODERATE/HIGH/CRITICAL)
ποΈ Unified Architecture (v1.4.0)
All utilities share common modules (DRY principle):
funcfinder/
βββ internal/
β βββ config.go # Unified language configuration
β βββ errors.go # Standard error handling
β βββ languages.json # Single source of patterns (embedded)
βββ cmd/
β βββ funcfinder/ # Main CLI
β βββ stat/ # Call counter + metrics
β βββ deps/ # Dependency analyzer
β βββ complexity/ # Complexity analyzer
βββ examples/
βββ analyze.sh # Full project analysis
Architecture Benefits:
- β Zero duplication - single config for all utilities
- β Consistency - same error messages everywhere
- β Easy extension - add language = update JSON
- β Zero dependencies - all utilities are static binaries
Common Use Cases:
- π Initial analysis of unfamiliar code
- π Finding optimization bottlenecks
- π Refactoring and duplication detection
- π Code review and PR analysis
- π€ AI agent navigation with minimal tokens
- π§ Complexity assessment before refactoring
π€ Contributing
Contributions welcome! Please follow these guidelines:
How to contribute:
- Fork the repository and create a feature branch
- Write tests for new functionality
- Follow existing code style and conventions
- Submit PR with clear description
Areas for contribution:
- Additional language support
- Improved regex patterns
- Performance optimizations
- Test coverage
π Performance
Verified Benchmarks
Parsing throughput: 280,000 lines/sec (3.6 ΞΌs per line)
# Real-world performance (verified with benchmark tool)
100,000 lines β 0.36 seconds
280,000 lines β 1.00 second
# This means funcfinder analyzes 100K lines FASTER than a single AI API request! (~500ms)
β‘ The X-Ray and Microscope for AI
What makes funcfinder unique:
- π¬ X-ray vision: Scan entire codebase structure in milliseconds
- π Microscope precision: Extract exact functions with zero noise
- π Faster than AI requests: 100K lines in 360ms vs AI request ~500ms
- π° 99.67% token savings: 150,000 tokens β 500 tokens for structure
Why this matters for AI workflows:
Traditional approach (without funcfinder):
βββ Read entire file: 150,000 tokens @ $0.003/1K = $0.45
βββ Wait for AI processing: ~500-1000ms
βββ Get answer with full file context
With funcfinder:
βββ Get file structure: 0.36 seconds for 100K lines
βββ Send structure to AI: 500 tokens @ $0.003/1K = $0.0015
βββ AI selects function: instant
βββ Extract function: <1ms
Total: 0.36s + minimal cost (300x cheaper!)
Technical Details
- Complexity: O(n) linear with respect to file size
- Memory: Minimal (streaming line-by-line processing)
- Binary size: 3MB (static, no external dependencies)
- Platform: Cross-platform (Linux, macOS, Windows)
πΊοΈ Roadmap
v1.1.0 β
- JavaScript/TypeScript support
-
--versionflag - Arrow function support for JS/TS
- Generator function support
v1.2.0 β
- Python support with decorator detection
- Async/await function support
- Improved function detection across all languages
v1.3.0 β
- Tree visualization (
--treeand--tree-full) - Class hierarchy detection
- Method-class association for all OOP languages
- Rust support (structs, traits, enums, impl blocks)
- Swift support (classes, structs, protocols, enums)
- Kotlin, PHP, Ruby, Scala support β NEW
- 15 languages total (added without Go code changes!)
v1.4.0 β
- --lines flag for line range filtering
- Cross-platform file slicing (sed alternative)
- Standalone and filter modes
- stat utility - function call counter + file metrics (15 languages)
- deps utility - dependency analyzer (15 languages)
- complexity utility β NEW - cognitive complexity analyzer (15 languages)
- Unified architecture - shared config.go and errors.go (DRY principle)
- analyze.sh - comprehensive project analysis script
- Complete code analysis toolkit with zero dependencies
v1.5.0 (Current) β
- --struct flag - Find structs/classes/types/interfaces β NEW
- --type flag - Find specific types by name β NEW
- --all flag - Combined mode (functions + structs) β NEW
- EnhancedSanitizer - Multiline strings, char literals, nested comments
- Struct pattern support for all 15 languages
- Field extraction - Extract type fields with names and types
- Combined JSON output - Functions and types in single response
- Nested function support - Python, JS, TS, Go, Ruby, Scala
- Complete code structure analysis (behavior + state)
v1.6.0
- Configuration file support (.funcfinderrc)
- Custom patterns via CLI
- Improved C# regex patterns
- Function type filters (public/private)
- Cyclomatic complexity (as alternative to nesting depth)
- HTML reports for analyze.sh
v2.0.0
- Tree-sitter integration for precise parsing
- 30+ language support
- API server mode
- IDE integrations
π Documentation
- AGENTS.md - Quick reference for AI agents
- docs/WINDOWS.md - Windows build guide
- docs/CI_CD.md - CI/CD pipeline documentation
- docs/ENHANCED_SANITIZER.md - State-machine parser deep-dive
- CHANGELOG.md - Version history
π License
MIT License - see LICENSE file for details.
π Acknowledgments
Built for AI-driven development workflows. Inspired by the need to minimize token usage in large codebases.
π Support
- π Report Issues
- π‘ Feature Requests
- π Documentation
funcfinder - Navigate code efficiently, save tokens intelligently π
Directories
ΒΆ
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
benchmark
command
|
|
|
complexity
command
complexity.go - Nesting Depth Complexity Analyzer Analyzes code complexity based on NESTING DEPTH, not decision point count Philosophy: Deep nesting is harder to understand than flat code with many branches
|
complexity.go - Nesting Depth Complexity Analyzer Analyzes code complexity based on NESTING DEPTH, not decision point count Philosophy: Deep nesting is harder to understand than flat code with many branches |
|
deps
command
deps.go - Module dependency analyzer Uses shared configuration for multiple languages
|
deps.go - Module dependency analyzer Uses shared configuration for multiple languages |
|
findstruct
command
|
|
|
funcfinder
command
|
|
|
stat
command
stat.go - Unified function call counter for multiple languages Counts function calls in source files using shared configuration
|
stat.go - Unified function call counter for multiple languages Counts function calls in source files using shared configuration |
|
config.go - Unified language configuration Loads and manages language patterns for funcfinder, stat, deps, complexity, and findstruct
|
config.go - Unified language configuration Loads and manages language patterns for funcfinder, stat, deps, complexity, and findstruct |
|
test_structs_go.go - Test file for Go struct detection
|
test_structs_go.go - Test file for Go struct detection |