Expand description
§mollify-parse
Python parsing for Mollify. Parser abstraction so the rest of the engine never touches the concrete parser directly.
§ADR-0001: full-fidelity ruff AST
Built on Astral’s ruff_python_parser / ruff_python_ast (pinned git rev) —
the same battle-tested, error-resilient parser that powers ruff. The types
below (ParsedModule, Definition, Import, …) are parser-agnostic, so the
concrete parser remains an implementation detail confined to this crate.
Structs§
- Call
Site - A single call expression’s callee text and 1-based line.
- Class
Info - A class and, per method, the set of
self.<attr>it touches — the input to the LCOM* cohesion metric. Also carries member + base metadata for unused class-member / unused enum-member detection. - Class
Member - One member declared directly in a class body (a method or a class-level attribute / enum value).
- Definition
- A symbol defined at module scope.
- Function
Complexity - Per-function complexity metrics (cyclomatic + cognitive) and type-annotation coverage.
- Import
- An
import/from ... import ...statement. - Parsed
Module - The parsed view of one Python module that the graph builds on.
- PyParser
- A reusable parser handle. The ruff parser is stateless (a free function), so this is a zero-sized handle kept for API stability and ergonomic call sites.
- Scope
Finding - An unused local binding within a function scope.
- Security
Hit - A potential security issue detected syntactically (a candidate, per the candidate-producer/verifier split — never a confirmed vulnerability).
- Type
Leak - A private type (
_Name) referenced in the signature of a public function/method — an API-hygiene leak (callers can’t name the type). - Unreachable
Code - A statement that can never execute because it follows an unconditional
terminator (
return/raise/break/continue/sys.exit()) in the same block.
Enums§
- DefKind
- What a top-level definition is, for dead-code granularity.
- Parse
Error