Skip to content

shreydarshan/Smart-Code-Complexity-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Code Complexity Analyzer

A web-based tool that analyzes source code and estimates time complexity using pattern-based logic such as loop detection, recursion tracking, and structural analysis.


Overview

This project is designed to help developers and students understand the efficiency of their code by automatically estimating time complexity and providing useful optimization insights.

It works by analyzing patterns in the code such as loops, nested structures, recursion, and sorting operations.


Features

  • Detects loops and nested loops
  • Estimates time complexity (O(1), O(n), O(n²), etc.)
  • Detects recursion patterns
  • Identifies sorting operations (O(n log n))
  • Provides detailed analysis metrics:
  • Loop count
  • Nesting depth
  • Recursion detection
  • Gives optimization suggestions

Tech Stack

  • Backend: Python (Flask)
  • Frontend: HTML, CSS
  • Logic: Pattern-based code analysis using Python

How It Works

  1. User inputs or pastes code into the web interface
  2. System analyzes:
    • Loop structures
    • Nesting depth
    • Recursion patterns
    • Sorting keywords
  3. Generates:
    • Estimated time complexity
    • Insights and suggestions

How to Run Locally

Follow these steps to run the project on your system:

  1. Clone the repository: git clone https://github.com/shreydarshan/Smart-Code-Complexity-Analyzer.git cd Smart-Code-Complexity-Analyzer
  2. Install dependencies: pip install flask
  3. Run the application: python app.py
  4. Open in browser: Go to: http://127.0.0.1:5000


Author

Shrey Darshan
GitHub: https://github.com/shreydarshan
LinkedIn: https://www.linkedin.com/in/shrey-darshan-69431732a

About

Smart code analysis tool to estimate time complexity using Python and Flask

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors