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.2.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.2.0-py3-none-any.whl
(14.2 kB
view details)
File details
Details for the file codenose-0.2.0.tar.gz.
File metadata
- Download URL: codenose-0.2.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 |
b91d8bbc6e9dbd9e40b6f9844db7be70f11cb697a2b93c22c430ad19017ad0ca
|
|
| MD5 |
3beb18b6c00033030d3669ea9ac25d5a
|
|
| BLAKE2b-256 |
a8aa026e257ccbcbc08b03c2340b7c644004d428b478d193f4ae1148d732415c
|
File details
Details for the file codenose-0.2.0-py3-none-any.whl.
File metadata
- Download URL: codenose-0.2.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 |
7ce59f25975d7ed5653ca5c6318afb3901b1149f163a7571e1fb619688fd529d
|
|
| MD5 |
b2538b22009d09a1cb6d984454714be1
|
|
| BLAKE2b-256 |
0e8888c54b850c9b1b4f865bc7ae436ff21d916caf70023dd440eaa8eafe6bef
|