Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php namespace WITR\Http\Controllers; |
||
10 | class AskDestlerController extends Controller { |
||
11 | |||
12 | public function index() |
||
17 | |||
18 | View Code Duplication | public function submit(Mailer $mailer, AskDestlerRequest $request) |
|
30 | } |
||
31 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.