Code smell detection for LLMs - sniffs out duplicate logic, architecture violations, and other blind spots
Project description
CodeNose 👃
Code smell detection for LLMs - sniffs out duplicate logic, architecture violations, and other blind spots.
Installation
pip install codenose
Usage
from codenose import CodeNose
# Quick scan a file
result = CodeNose.quick_scan_file("/path/to/file.py")
print(f"Found {len(result.smells)} smells")
# Scan a directory
result = CodeNose.quick_scan_directory("/path/to/project")
print(f"Cleanliness: {result.cleanliness_score:.0%}")
# With custom configuration
nose = CodeNose(
max_file_lines=500,
max_function_lines=50,
canonical_filenames={"utils.py", "core.py", "models.py"}
)
result = nose.scan_file("/path/to/file.py")
Smell Types
| Type | Emoji | Description |
|---|---|---|
| syntax | 🔴 | Syntax errors |
| syspath | 💀 | sys.path manipulation |
| traceback | ☠️ | Exception without traceback |
| arch | 🏗️ | Non-canonical filename |
| facade | 🧅 | Logic in facade layer |
| dup | 👯 | Duplicate code blocks |
| long | 📏 | File/function too long |
| log | 📝 | Missing logging |
| import | 📦 | Duplicate imports |
Configuration
nose = CodeNose(
# Architecture settings
canonical_filenames={"utils.py", "core.py", ...},
exempt_dirs={"tests", "__pycache__", ...},
facade_files={"api.py", "cli.py", "mcp_server.py"},
# Thresholds
max_file_lines=400,
max_function_lines=33,
min_dup_block_size=3,
)
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
codenose-0.1.0.tar.gz
(10.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
codenose-0.1.0-py3-none-any.whl
(14.2 kB
view details)
File details
Details for the file codenose-0.1.0.tar.gz.
File metadata
- Download URL: codenose-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5a1c93aac1e832cafd92e612204db1ff6ed4f0bb0b5efffb50f7529c809d88f
|
|
| MD5 |
b7bad38b76f2886c19b32416bcb7c825
|
|
| BLAKE2b-256 |
01abb050b92d92fe021c71154e5fa432b97cc0fbc8dfecc68b872b46b1b711ca
|
File details
Details for the file codenose-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codenose-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac684c7d5a3d14725cf76b41b1a3d1e277bc70091ac12974774a998653a1d3c
|
|
| MD5 |
8afe1df20d9ff25701535210ac1cac22
|
|
| BLAKE2b-256 |
c9bef42e117920ae708f9b7e73bff220fe8182eb8cb72bf79e68e19aef492a83
|