Answer the question
In order to leave comments, you need to log in
Are there code analyzers/refactorers to remove redundancy (in PHP, but other languages are interesting)?
The most minimal example of getting rid of redundancy:
function someFunc($arg = null) {
if (!empty($arg))
return anyValue;
else
return anotherValue;
}
function someFunc($arg = null) {
if (!empty($arg))
return anyValue;
return anotherValue;
}
Answer the question
In order to leave comments, you need to log in
it actually turns into this:
function someFunc($arg = null) {
return !empty($arg) ? $anyValue : $anotherValue;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question