1.1.1 ⢠Published 9 months ago
@jit017/realtimepr v1.1.1
RealTimePR
A CLI tool for real-time code review and feedback. This tool helps developers get instant feedback on their code quality, best practices, and potential improvements.
š Visit our Website
Features
- Run in your terminal
- Multi-language support (TypeScript, JavaScript, Python, Java, Go)
- Auto-fix capability for common issues
- Project-wide analysis
- Custom rules support
- Accepts any source code file
- Analyzes code quality using ESLint
- Provides suggestions for improvement
- Checks for best practices
- Advanced code analysis:
- Cyclomatic complexity
- Cognitive complexity
- Maintainability index
- Code smells detection
- Long function detection
- Magic number detection
- Commented code detection
- Function complexity and structure
- Code duplication detection
- Code organization checks
- Code style verification
- Code quality metrics
- Security analysis:
- Input validation
- SQL injection prevention
- XSS protection
- Secure coding practices
- Performance analysis:
- Memory usage optimization
- CPU usage optimization
- Network optimization
- Resource management
- Style analysis:
- Code formatting
- Naming conventions
- Documentation standards
- Code organization
- Dependency analysis:
- Package version checks
- Security vulnerabilities
- Outdated dependencies
- Unused dependencies
- Optional: Use OpenAI for deeper feedback (requires API key)
Installation
You can install RealTimePR globally using npm:
npm install -g @jit017/realtimeprOr use it directly with npx:
npx @jit017/realtimepr <file> --type <linting|best-practices|analysis|security|performance|style|dependencies>Usage
Run the CLI on a file (free features):
realtimepr <file> --type <linting|best-practices|analysis|security|performance|style|dependencies>For example:
# Basic linting
realtimepr sample.js --type linting
# Best practices check
realtimepr sample.js --type best-practices
# Advanced code analysis
realtimepr sample.js --type analysis
# Security analysis
realtimepr sample.js --type security
# Performance analysis
realtimepr sample.js --type performance
# Style analysis
realtimepr sample.js --type style
# Dependency analysis
realtimepr sample.js --type dependencies
# Project-wide analysis
realtimepr . --type best-practices
# Auto-fix issues
realtimepr sample.js --type best-practices --fixAnalysis Features
The tool provides comprehensive analysis across multiple dimensions:
Multi-language Support
- TypeScript (.ts, .tsx)
- JavaScript (.js, .jsx)
- Python (.py)
- Java (.java)
- Go (.go)
- Automatic language detection
- Language-specific rules and fixes
Auto-fix Capability
- Automatic fixes for common issues
- Language-specific fixes
- Fix suggestions with explanations
- Configurable fix rules
Project-wide Analysis
- Analyze entire projects
- File pattern matching
- Language-specific analysis
- Summary statistics
- Issue categorization
Custom Rules Support
- Create custom rules
- Rule sets for different categories
- Automatic fixes for rules
- Rule validation
- Default rule sets for common issues
Code Analysis
- Complexity Metrics:
- Cyclomatic complexity (measures code complexity)
- Cognitive complexity (measures code readability)
- Maintainability index (overall code quality score)
- Code Smells Detection:
- Long functions (>20 lines)
- Magic numbers
- Commented out code
- Function complexity and structure
- Code duplication
- Code organization
- Code style
- Code quality
Security Analysis
- Input validation checks
- SQL injection prevention
- XSS protection
- Secure coding practices
- Authentication and authorization
- Data encryption
- Secure communication
Performance Analysis
- Memory usage optimization
- CPU usage optimization
- Network optimization
- Resource management
- Caching strategies
- Database optimization
- Async operation handling
Style Analysis
- Code formatting
- Naming conventions
- Documentation standards
- Code organization
- Modern JavaScript/TypeScript features
- Best practices adherence
Dependency Analysis
- Package version checks
- Security vulnerabilities
- Outdated dependencies
- Unused dependencies
- Dependency conflicts
- License compliance
Optional OpenAI Integration
If you have an OpenAI API key and want deeper analysis, you can use:
realtimepr <file> --type <linting|best-practices|analysis|security|performance|style|dependencies> --openaiNote: The OpenAI integration is completely optional. The tool works perfectly fine without it, providing free code analysis using ESLint and built-in best practices checks.
Development
- Clone the repository:
git clone https://github.com/Jit017/realtimepr.git
cd realtimepr- Install dependencies:
npm install- Build the project:
npm run build- Run the CLI:
npm start <file> --type <linting|best-practices|analysis|security|performance|style|dependencies>Extending
You can extend this tool by:
- Adding new feedback types
- Improving suggestions
- Changing output formatting
- Adding more LLMs
- Customizing analysis rules
- Adding new analysis categories
- Adding support for new languages
- Creating custom rule sets
- Implementing new auto-fix capabilities
License
This project is licensed under the MIT License.