Skip to content

limjunda/Project-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Project Analyzer ๐Ÿ”

A powerful, free command-line tool that analyzes your project structure, provides test coverage insights, and uses AI to review your code quality. Perfect for developers who want to quickly understand and improve their codebases.

โœจ Features

  • ๐Ÿ“ Smart Project Structure Analysis - Visualizes your project with color-coded file trees
  • ๐Ÿงช Test Coverage Integration - Automatic Jest coverage reporting
  • ๐Ÿค– AI-Powered Code Review - Uses Google Gemini to identify code smells and suggest improvements
  • ๐Ÿ“Š AI Code Summarization - Get concise summaries of your largest files
  • ๐ŸŽจ Multiple Output Formats - Console (colored), Markdown, and JSON
  • โšก Intelligent Filtering - Respects .gitignore and excludes build artifacts
  • ๐Ÿšจ File Size Warnings - Highlights potentially problematic large files

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8+
  • Google API key (for AI features)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/Project_Analyzer.git
cd Project_Analyzer
  1. Quick setup (recommended):
python setup.py

Or manual setup:

# Install dependencies
pip install -r requirements.txt

# Set up environment file
cp .env.example .env
# Edit .env and add your Google API key

Basic Usage

# Analyze current project structure
python project_analyzer.py

# Generate markdown report
python project_analyzer.py --markdown

# Include test coverage (for Jest projects)
python project_analyzer.py --coverage

# AI-powered code summarization
python project_analyzer.py --summarize

# AI-powered code review
python project_analyzer.py --review

# JSON output for automation
python project_analyzer.py --json

๐Ÿ“– Detailed Usage

Command Line Options

Option Description
--markdown Output results in Markdown format
--json Output results in JSON format
--coverage Run Jest test coverage analysis
--summarize Use AI to summarize key files
--review Use AI to review code for potential improvements

File Size Warnings

The tool automatically identifies potentially problematic files:

  • ๐ŸŸก Yellow Warning: Script files with 400+ lines
  • ๐Ÿ”ด Red Alert: Script files with 550+ lines
  • ๐Ÿ“ Directory Warnings: Folders with 5000+ or 10000+ total lines

Supported Project Types

  • JavaScript/TypeScript (Node.js, React, Vue, etc.)
  • Python projects
  • Any project with common file structures

AI Features Setup

  1. Get a Google API Key:

  2. List available models:

python list_gemini_models.py

๐Ÿ“Š Example Output

Console Output

my-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx (45 lines)
โ”‚   โ”‚   โ””โ”€โ”€ Footer.tsx (32 lines)
โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ””โ”€โ”€ helpers.js (234 lines)
โ”‚   โ””โ”€โ”€ app.py (567 lines) (!!! TOO LARGE !!!)
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ app.test.py (89 lines)
โ””โ”€โ”€ package.json (23 lines)

--- Jest Test Coverage ---
Overall Line Coverage: 78.50%

AI Code Review Example

File 1: src/main.py (456 lines)

Review:
  Positive Points:
    - Good use of type hints throughout the codebase
    - Clear separation of concerns with helper functions
    - Comprehensive error handling

  Refactoring Suggestions:
    - Smell: Long Function
      Explanation: The main() function is 89 lines long, making it hard to understand and test
      Suggestion: Break down main() into smaller, focused functions like parse_arguments(), setup_environment(), and run_analysis()

๐Ÿ› ๏ธ Configuration

Customizing Excluded Directories

Edit the EXCLUDED_DIRS set in project_analyzer.py:

EXCLUDED_DIRS = {"node_modules", ".git", ".vscode", ".idea", "dist", "coverage", "__pycache__"}

File Type Recognition

The tool recognizes these file categories:

  • Script Files: .py, .js, .ts, .tsx, .jsx, .go, .rs, .java, .c, .cpp, etc.
  • Data Files: .json, .csv, .yml, .yaml, .xml, .txt, .md, etc.

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/yourusername/Project_Analyzer.git
cd Project_Analyzer

# Install development dependencies
pip install -r requirements.txt

# Set up pre-commit hooks (if you add them)
pre-commit install

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ› Issues & Support

๐Ÿ™ Acknowledgments

  • Google Gemini AI for powering the code analysis features
  • Jest community for test coverage integration
  • All contributors who help make this tool better

๐Ÿ”ฎ Roadmap

  • Support for more test frameworks (pytest, mocha, etc.)
  • GitHub Actions integration
  • VS Code extension
  • More AI model options
  • Custom rule configuration
  • Web dashboard

Made with โค๏ธ for the developer community

This tool is completely free and open source. Star โญ the repository if you find it useful!

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages