Hybrid AI Code Clone Detection and Similarity AnalysisHybrid AI Code Clone Detection and Similarity Analysis
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Hybrid Code Clone Detection System | AI-Powered Code Similarity Analysis
Developed a full-stack web application that identifies duplicated and logically similar code using a hybrid detection engine combining traditional algorithms with deep learning. The system helps developers and educators identify code duplication, assess similarity, and improve software maintainability.
Key Features
Type-1 Detection — Textual Similarity: Identifies exact or near-exact code matches using difflib, with comments and unnecessary whitespace removed.
Type-2 Detection — Token Similarity: Normalizes identifiers and variable names to detect copied code despite renaming and formatting changes.
Type-3 Detection — Structural Similarity: Extracts control-flow keywords and structural patterns to identify code with added, removed, or modified statements.
Type-4 Detection — Semantic Similarity: Uses CodeBERT embeddings and cosine similarity to identify logically equivalent code with different implementations.
Hybrid Similarity Scoring: Combines the four detection scores using weighted aggregation to produce an overall similarity percentage.
Interactive Visualizations: Displays similarity comparisons through bar charts and radar charts using Chart.js.
Performance Metrics: Reports individual algorithm execution times alongside similarity scores.
Robust Processing: Includes input validation, exception handling, and a fallback mechanism when the semantic model is unavailable.
Web-Based Interface: Provides a neon-themed interface for entering two code snippets and viewing detailed analysis results.
Tech Stack: Python, Flask, CodeBERT, Hugging Face Transformers, HTML, CSS, JavaScript, Chart.js, and REST APIs.
Applications: Code duplication analysis, academic plagiarism screening, software quality assurance, code review, and software maintenance.
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started