4 Commits

Author SHA1 Message Date
yusyus
ec3e0bf491 fix: Resolve 61 critical linting errors
Fixed priority linting errors to improve code quality:

Critical Fixes:
- F821 (2 errors): Fixed undefined name 'original_result' in config_enhancer.py
- UP035 (2 errors): Removed deprecated typing.Dict and typing.Type imports
- F401 (27 errors): Removed unused imports and added noqa for availability checks
- E722 (19 errors): Replaced bare 'except:' with 'except Exception:'

Code Quality Improvements:
- SIM201 (4 errors): Simplified 'not x == y' to 'x != y'
- SIM118 (2 errors): Removed unnecessary .keys() in dict iterations
- E741 (4 errors): Renamed ambiguous variable 'l' to 'line'
- I001 (1 error): Sorted imports in test_bootstrap_skill.py

All modified areas tested and passing:
- test_scraper_features.py: 42 passed
- test_integration.py: 51 passed
- test_architecture_scenarios.py: 11 passed
- test_real_world_fastmcp.py: 19 passed (1 skipped)

Remaining linting errors: 249 (mostly code style suggestions like ARG002, F841, SIM102)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-17 22:54:40 +03:00
Pablo Estevez
5ed767ff9a run ruff 2026-01-17 17:29:21 +00:00
yusyus
3408315f40 feat: Add 6 new languages to codebase analysis system (C#, Go, Rust, Java, Ruby, PHP)
Expands language support from 3 to 9 languages across entire codebase scraping system.

**New Languages Added:**
- C# (Unity/.NET support) - classes, methods, properties, async/await, XML docs
- Go - structs, functions, methods with receivers, multiple return values
- Rust - structs, functions, async functions, impl blocks
- Java - classes, methods, inheritance, interfaces, generics
- Ruby - classes, methods, inheritance, predicate methods
- PHP - classes, methods, namespaces, inheritance

**Code Analysis (code_analyzer.py):**
- Added 6 new language analyzers (~1000 lines)
- Regex-based parsers inspired by official language specs
- Extract classes, functions, signatures, async detection
- Comprehensive comment extraction for all languages

**Dependency Analysis (dependency_analyzer.py):**
- Added 6 new import extractors (~300 lines)
- C#: using statements, static using, aliases
- Go: import blocks, aliases
- Rust: use statements, curly braces, crate/super
- Java: import statements, static imports, wildcards
- Ruby: require, require_relative, load
- PHP: require/include, namespace use

**File Extensions (codebase_scraper.py):**
- Added mappings: .cs, .go, .rs, .java, .rb, .php

**Test Coverage:**
- Added 24 new tests for 6 languages (4 tests each)
- Added 19 dependency analyzer tests
- Added 6 language detection tests
- Total: 118 tests, 100% passing 

**Credits:**
- Regex patterns based on official language specifications:
  - Microsoft C# Language Specification
  - Go Language Specification
  - Rust Language Reference
  - Oracle Java Language Specification
  - Ruby Documentation
  - PHP Language Reference
- NetworkX for graph algorithms

**Issues Resolved:**
- Closes #166 (C# support request)
- Closes #140 (E1.7 MCP tool scrape_codebase)

**Test Results:**
- test_code_analyzer.py: 54 tests passing
- test_dependency_analyzer.py: 43 tests passing
- test_codebase_scraper.py: 21 tests passing
- Total execution: ~0.41s

🚀 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-02 21:28:21 +03:00
yusyus
aa6bc363d9 feat(C2.6): Add dependency graph analyzer with NetworkX
- Add NetworkX dependency to pyproject.toml
- Create dependency_analyzer.py with comprehensive functionality
- Support Python, JavaScript/TypeScript, and C++ import extraction
- Build directed graphs using NetworkX DiGraph
- Detect circular dependencies with NetworkX algorithms
- Export graphs in multiple formats (JSON, Mermaid, DOT)
- Add 24 comprehensive tests with 100% pass rate

Features:
- Python: AST-based import extraction (import, from, relative)
- JavaScript/TypeScript: ES6 and CommonJS parsing (import, require)
- C++: #include directive extraction (system and local headers)
- Graph statistics (total files, dependencies, cycles, components)
- Circular dependency detection and reporting
- Multiple export formats for visualization

Architecture:
- DependencyAnalyzer class with NetworkX integration
- DependencyInfo dataclass for tracking import relationships
- FileNode dataclass for graph nodes
- Language-specific extraction methods

Related research:
- NetworkX: Standard Python graph library for analysis
- pydeps: Python-specific analyzer (inspiration)
- madge: JavaScript dependency analyzer (reference)
- dependency-cruiser: Advanced JS/TS analyzer (reference)

Test coverage:
- 5 Python import tests
- 4 JavaScript/TypeScript import tests
- 3 C++ include tests
- 3 graph building tests
- 3 circular dependency detection tests
- 3 export format tests
- 3 edge case tests
2026-01-01 23:30:46 +03:00