Problem
CodeScene analysis has identified code duplication between two functions in tests/support/mod.rs:
fake_ninja
fake_ninja_pwd
Both functions follow a similar pattern for creating fake executables with temporary directories and shell scripts, but with different script content.
Suggested Solution
Consider extracting the common functionality into a shared helper function that accepts the script content as a parameter, reducing duplication whilst maintaining the specific behaviour of each function.
Context
This issue was identified during PR review and flagged by automated analysis.
References:
Requested by: @leynos
Problem
CodeScene analysis has identified code duplication between two functions in
tests/support/mod.rs:fake_ninjafake_ninja_pwdBoth functions follow a similar pattern for creating fake executables with temporary directories and shell scripts, but with different script content.
Suggested Solution
Consider extracting the common functionality into a shared helper function that accepts the script content as a parameter, reducing duplication whilst maintaining the specific behaviour of each function.
Context
This issue was identified during PR review and flagged by automated analysis.
References:
Requested by: @leynos