@guntur-developer/code-rover
v0.1.0
Published
CLI tool for scanning and analyzing JavaScript/TypeScript codebases
Downloads
195
Maintainers
Readme
🐾 Code-Rover
Conquer Any Codebase.
Your Code, Offroad Ready.
CLI tool untuk scanning & analisis codebase JavaScript/TypeScript.
Code-Rover menjelajah seluruh project-mu dan memberikan laporan kesehatan yang jelas.
Fitur
- 📊 Statistik project — total files, lines, functions, classes
- 📦 Dependency analysis — mana yang terpakai, mana yang menganggur
- 🔍 Code smells —
console.log,TODO,FIXME, TypeScriptany - 🔄 Circular dependency detection
- 💚 Health Score (0-10) + rekomendasi perbaikan
- 👀 Watch mode — re-scan otomatis saat file berubah
- 📄 JSON output — siap untuk CI/CD
- ⚙️ Configurable via
.code-roverrc
Install
# Global
npm install -g code-rover
# Atau langsung pakai npx (tanpa install)
npx code-rover scanQuick Start
cd your-project
code-rover scanCommands
# Scan current directory
code-rover scan
# Scan specific path
code-rover scan --path ./src
# JSON output
code-rover scan --json
# Save report to file
code-rover scan --output report.json
# Summary only (health score + critical issues)
code-rover scan --summary
# Disable colors
code-rover scan --no-color
# Watch mode
code-rover watch
code-rover watch --path ./src
# Generate default config
code-rover initConfiguration (.code-roverrc)
Jalankan code-rover init untuk membuat file config default.
{
"ignorePatterns": [
"**/node_modules/**",
"**/dist/**",
"**/build/**",
"**/*.test.js",
"**/*.spec.ts",
"**/*.d.ts"
],
"maxLinesPerFile": 300,
"alertOnConsoleLog": true,
"alertOnAnyType": true,
"alertOnTodo": true,
"excludeDependencies": ["typescript", "@types/*"],
"healthScore": {
"unusedDepsPenalty": 0.5,
"consoleLogPenalty": 0.3,
"anyTypePenalty": 0.4,
"circularPenalty": 1.5,
"largeFilePenalty": 0.2
},
"extensions": [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"]
}Contoh Output
═══════════════════════════════════════════
🐾 CODE-ROVER REPORT
═══════════════════════════════════════════
Project : my-app
Path : /home/user/my-app
💚 HEALTH SCORE
6.4/10 💛 Fair. Some refactoring would help.
📊 STATISTIK DASAR
Total files : 87
Total lines : 12,450
Total functions : 312
Total classes : 24
Total imports : 198
📦 DEPENDENCIES
...
⚠️ Dependencies yang tidak terpakai:
- lodash
- moment
🔍 CODE SMELLS
console.log / warn / error : 34 🟡
TODO comments : 9 🟡
TypeScript 'any' : 17 🔴
🔄 CIRCULAR DEPENDENCIES DETECTED!
1. src/services/user.js ↔ src/models/User.js
📄 TOP 5 FILES TERBESAR
1. src/services/orderService.js - 456 lines 🔴
...CI/CD Example (GitHub Actions)
- name: Code-Rover Scan
run: npx code-rover scan --json --output code-rover-report.json
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: code-rover-report
path: code-rover-report.jsonTech Stack
| Component | Library | |------------------|----------------------| | Parser | @babel/parser + traverse | | CLI | Commander.js | | Styling | Chalk + cli-table3 | | Spinner | Ora | | File watching | Chokidar | | Glob | glob |
Development
git clone https://github.com/yourusername/code-rover.git
cd code-rover
npm install
npm link # biar bisa panggil `code-rover` di mana saja
code-rover scanRoadmap
v0.1.0 (current)
- [x] Basic JS/TS scanning
- [x] Dependency detection (used / unused)
- [x] Code smells
- [x] Circular dependency detection
- [x] Health score + recommendations
- [x] JSON + watch mode
v0.2.0
- [ ] Auto-fix suggestions
- [ ] HTML report
- [ ] Git-aware scan (hanya file yang berubah)
- [ ] Custom rules
v0.3.0
- [ ] VS Code extension
- [ ] Support Python / Go / Rust
- [ ] Official GitHub Action
License
MIT
🐾 Code-Rover — Menjelajah kode dengan gaya Land Rover.
"Conquer Any Codebase."
