The Code Slob Cleanup project relies on several key Python scripts to automate the identification, verification, and cleaning of code. All scripts are ran using uv run.
scripts/identify.pyThis script is the entry point for finding “code slob” in your repository.
uv run scripts/identify.py <directory> [flags]--global-variables: Enable detection of non-constant global variables.--complexity: Enable cyclomatic complexity analysis.--lloc: Enable Logical Lines of Code (LLOC) analysis.--public-private: Enable analysis of public members that are never used outside their defining file.--duplicates: Enable detection of duplicate code blocks (functional clones) using AST normalization.--file-count <N>: Display the top N files with the highest total slob score. Results will be grouped by file.--file-count is specified, identifies the “slobbiest” files by summing scores of active identifiers.code-slob-cleanup.json and inline comments.scripts/duplication.pyThis script identifies functional clones (duplicated logic) by normalizing the code structure.
uv run scripts/duplication.py <directory>identify.py via the --duplicates flag, which adds a slob penalty of 100 for any duplicated function or class.scripts/orchestrator.pyThis script manages the verification process within the .code-slob-tmp/ workspace.
uv run scripts/orchestrator.py .code-slob-tmpscripts/verify.py for each job.scripts/clean_untested.pyThis script allows you to remove code that is not covered by a specific “golden” test suite.
uv run scripts/clean_untested.py <test_script_path>coverage.code-slob-cleanup.json and inline comments.scripts/verify.py: The core script for running Hypothesis-based property testing on a single function (called by orchestrator.py).scripts/metrics.py: Provides the static analysis tools (like Radon) used by identify.py.scripts/semantic.py: Identifies global variables, classes that should have their own files, and functions that should be private.scripts/common.py: Shared utilities and configuration for the entire toolchain.