Is there a name for the problem of code that's duplicated in the then and else sections of an if structure?

Example:

if ($foo) { $foo->doA(); $foo->bar = 'bar'; } else { $foo->doB(); $foo->bar = 'bar'; }

The bar assignment is duplicated here and should be moved to after the if struct.

Related posts

Recent Viewed