Skip to main content
Version: 0.2.1

dump Is Used

An optional detector that highlights all the dump function calls.

Why is it bad?

The dump function is a debug print that shouldn't be in the final code. Even though the compiler removes it in production, its presence suggests the developer was debugging something. This can flag areas where issues might exist, so auditors should take a closer look at these parts of the code.

Example

fun test(): Int {
// ... other computations
let combined: Int = (RANDOM_SEED >> half_shift) &
(MAGIC_CONSTANT << DIVIDE_BY_TWO) ^ shift_mask;
dump(combined); // Suspicious: Highlighted by the detector
}

Use instead:

fun test(): Int {
// ... other computations
let combined: Int = this.seed ^ shift_mask
// OK: The code was reviewed and simplified; `dump` was removed
}