←back to thread

136 points d-yoda | 3 comments | | HN request time: 0.64s | source

Hi HN! I built pyscn for Python developers in the vibe coding era. If you're using Cursor, Claude, or ChatGPT to ship Python code fast, you know the feeling: features work, tests pass, but the codebase feels... messy.

Common vibe coding artifacts:

• Code duplication (from copy-pasted snippets)

• Dead code from quick iterations

• Over-engineered solutions for simple problems

• Inconsistent patterns across modules

pyscn performs structural analysis:

• APTED tree edit distance + LSH

• Control-Flow Graph (CFG) analysis

• Coupling Between Objects (CBO)

• Cyclomatic Complexity

Try it without installation:

  uvx pyscn analyze .          # Using uv (fastest)
  pipx run pyscn analyze .     # Using pipx
  (Or install: pip install pyscn)
Built with Go + tree-sitter. Happy to dive into the implementation details!
Show context
derekcheng08 ◴[] No.45482457[source]
This is pretty awesome! If it's built on tree-sitter, is it fair to assume it's generalizable across languages?
replies(2): >>45482618 #>>45489649 #
1. d-yoda ◴[] No.45482618[source]
Yes! tree-sitter supports multiple languages and the core algorithms should transfer easily. I focused on Python first because I saw many people struggling with code quality issues in Python.
replies(1): >>45483147 #
2. derekcheng08 ◴[] No.45483147[source]
Just based on usage, I would assume js/ts would be very valuable as well. I see a lot of the same issues there and agree the core algos seem to apply generally. Very cool project!
replies(1): >>45483511 #
3. _joel ◴[] No.45483511[source]
Agreed, I do python and ts depending on the use case, a ts version would be cool