[Phpmyadmin-devel] Help about issues reported by scrutinizer

Nisarg Jhaveri nisargjhaveri at gmail.com
Tue Jun 23 15:49:34 CEST 2015


Hi Madhura,

On Tue, Jun 23, 2015 at 7:03 PM, Madhura Jayaratne <madhura.cj at gmail.com>
wrote:

>
>
> On Tue, Jun 23, 2015 at 2:52 AM, Nisarg Jhaveri <nisargjhaveri at gmail.com>
> wrote:
>
>> Hello,
>>
>> Please look at this link,
>>
>> https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/inspections/b0f631e5-6575-4ac6-8030-7d888fde084d/issues/
>>
>> All the three issues reported are more or less similar. And I believe
>> that I've already done what it is suggesting. But still, it classifies
>> these issues as bug, and one of them as major bug. Is it a false alarm or I
>> am doing something wrong?
>>
>> Also, is there any better way to achieve what i'm trying to do? (To
>> implement a method same way in more then one subclasses, without
>> duplicating code)
>>
>> --
>> Nisarg Jhaveri
>> નિસર્ગ ઝવેરી
>>
>> Hi Nisarg,
>
> Appreciate that you are making an effort to fix issues reported by
> Scrutinizer.
>
> Regarding issue [1], you are accessing property hiddenCount in Node which
> is only defined in Node_Database about which the scrutinizer complains.
> It's true that you have done an instanceof check, but this is generally an
> anti pattern, and you can resolve this easily using inheritance. See [2] to
> how this can be resolved.
>
> Issue [3] is somewhat similar. This can be resolved by moving the related
> logic to Node_DatabaseChild class and by changing the semantics of the
> class a bit [4] (I am referring to the change in class description). If we
> could not change the semantics of the class, we could have added a parent
> class to achieve the same.
>

It was already defined in children classes. I moved it to parent as I
wanted same method in two subclasses. Thanks for this solution.


>
> Issue [5] can be resolved by properly defining the type [6]
>

This one is interesting!


>
> [1]
> https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/inspections/b0f631e5-6575-4ac6-8030-7d888fde084d/issues/files/libraries/navigation/Nodes/Node.class.php?status=new&selectedSeverities%5B0%5D=10&orderField=path&order=asc
> [2]
> https://github.com/phpmyadmin/phpmyadmin/commit/312d1599229a615405400b208798ba97b3ccd74b
> [3]
> https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/inspections/b0f631e5-6575-4ac6-8030-7d888fde084d/issues/files/libraries/navigation/Nodes/Node.class.php?status=new&selectedSeverities%5B0%5D=5&orderField=path&order=asc
> [4]
> https://github.com/phpmyadmin/phpmyadmin/commit/789d9aa01885d48ca2d00d30fe2386fb1ab8cd01
> [5]
> https://scrutinizer-ci.com/g/phpmyadmin/phpmyadmin/inspections/b0f631e5-6575-4ac6-8030-7d888fde084d/issues/files/libraries/navigation/NavigationTree.class.php?status=new&orderField=path&order=asc
> [6]
> https://github.com/phpmyadmin/phpmyadmin/commit/67a94c222c202b467e1b2d545e98d71d012e6175
>
> --
> Thanks and Regards,
>
> Madhura Jayaratne
>
>
Thanks a lot! :)

-- 
Nisarg Jhaveri
નિસર્ગ ઝવેરી
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20150623/b247b19b/attachment.html>


More information about the Developers mailing list