Socket
Book a DemoInstallSign in
Socket

electron-channel-doctor

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-channel-doctor

Advanced Script Doctor: Surgical code cleanup + Electron IPC channel management + Security vulnerability detection. Remove unused code, fix missing channels, and detect IPC security issues with AI-powered analysis.

latest
Source
npmnpm
Version
2.4.0
Version published
Weekly downloads
6
-76%
Maintainers
1
Weekly downloads
ย 
Created
Source

๐Ÿฉบ Electron Channel Doctor - The Ultimate Script Doctor

Advanced Code Housekeeping & Surgical Cleanup Tool
Plus: Automate Electron IPC invoke channel management & Security Vulnerability Detection

npm version License: MIT

๐Ÿš€ What Makes This Special?

What started as a simple IPC channel manager has evolved into a comprehensive code housekeeping powerhouse that can perform surgical code cleanup with precision, now with advanced security vulnerability detection!

๐Ÿฉบ Script Doctor - Advanced Code Surgery

Automatically detect and surgically remove:

  • ๐Ÿ”ช Unused Functions - Dead functions cluttering your codebase
  • ๐Ÿ“ฆ Unused Imports - ES6/CommonJS imports that serve no purpose
  • ๐ŸŽจ Unused CSS Classes - Styles that aren't used anywhere
  • ๐Ÿ’€ Dead Code Paths - Unreachable code after returns/throws
  • ๐Ÿ”„ Duplicate Code - Repeated blocks that should be refactored
  • ๐Ÿ”ฅ Complex Functions - Functions that need breaking down

Get instant insights:

  • ๐Ÿฅ Health Score (0-100) for your entire codebase
  • ๐Ÿ“Š Bundle Size Estimation - See how much weight you can lose
  • ๐Ÿ“‹ Safe Backups - Automatic backups before any surgery
  • ๐ŸŽฏ Actionable Recommendations - Know exactly what to do next

๐Ÿ”’ NEW: Security Vulnerability Detection

Protect your Electron app from critical security issues:

  • ๐Ÿšจ Context Isolation Bypass - Detect attempts to break security boundaries
  • ๐Ÿ›ก๏ธ Dangerous API Exposure - Find Node.js APIs exposed to renderer
  • โš ๏ธ Unvalidated IPC Handlers - Catch injection vulnerabilities
  • ๐Ÿ”“ Insecure Configuration - nodeIntegration, webSecurity issues
  • ๐Ÿ”‘ Sensitive Data Leaks - Passwords, tokens, API keys in IPC
  • ๐Ÿ“ก Sender Validation - Missing frame/sender verification (CVE-2022-29247)

Based on 2024 security research and real CVEs:

  • CVE-2024-39698 - Code signature validation bypass
  • CVE-2022-29247 - IPC access without proper validation
  • And many more Electron-specific vulnerabilities

๐Ÿ”ง Bonus: Electron IPC Channel Management

  • โœ… Auto-detect electronAPI.invoke() calls in your code
  • ๐Ÿ” Validate against preload.js whitelist
  • ๐Ÿšจ Prevent "Invalid invoke channel" errors
  • ๐Ÿ› ๏ธ Auto-fix missing channels with backups

๐Ÿ“ฆ Installation

# Global installation (recommended)
npm install -g electron-channel-doctor

# Or use with npx (no installation needed)
npx electron-channel-doctor

๐Ÿฉบ Script Doctor Usage

Get a Health Checkup

# Comprehensive health analysis
electron-channel-doctor health

# Focus on specific file types
electron-channel-doctor health --source "src/**/*.js" --css "styles/**/*.css"

# Get detailed verbose output
electron-channel-doctor health --verbose

# Export as JSON for CI/CD
electron-channel-doctor health --json > health-report.json

Example Output:

๐Ÿฉบ Script Doctor: Performing comprehensive health checkup...

๐Ÿฅ Overall Health Score: 67/100

๐Ÿ“Š Code Health Summary:
   Unused Functions: 12
   Unused Imports: 8
   Unused CSS Classes: 23
   Dead Code Paths: 3
   Duplicate Code Blocks: 2
   Complex Functions: 5
   Missing IPC Channels: 1
   Unused IPC Channels: 4

๐Ÿ’ก Recommendations:
   ๐Ÿšจ Remove 12 unused functions to reduce bundle size
   โš ๏ธ Code health needs improvement. Consider running surgery.

๐ŸŽฏ Recommended Next Steps:
   1. Run surgical cleanup
      Command: npx electron-channel-doctor surgery
      Automatically remove unused code with backup

Perform Code Surgery

# Full surgical cleanup (with automatic backup)
electron-channel-doctor surgery

# See what would be removed (dry run)
electron-channel-doctor surgery --dry-run

# Selective surgery (only specific operations)
electron-channel-doctor surgery --operations "unused-functions,unused-imports"

# Disable backup (NOT recommended)
electron-channel-doctor surgery --no-backup

# Verbose surgery with detailed output
electron-channel-doctor surgery --verbose

๐Ÿ›ก๏ธ NEW: Safe Mode vs Legacy Mode

Version 2.3.0+ introduces Safe Mode - a complete rewrite of the code modification engine that uses AST-based transformations instead of regex patterns.

# Safe mode is ON by default
electron-channel-doctor surgery

# Explicitly enable safe mode features
electron-channel-doctor surgery --conservative --max-changes 10

Safe Mode Features:

  • โœ… AST-based modifications - Understands JavaScript syntax properly
  • โœ… Syntax validation - Every change is validated before saving
  • โœ… Conservative changes - Skips risky modifications
  • โœ… Change limits - Max 10 changes per file by default
  • โœ… Detailed error reporting - Know exactly what went wrong
  • โœ… Safety score - Track how safe your surgery was
# โš ๏ธ WARNING: May break your code!
electron-channel-doctor surgery --no-safe-mode

# Disable ALL safety features (VERY DANGEROUS!)
electron-channel-doctor surgery --no-safe-mode --no-backup --no-validate-syntax

Legacy Mode Issues:

  • โŒ Regex-based - Can't understand JavaScript syntax
  • โŒ No validation - May create syntax errors
  • โŒ Aggressive - Can destroy code structure
  • โŒ No safety nets - You're on your own

Example of Legacy Mode Destruction:

// BEFORE (Working code)
const logger = require('../../utils/debugLogger');
return number.toString().padStart(2, '0');

// AFTER (Broken by legacy mode)
const logger = require('../../utils/debugLogger'function showTwoDigits(number) {
return number.toString().padStart(2, '0'}

Safe Mode in Action

$ electron-channel-doctor surgery --dry-run

๐Ÿฅ Script Doctor: Preparing for surgical code cleanup...

๐Ÿ›ก๏ธ  Using SAFE MODE with:
   โœ… AST-based modifications
   โœ… Syntax validation
   โœ… Conservative changes
   โœ… Automatic backups

๐Ÿ” Safe Surgery Preview:

๐Ÿ“Š Expected Results:
   Files to be analyzed: 45
   Files to be modified: 12
   Syntax errors prevented: 3
   Safety score: 95/100

โš ๏ธ  Potential Issues:
   - src/utils/helpers.js: Parse error: Unexpected token (Skipping file)
   - src/legacy/old-code.js: Too many changes needed (15 > 10 limit)

๐Ÿ’ก Run without --dry-run to perform actual surgery

Example Surgery Output:

๐Ÿฅ Script Doctor: Preparing for surgical code cleanup...

๐Ÿ“‹ Created backup in: .electron-channel-doctor-backups/backup-2024-01-15T10-30-00
๐Ÿ”ง Run 'sh .electron-channel-doctor-backups/backup-2024-01-15T10-30-00/RESTORE.sh' to restore if needed

๐Ÿ”ช Removing 12 unused functions...
๐Ÿ“ฆ Removing 8 unused imports...
๐ŸŽจ Removing 23 unused CSS classes...
๐Ÿ’€ Removing 3 dead code paths...

๐ŸŽ‰ Surgery completed successfully!

๐Ÿ“Š Surgery Statistics:
   Files Modified: 15
   Lines Removed: 247
   Functions Removed: 12
   Imports Removed: 8
   CSS Classes Removed: 23
   Dead Code Removed: 3
   Estimated Bundle Size Reduction: 8.7 KB

โš ๏ธ Post-Surgery Recommendations:
   ๐Ÿงช Run your test suite to ensure no functionality was broken
   ๐Ÿ—๏ธ Test your build process to verify everything still works
   ๐Ÿš€ Bundle size reduced by ~8.7 KB! Consider measuring actual improvement.

Generate Detailed Reports

# Generate JSON health report
electron-channel-doctor report --format json --output health-report.json

# Generate Markdown report  
electron-channel-doctor report --format markdown --output HEALTH.md

# Output to console
electron-channel-doctor report

๐Ÿ”’ Security Analysis

Scan for Security Vulnerabilities

# Full security scan with all vulnerability types
electron-channel-doctor security

# Verbose output showing all issues (including low severity)
electron-channel-doctor security --verbose

# Export security report
electron-channel-doctor security --output security-report.json

# Custom file patterns
electron-channel-doctor security \
  --main "main.js,electron/**/*.js" \
  --renderer "src/**/*.js,renderer/**/*.js" \
  --preload "preload.js"

Example Security Scan Output:

๐Ÿ”’ Security Analyzer: Scanning for Electron IPC vulnerabilities...

๐Ÿ›ก๏ธ  Security Score: 45/100

๐Ÿ“Š Vulnerability Summary:
   ๐Ÿšจ Critical: 3
   โš ๏ธ  High: 2
   โšก Medium: 4
   ๐Ÿ’ก Low: 1

๐Ÿšจ CRITICAL Vulnerabilities:

   [insecure-node-integration] nodeIntegration enabled - major security risk
   File: main.js (line 12)
   Fix: Set nodeIntegration: false and use contextBridge
   Reference: Enables attacks like CVE-2022-29247

   [missing-context-bridge] Preload script not using contextBridge API
   File: preload.js
   Fix: Use contextBridge.exposeInMainWorld for secure IPC

   [dangerous-api-exposure] IPC handler 'file-operation' exposes dangerous API: fs
   File: main.js (line 45)
   Fix: Never expose Node.js system APIs directly via IPC
   Reference: Common attack vector in Electron apps

โš ๏ธ  HIGH Vulnerabilities:

   [unvalidated-ipc-handler] IPC handler 'get-user-data' lacks input validation
   File: main.js (line 67)
   Fix: Add input validation to prevent injection attacks
   Reference: Related to CVE-2022-29247

๐Ÿ›ก๏ธ  Security Recommendations:

   ๐Ÿšจ Fix critical vulnerabilities immediately
      Critical vulnerabilities can lead to RCE or data theft

   ๐Ÿšจ Disable nodeIntegration and enable contextIsolation
      This is the most important security configuration

๐Ÿ“š Security Resources:
   โ€ข https://www.electronjs.org/docs/latest/tutorial/security
   โ€ข https://github.com/electron/electron/security/advisories
   โ€ข OWASP Electron Security Guidelines

๐Ÿ”ง IPC Channel Management (Bonus Feature)

# Check for IPC channel issues
electron-channel-doctor check

# Auto-fix missing channels  
electron-channel-doctor fix

# List all channels
electron-channel-doctor list

# See what would be fixed (dry run)
electron-channel-doctor fix --dry-run

๐ŸŽฏ Real-World Examples

Before Script Doctor

Your codebase might have:

// unused-helper.js - ENTIRE FILE UNUSED
function calculateTax(amount) { return amount * 0.1; }
function formatCurrency(num) { return '$' + num; }

// main.js  
import { calculateTax, formatCurrency } from './unused-helper.js';
import { moment } from 'moment'; // UNUSED IMPORT

function processOrder(order) {
    // Dead code after return
    return order.total;
    console.log('This never executes'); // DEAD CODE
    
    const tax = calculateTax(order.total); // UNREACHABLE
}

// Duplicate code block in multiple files
if (user.isLoggedIn && user.hasPermission) {
    showDashboard();
    updateUserActivity();
    logAnalytics('dashboard_view');
}

// styles.css
.old-button { color: red; } /* UNUSED CSS CLASS */
.deprecated-modal { display: none; } /* UNUSED CSS CLASS */

After Script Doctor Surgery

// unused-helper.js - FILE REMOVED ENTIRELY โœ‚๏ธ

// main.js  
function processOrder(order) {
    return order.total; // Clean and simple!
}

// Duplicate code extracted to reusable function โœจ
function showUserDashboard(user) {
    if (user.isLoggedIn && user.hasPermission) {
        showDashboard();
        updateUserActivity(); 
        logAnalytics('dashboard_view');
    }
}

// styles.css - UNUSED CLASSES REMOVED โœ‚๏ธ
/* Only the CSS you actually use remains */

Result:

  • ๐ŸŽฏ Cleaner codebase with only code that serves a purpose
  • ๐Ÿ“ฆ Smaller bundle size - faster loading times
  • ๐Ÿ› Fewer potential bugs - less code to maintain
  • ๐Ÿ” Easier debugging - no distractions from dead code

๐Ÿฅ Health Scoring System

Your project gets a 0-100 health score based on:

Score RangeHealth StatusMeaning
90-100๐ŸŽ‰ ExcellentProfessional-grade codebase
70-89๐Ÿ‘ GoodMinor improvements needed
50-69โš ๏ธ Needs WorkSurgery recommended
0-49๐Ÿšจ CriticalImmediate attention required

Scoring factors:

  • Unused Functions: -2 points each (max -20)
  • Unused Imports: -1 point each (max -10)
  • Dead Code Paths: -3 points each (max -15)
  • Duplicate Code: -2 points each (max -10)
  • Complexity Issues: -1 point each (max -15)
  • IPC Channel Issues: -1 to -2 points each (max -20)
  • ๐Ÿ”’ Security Vulnerabilities (NEW):
    • Critical: -10 points each (max -30)
    • High: -5 points each (max -20)
    • Medium: -2 points each (max -10)
    • Low: -0.5 points each (max -5)

โš™๏ธ Configuration Options

Command Line Options

# Custom file patterns
electron-channel-doctor health \
  --source "src/**/*.{js,jsx,ts,tsx}" \
  --css "styles/**/*.{css,scss,sass}" \
  --html "templates/**/*.html"

# Custom preload path (for IPC features)
electron-channel-doctor health --preload "main/preload.js"

# Control backup behavior
electron-channel-doctor surgery --no-backup  # DANGEROUS!

# Selective operations  
electron-channel-doctor surgery --operations "unused-functions,dead-code-paths"

Configuration File

Create .channel-doctor.json:

{
  \"preloadPath\": \"electron/preload.js\",
  \"jsPattern\": \"src/**/*.{js,jsx,ts,tsx}\",
  \"cssPattern\": \"styles/**/*.{css,scss,sass}\",
  \"htmlPattern\": \"templates/**/*.html\",
  \"ignorePatterns\": [
    \"**/node_modules/**\",
    \"**/dist/**\",
    \"**/test/**\",
    \"**/*.min.js\"
  ]
}

๐Ÿ”„ CI/CD Integration

GitHub Actions

name: Code Health Check
on: [push, pull_request]

jobs:
  health-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: '18'
      - run: npm install -g electron-channel-doctor
      
      # Health check (fails if score < 70)
      - run: |
          SCORE=$(electron-channel-doctor health --json | jq '.healthScore')
          echo \"Health Score: $SCORE\"
          if [ \"$SCORE\" -lt 70 ]; then
            echo \"โŒ Health score too low: $SCORE/100\"
            exit 1
          fi
      
      # Generate and upload health report
      - run: electron-channel-doctor report --format markdown --output HEALTH.md
      - uses: actions/upload-artifact@v3
        with:
          name: health-report
          path: HEALTH.md

npm scripts

{
  \"scripts\": {
    \"health\": \"electron-channel-doctor health\",
    \"security\": \"electron-channel-doctor security\",
    \"surgery\": \"electron-channel-doctor surgery --dry-run\",
    \"cleanup\": \"electron-channel-doctor surgery\",
    \"health-report\": \"electron-channel-doctor report --format markdown --output HEALTH.md\",
    \"security-report\": \"electron-channel-doctor security --output security-report.json\",
    \"precommit\": \"electron-channel-doctor health --json | jq -e '.healthScore >= 70'\",
    \"security-check\": \"electron-channel-doctor security --json | jq -e '.summary.critical == 0'\"
  }
}

๐Ÿ› ๏ธ API Usage

const { 
  ChannelDoctor, 
  UnusedCodeDetector, 
  CodeSurgeon,
  SafeCodeSurgeon,  // NEW: AST-based safe surgeon
  SecurityAnalyzer,
  checkHealth,
  performSurgery,
  generateHealthReport,
  analyzeSecurity
} = require('electron-channel-doctor');

// Quick health check
const healthReport = await checkHealth({
  jsPattern: 'src/**/*.js',
  cssPattern: 'styles/**/*.css'
});

console.log(`Health Score: ${healthReport.healthScore}/100`);

// Perform surgery (uses Safe Mode by default)
if (healthReport.healthScore < 70) {
  const surgeryReport = await performSurgery({
    safeMode: true, // Default: true
    validateSyntax: true, // Default: true
    conservative: true, // Default: true
    maxChangesPerFile: 10, // Default: 10
    operations: ['unused-functions', 'unused-imports']
  });
  
  console.log(`Removed ${surgeryReport.summary.totalLinesRemoved} lines`);
  console.log(`Safety score: ${surgeryReport.summary.safetyScore}/100`);
}

// Direct usage of SafeCodeSurgeon (NEW)
const safeSurgeon = new SafeCodeSurgeon({
  projectRoot: process.cwd(),
  dryRun: false,
  validateSyntax: true,
  conservative: true,
  maxChangesPerFile: 5,
  verbose: true
});

const analysisReport = await doctor.performHealthCheckup();
const safeReport = await safeSurgeon.performSafeSurgery(analysisReport);

if (safeReport.errors.length > 0) {
  console.error('Some files could not be safely modified:');
  safeReport.errors.forEach(err => {
    console.error(`- ${err.file}: ${err.error}`);
  });
}

// Security analysis
const securityReport = await analyzeSecurity({
  mainProcess: ['main.js', 'electron/**/*.js'],
  rendererProcess: ['src/**/*.js', 'renderer/**/*.js']
});

if (securityReport.summary.critical > 0) {
  console.error('Critical security vulnerabilities found!');
  process.exit(1);
}

// Advanced usage with custom configuration
const doctor = new ChannelDoctor({
  jsPattern: 'src/**/*.{js,tsx}',
  verbose: true
});

const analysis = await doctor.performHealthCheckup();

// Choose between safe and legacy surgery
const surgery = await doctor.performCodeSurgery({
  safeMode: true, // Use AST-based safe mode (recommended)
  // safeMode: false, // Use regex-based legacy mode (dangerous)
});

const security = await doctor.analyzeSecurityVulnerabilities();

๐ŸŒŸ Success Stories

"Reduced our bundle size by 15% in one command!"
- React developer who used Script Doctor on a legacy codebase

"Found 47 unused functions we didn't even know existed"
- Team lead who ran health check on 6-month-old project

"The health scoring system helps us maintain code quality over time"
- DevOps engineer using it in CI/CD pipeline

๐Ÿ” Safety Features

Automatic Backups

  • ๐Ÿ“‹ Complete backup of all modified files before surgery
  • ๐Ÿ“… Timestamped folders for easy identification
  • ๐Ÿ”ง One-click restore script included
  • ๐Ÿ’พ Backup location clearly displayed

Safe Defaults

  • โšก Dry run mode available for all operations
  • ๐Ÿ”’ Safe mode enabled by default (creates backups)
  • ๐ŸŽฏ Selective operations - choose what to clean
  • ๐Ÿ“Š Verbose logging to see exactly what's happening

Smart Detection

  • ๐Ÿง  Context-aware - understands usage patterns
  • ๐Ÿ” Cross-file analysis - tracks usage across your entire codebase
  • ๐Ÿ›ก๏ธ False positive prevention - conservative approach to avoid breaking code
  • ๐Ÿ“ Infrastructure preservation - keeps essential utility functions

๐Ÿ‘ฉโ€๐Ÿ’ป For Developers: Architecture & Testing

Dependency Injection Pattern

As of version 2.2.1, Electron Channel Doctor uses a dependency injection pattern for file system operations, making it highly testable and maintainable:

const { ChannelDoctor, FileSystem, MockFileSystem } = require('electron-channel-doctor');

// Production usage (uses real file system)
const doctor = new ChannelDoctor({
  projectRoot: '/path/to/project',
  jsPattern: 'src/**/*.js'
});

// Testing usage (uses mock file system)
const mockFiles = {
  '/test/project/src/app.js': `electronAPI.invoke('test-channel');`,
  '/test/project/electron/preload.js': `const validInvokeChannels = ['test-channel'];`
};

const testDoctor = new ChannelDoctor({
  projectRoot: '/test/project',
  fs: new MockFileSystem(mockFiles)  // Inject mock file system
});

FileSystem Abstraction

// Real file system (default)
const fs = new FileSystem();
await fs.readFile('/path/to/file.js');
const files = fs.findFiles('src/**/*.js', '/project/root', ['node_modules/**']);

// Mock file system (for testing)
const mockFs = new MockFileSystem({
  '/project/src/app.js': 'console.log("Hello World");',
  '/project/src/utils.js': 'export const helper = () => {};'
});
await mockFs.readFile('/project/src/app.js'); // Returns mock content
const files = mockFs.findFiles('src/**/*.js', '/project'); // Returns matching mock files

Advanced API Usage with Dependency Injection

const { 
  ChannelDoctor, 
  SecurityAnalyzer, 
  UnusedCodeDetector,
  MockFileSystem 
} = require('electron-channel-doctor');

// Create custom file system for testing
const mockFiles = {
  '/project/main.js': `
    const { BrowserWindow } = require('electron');
    const win = new BrowserWindow({
      webPreferences: { nodeIntegration: true } // Security issue!
    });
  `,
  '/project/src/app.js': `
    electronAPI.invoke('get-user-data');
    electronAPI.invoke('missing-channel');
  `,
  '/project/electron/preload.js': `
    const { contextBridge } = require('electron');
    const validInvokeChannels = ['get-user-data'];
  `
};

// All analyzers support dependency injection
const mockFs = new MockFileSystem(mockFiles);

const channelAnalysis = await new ChannelDoctor({
  projectRoot: '/project',
  fs: mockFs
}).analyze();

const securityAnalysis = await new SecurityAnalyzer({
  projectRoot: '/project',
  fs: mockFs
}).analyze();

const unusedCodeAnalysis = await new UnusedCodeDetector({
  projectRoot: '/project', 
  fs: mockFs
}).analyzeProject();

Testing Your Own Extensions

If you're building on top of Electron Channel Doctor, you can easily test your extensions:

// test/my-extension.test.js
const { MockFileSystem } = require('electron-channel-doctor');

describe('My Extension', () => {
  test('should detect custom patterns', async () => {
    const mockFiles = {
      '/project/custom.js': 'myCustomAPI.call("test");'
    };
    
    const mockFs = new MockFileSystem(mockFiles);
    const result = await myExtension.analyze({
      projectRoot: '/project',
      fs: mockFs  // Use mock instead of real file system
    });
    
    expect(result.patterns).toContain('test');
  });
});

MockFileSystem Features

The MockFileSystem class provides comprehensive file system mocking:

  • Glob Pattern Support: Handles **/*.js, src/**/*.{js,ts}, etc.
  • Path Resolution: Correctly resolves relative and absolute paths
  • File Reading: Returns mock content for specified files
  • Directory Traversal: Simulates real directory structures
  • Error Simulation: Can simulate file not found and permission errors
const mockFs = new MockFileSystem({
  '/project/src/app.js': 'console.log("app");',
  '/project/src/utils/helper.js': 'export const help = () => {};',
  '/project/test/app.test.js': 'describe("app", () => {});'
});

// Supports complex glob patterns
const jsFiles = mockFs.findFiles('src/**/*.js', '/project');
// Returns: ['/project/src/app.js', '/project/src/utils/helper.js']

const allFiles = mockFs.findFiles('**/*.{js,ts}', '/project', ['test/**']);
// Returns: ['/project/src/app.js', '/project/src/utils/helper.js']
// (excludes test directory)

๐Ÿค Contributing

We welcome contributions! This tool has huge potential for expansion:

Ideas for contributors:

  • ๐Ÿ”Œ ESLint plugin integration
  • ๐Ÿ“ TypeScript support improvements
  • ๐ŸŽจ SCSS/SASS advanced parsing
  • ๐Ÿ”ง Framework-specific optimizations (React, Vue, Angular)
  • ๐Ÿ“Š More analysis types (security, performance, accessibility)
  • ๐ŸŒ Web app version for online analysis
git clone https://github.com/LFarmbot/electron-channel-doctor.git
cd electron-channel-doctor
npm install
npm test

๐Ÿ“‹ Roadmap

Phase 1: Core Surgery โœ…

  • Unused function detection & removal
  • Unused import cleanup
  • CSS class analysis
  • Dead code path removal
  • Health scoring system

Phase 2: Advanced Analysis ๐Ÿ”„

  • Security analysis - detect vulnerable patterns โœ…
  • Performance analysis - identify bottlenecks
  • Accessibility analysis - find a11y issues
  • SEO analysis - optimize meta tags & structure

Phase 3: Ecosystem Integration ๐Ÿ“‹

  • VS Code extension - real-time health monitoring
  • ESLint plugin - prevent issues before they happen
  • Webpack plugin - build-time optimization
  • GitHub App - automatic PR analysis

Phase 4: Advanced Surgery ๐Ÿ“‹

  • Refactoring suggestions - automated code improvements
  • Design pattern detection - suggest better architectures
  • Dependency optimization - remove unused npm packages
  • Bundle analysis - deep bundle size optimization

๐Ÿ“„ License

MIT License - see LICENSE file for details.

โค๏ธ Made for Developers, by Developers

This tool was born from real frustration with messy codebases and the manual work of cleaning them up. We believe every developer deserves:

  • ๐ŸŽฏ Clean, maintainable code that's easy to work with
  • ๐Ÿ“ฆ Optimized bundles that load fast for users
  • ๐Ÿ” Insight into code health without manual analysis
  • ๐Ÿ› ๏ธ Automated tools that save time and prevent errors

Found this helpful? โญ Star the repo and share with your team!

๐Ÿฉบ Keep your code healthy - your future self will thank you!

Keywords

code-cleanup

FAQs

Package last updated on 30 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts