Skip to main content

Crate mollify_parse

Crate mollify_parse 

Source
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§

CallSite
A single call expression’s callee text and 1-based line.
ClassInfo
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.
ClassMember
One member declared directly in a class body (a method or a class-level attribute / enum value).
Definition
A symbol defined at module scope.
FunctionComplexity
Per-function complexity metrics (cyclomatic + cognitive) and type-annotation coverage.
Import
An import / from ... import ... statement.
ParsedModule
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.
ScopeFinding
An unused local binding within a function scope.
SecurityHit
A potential security issue detected syntactically (a candidate, per the candidate-producer/verifier split — never a confirmed vulnerability).
TypeLeak
A private type (_Name) referenced in the signature of a public function/method — an API-hygiene leak (callers can’t name the type).
UnreachableCode
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.
ParseError