#[non_exhaustive]pub enum SortKey {
Crap,
Coverage,
Complexity,
Path,
}Expand description
Ordering key for the View pipeline’s sort phase.
All sorts are stable (sort_by, not sort_unstable_by) so input
order is preserved on tied keys. NaN-bearing keys (CRAP value,
coverage percent) sort last under their respective orientation —
non-NaN winners take the descending positions.
File-level interpretation under --group-by file:
| Variant | File-level meaning |
|---|---|
Crap | average_crap descending |
Coverage | average_coverage ascending |
Complexity | max_complexity descending |
Path | file_path ascending |
#[non_exhaustive] reserves namespace for future keys
(e.g., risk-bucket, function-name) without forcing match-arm churn
downstream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Crap
CRAP score descending (matches the legacy table reporter’s order).
Coverage
Coverage ascending (low-coverage shown first — investigator’s interest).
Complexity
Complexity descending.
Path
Alphabetical by file_path, then CRAP descending within file.
Implementations§
Trait Implementations§
Source§impl From<SortKey> for SortKeyArg
Reverse mapping for saved view presets (issue #80) — preset stores
domain SortKey, but FilterArgs.sort_by is the clap-side wrapper.
impl From<SortKey> for SortKeyArg
Reverse mapping for saved view presets (issue #80) — preset stores
domain SortKey, but FilterArgs.sort_by is the clap-side wrapper.
SortKey is #[non_exhaustive] for cross-crate consumers, but
post-S4 (#136) the cli module lives in the same crate as the domain
SortKey definition, so the compiler treats the match as exhaustive
without a wildcard arm. New domain variants must still land with a
paired CLI variant in the same PR — clippy’s missing-pattern error
is now the loud failure point (the formerly-required wildcard arm
triggered unreachable_patterns post-relocation).
Source§impl From<SortKeyArg> for SortKey
impl From<SortKeyArg> for SortKey
Source§fn from(arg: SortKeyArg) -> Self
fn from(arg: SortKeyArg) -> Self
impl Copy for SortKey
impl Eq for SortKey
impl StructuralPartialEq for SortKey
Auto Trait Implementations§
impl Freeze for SortKey
impl RefUnwindSafe for SortKey
impl Send for SortKey
impl Sync for SortKey
impl Unpin for SortKey
impl UnsafeUnpin for SortKey
impl UnwindSafe for SortKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.