admin icon indicating copy to clipboard operation
admin copied to clipboard

[Insight] Your project should not contain duplicated code - in src/…/InputFilter/AdminInputFilter.php, line 20

Open arhimede opened this issue 1 year ago • 1 comments

in src/Admin/src/InputFilter/AdminInputFilter.php, line 20

The next 24 lines appear both in src/Admin/src/InputFilter/AdminInputFilter.php:20 and src/Admin/src/InputFilter/EditAdminInputFilter.php:20.

use Laminas\Validator\StringLength;

/**
 * @extends InputFilter<object>
 */
class AdminInputFilter extends InputFilter
{
    public function init(): void
    {
        $identity = new Input('identity');
        $identity->setRequired(true);

Posted from SymfonyInsight

arhimede avatar Jun 26 '24 09:06 arhimede

This should be ignored as the other warning like this was. The dublicate code warning is between create and edit inputs for the admin, whatever changes we make, still will se dublicate code, as the password inputs for create needs to be required and for edit don't. I tried to make a base input filter and create and update to extend that, but still will see dublicate code because of the passwords inputs.

pinclau avatar Jul 04 '24 14:07 pinclau