
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
codeinsights
Advanced tools
A suite of tools for analyzing and improving codebase quality.
scripts/
├── config/ # Shared configuration
│ └── analysis_config.js # Configuration management
│
├── utils/ # Shared utilities
│ ├── file_utils.js # File finding utilities
│ ├── code_analysis.js # Code pattern analysis utilities
│ ├── code_preprocessor.js # Code preprocessing utilities
│ ├── report_generator.js # Report generation utilities
│ └── index.js # Entry point for all utilities
│
├── analyze_all.js # Main entry point for running all analyses
├── analyze_codebase.js # Codebase structure analysis
├── check_imports.js # Import usage analysis
└── refactor_complexity.js # Code complexity analysis and refactoring suggestions
npm install
Run comprehensive analysis:
npm run analyze
Or run individual checks:
# Check for unused imports
npm run check-imports
# Analyze codebase structure
npm run analyze-codebase
# Analyze code complexity
npm run analyze-complexity
All scripts support the following options:
--exclude-dirs: Comma-separated list of directories to exclude (default: node_modules,.git)--extensions: Comma-separated list of file extensions to analyze (default: .js,.ts,.jsx,.tsx)--reports-dir: Directory to save reports (default: reports)Complexity analysis also supports:
--complexity-threshold: Cyclomatic complexity threshold (default: 10)--max-function-length: Maximum function length in statements (default: 30)All reports are saved to the reports directory as JSON files:
unused_imports_report.json: List of unused importscodebase_analysis_report.json: Codebase structure analysisrefactoring_suggestions.json: Complexity analysis and refactoring suggestionsThe codebase follows these architectural principles:
A concise code analysis CLI tool that helps you improve your codebase by analyzing:
# Global installation
npm install -g codestats
# Or run with npx
npx codestats
# Analyze the current project directory
codestats
# Analyze a specific directory
codestats -d ./my-project
# Specify extensions to analyze
codestats -e .js,.ts,.jsx,.tsx
# Exclude specific directories
codestats -x node_modules,.git,dist,build
# Quiet mode (minimal output)
codestats -q
# Help
codestats --help
═════════════════════════════════════
📊 CODEBASE ANALYSIS SUMMARY
═════════════════════════════════════
Files Analyzed: 42
Average Complexity: 5.3
Complex Functions: 8/127
Documentation: 62.5%
Undocumented Functions: 24
Redundant Patterns: 6
Potential LOC Savings: 83
Unused Imports: 12
═════════════════════════════════════
🔥 MOST COMPLEX FUNCTIONS:
1. processData in main.js:127 [18]
2. renderComponent in component.js:48 [16]
3. calculateTotals in utils.js:92 [14]
4. validateInput in validators.js:35 [13]
5. parseConfig in config.js:65 [12]
📁 MOST COMPLEX FILES:
1. main.js - 12.5 avg complexity (8 functions)
2. validators.js - 9.3 avg complexity (5 functions)
3. utils.js - 7.8 avg complexity (12 functions)
📝 UNDOCUMENTED FUNCTIONS:
1. formatData in formatter.js:25
2. validateInput in validator.js:42
3. parseConfig in config.js:18
... and 21 more
🔄 REDUNDANT CODE PATTERNS:
1. utility pattern appears 5 times (41 lines savable)
Snippet: function formatDate(date) { return date.toISOString().split('T')[0]; }
Appears in:
- utils.js:45
- helpers.js:23
- formatter.js:12
2. operation pattern appears 3 times (24 lines savable)
Snippet: data.filter(item => item.active).map(item => item.value).reduce((a, b) => a + b, 0)
Appears in:
- main.js:89
- reports.js:56
- dashboard.js:102
📦 UNUSED IMPORTS:
main.js:
- fs (line 3)
- path (line 4)
utils.js:
- moment (line 2)
... and 9 more
💡 RECOMMENDATIONS:
• Refactor complex functions to improve maintainability
• Improve documentation coverage with JSDoc comments
• Extract repeated patterns into shared utilities
• Remove unused imports to clean up code
bin/
└── index.js # CLI entry point
lib/
├── analyzer.js # Main analysis orchestration
├── core.js # Core analysis functions
└── utils/ # Utility functions
├── complexity.js # Complexity calculation
└── parser.js # Code parsing utilities
MIT
FAQs
Concise code quality analysis CLI tool
We found that codeinsights demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.