Skip to main content

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.4.1.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codenose-0.4.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file codenose-0.4.1.tar.gz.

File metadata

  • Download URL: codenose-0.4.1.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for codenose-0.4.1.tar.gz
Algorithm Hash digest
SHA256 21a83cef0b907f7a695e25f31f8a278cb749cfa6452bced3009694bb901ba30e
MD5 e092efa8ba6ac2a27d34465583c7c975
BLAKE2b-256 1a1104c817a808c60e555e2b536e69d61d97b71545ec6aec5d978eff1bb21b69

See more details on using hashes here.

File details

Details for the file codenose-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: codenose-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for codenose-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60f8597473aad0b07a6f3816b06a62d565ae087adea7b76597136d1b325595ed
MD5 3eeefd188913d16c0a0f509e9d83f921
BLAKE2b-256 a6a764bb134bfe03890a9ba2c6958c55d8ae6aa0cc79bbe7cbd8b10933747f09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page