Metrics measuring unsafety #152
Labels
doc
enhancement
New feature or request
help wanted
Extra attention is needed
question
Further information is requested
Given that the correct boundary for auditing is the visibility boundary, I'm currently not sure how to read the output of cargo-geiger on how many expressions are contained in unsafe blocks. I can understand how knowing the amount of unsafe functions, traits, impl and methods gives a rough estimate of how unsafe the library is, but to my understanding the amount of expressions in unsafe blocks can vary so wildly between implementations of equivalent amount of code to audit that it may not be useful in practice. Perhaps a more robust substitute could be found, like size of functions containing an unsafe block?
Naturally any metric will have its flaws, but I haven't seen an issue raised or documentation on what the output of cargo-geiger means, or what metrics would more accurately measure 'unsafe complexity', and I think this is a shortcoming that could be addressed. In practice, another metric that would seem to be equally important to pressure implementations on would be whether there are comments explaining why the usage of unsafe is warranted/needed and what invariants are upheld. This would indicate that some amount of care went into the use of unsafe.
The text was updated successfully, but these errors were encountered: