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.3.0.tar.gz
(12.5 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.3.0-py3-none-any.whl
(14.5 kB
view details)
File details
Details for the file codenose-0.3.0.tar.gz.
File metadata
- Download URL: codenose-0.3.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e44b9709ef039d0a8c89cc2455e027c34e26d5caea424c66ed6dd3f86d9fb8f
|
|
| MD5 |
dfd623ecc8f8ebf71e2ab80bbda46223
|
|
| BLAKE2b-256 |
5b8f3ea60193e313fdd90ab80fdfd79f3c0edfc5da0d4949960b94cdceab4b87
|
File details
Details for the file codenose-0.3.0-py3-none-any.whl.
File metadata
- Download URL: codenose-0.3.0-py3-none-any.whl
- Upload date:
- Size: 14.5 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 |
89c91b50d4c8f2b96ca1d499bb4a0b0830b492b8be746306e825a7bb038b68f9
|
|
| MD5 |
c73d874cdefc10878bfa30b8d406d527
|
|
| BLAKE2b-256 |
2df7e19fcdf601a511dead5a70677fb50f1ccf3954112f9e3f5b875891f7f007
|