Sometimes, we need to refactor the code. But there are deadlines that need to be met. So, do we refactor or incur technical debt?
The answer depends on automated test cases. If you have automated test cases and have good coverage, then it is better to refactor the code before the release.
But if unit tests are not available or coverage is less, it is better to leave the code as it is. A working code is better than beautiful code with bugs.
What are your thoughts?