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.0.tar.gz (17.0 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.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codenose-0.4.0.tar.gz
  • Upload date:
  • Size: 17.0 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.0.tar.gz
Algorithm Hash digest
SHA256 08a4ee49bc7a2a52b260f6179228ce3e6263d5e23ac11a4f850aaca07237ea89
MD5 15640022575a4146039a5b4c53f47f7f
BLAKE2b-256 267d6c203055a4056a97a9fb6c03227e45d590660b3961d91b49e47ae0c27e1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codenose-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65a4e6efc14921a343cfbc6e50cf1baa415eb998031fc3cd302557b900eb16b8
MD5 1ffbf3b99404e1a14ccb5f21418728ce
BLAKE2b-256 31401ec741bef31347d4303efe185d49a0e8bb28165090b9a981982a8fdbf27d

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