WeSearch

Find-dup-defs – find duplicated Python code at the speed of light

·7 min read · 0 reactions · 0 comments · 14 views
#python#coding#software-development
Find-dup-defs – find duplicated Python code at the speed of light
TL;DR · WeSearch summary

Find-dup-defs is a tool designed to identify duplicated Python code quickly and efficiently. It analyzes code for duplicate definitions and suggests which ones to refactor first, using a unique scoring system. The tool has shown a significant increase in copy-pasted lines in codebases, highlighting the need for better code management practices.

Key facts
About this source

Hacker News (Newest) files mainly under programming. We currently carry 5,257 of its stories.

Original article
GitHub
Read full at GitHub →
Opening excerpt (first ~120 words) tap to expand

find-dup-defs Find the copy-pasted code your linter can't — and tell you which copies to refactor first. Duplicate & near-duplicate definitions — functions, methods, classes, constants, type aliases — clustered by structural AST canonicalization, ranked by a normalized Thickness score, graded ERROR / WARNING / INFO, with auto-suggested project-specific noise filters out of the box. 2-12× faster than PMD CPD / jscpd. Calibrates itself on first run. Why now GitClear's 2025 report (211M lines of code analyzed): copy-pasted lines grew from 8.3% to 12.3% of all changes 2021→2024, while refactored lines dropped from 25% to under 10%. For the first time in measurable history, copy/paste exceeded code reuse. AI assistants don't know your project's _helper.py — they emit the copy.

Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from GitHub