Skip to main content

Module code_quality

Module code_quality 

Source
Expand description

Code quality and miscellaneous rules.

Rules detecting code quality issues:

  • Crate-wide allow lint (RUSTCOLA049)
  • Misordered assert_eq arguments (RUSTCOLA050)
  • Try operator on io::Result (RUSTCOLA051)
  • Local RefCell patterns (RUSTCOLA052)
  • Unnecessary borrow_mut (RUSTCOLA057)
  • Dead stores in arrays (RUSTCOLA068)
  • Overscoped allow attributes (RUSTCOLA072)
  • Commented-out code (RUSTCOLA092)

Structs§

CommentedOutCodeRule
Detects commented-out code that should be removed.
CrateWideAllowRule
Detects crate-wide #![allow(…)] attributes that disable lints.
DeadStoreArrayRule
Detects array elements written but never read before being overwritten.
LocalRefCellRule
Detects RefCell used for purely local mutable state.
MisorderedAssertEqRule
Detects assert_eq! calls where literal appears as first argument instead of second.
OverscopedAllowRule
Detects crate-level #![allow(…)] that suppresses security-relevant lints.
TryIoResultRule
Detects use of ? operator on io::Result without additional context.
UnnecessaryBorrowMutRule
Detects borrow_mut() on RefCell where borrow() would suffice.
UnwrapInHotPathRule
Detects panic-prone code in performance-critical paths. Panics in hot paths can cause cascading failures under load.

Functions§

register_code_quality_rules
Register all code quality rules with the rule engine.