Skip to content

reduce false positives from wrapper assert calls #1713

@GrosQuildu

Description

@GrosQuildu

Functions that are wrappers around assert statements are likely to be marked by necessist, but are always false positives. For example, in rust:

#[test]
fn test_something() {
   assert_normalizes("abcd", "def1");
}

fn assert_normalizes(sig_hex: String, expected_hex: String) {
    let sig = decode(&sig_hex).unwrap();
    let normalized_sig = normalize_ecdsa(sig).unwrap();
    assert_eq!(encode(&normalized_sig), expected_hex);
}

Removal of assert_normalizes should not be important. Heuristic for the improvement would be to not mark functions that have standard assert statements and do not modify global values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions