Static Analysis 1
1 post
• Page 1 of 1
Static Analysis 1
Right, it's my productive day today.
Can you make an analysis that checks all overriden implementations of a function (from top to bottom) and check if the argument list and type hints are all the same? And then check if they all return (or not) a value. I know that you cannot (or maybe you can!) check all code paths to see if the function should or should not return a value, but maybe look for a 'return' keyword?
We have plenty of bugs where the overriding function does not return what the base function does or has a different set of arguments.
I also recently had a bug with mispelled property name. Checking declared properties (including @property tags) is also a nice thing. Maybe a warning this time, but worth a check!
Can you make an analysis that checks all overriden implementations of a function (from top to bottom) and check if the argument list and type hints are all the same? And then check if they all return (or not) a value. I know that you cannot (or maybe you can!) check all code paths to see if the function should or should not return a value, but maybe look for a 'return' keyword?
We have plenty of bugs where the overriding function does not return what the base function does or has a different set of arguments.
I also recently had a bug with mispelled property name. Checking declared properties (including @property tags) is also a nice thing. Maybe a warning this time, but worth a check!
Welcome to the zone where normal things don't happen very often.
- BladeMF
- Posts: 346
- Joined: October 10th, 2012, 7:14 am
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests