Dan's Summer of Code My progress over the summer

Week 8

During the past week I worked on the linter and in order to provide better analysis I had to improve the library by creating new rules that check for errors.

At this moment, any code that is written in the SQL query box or in the console goes through the library which analyzes it and provides feedback. I hope that this feature will help many users spot their errors even before executing their queries and improve their work flow. Some of the errors are pretty difficult to detect and the overhead involved isn’t worth it, which means that not all errors are detected by the library. I tried to focus on syntax as much as possible.

During the next week, I will try improve the localization of the library, make error strings translatable and increase the overall code coverage. I am not sure to which extent I will be increase the code coverage, but I hope that I will be able to increase it by at least a few percents.

To see my progress, you can check out my library repository or some of the pull requests (#1788 & #1799) I submit this week.

Week 7

During the past week I finished replacing the old parser. The remaining part of the code that required replacing was small, so I had enough time to also test it and so far it works fine.

There were fragments of code that relied on regular expressions for analysis and some of those were replaced during the process, but I believe that some of the remaining regular expressions won’t be replaced, because they perform good and faster than the parser would.

Most of the bugs I were aware of and tested with the new parser seem to be fixed. For the next week I planned on fixing the remaining bugs and implementing new features regarding the parser. I will improve the parsers to provide better, strict error messages so I can built the linter on top of it.

To see my progress, you can check out my library repository or the pull request I submit for phpMyAdmin and was merged today.

Week 6

During this week I continued replacing code that was related to the old parsing library. The new library suffered a lot of changes too. Some of the most important are: implemented a builder, improved lots of statements, the library takes into consideration the SQL mode in some operations, lots of fixes, improved the documentation and the code coverage is now over 98%.

One of the most important tasks accomplished this week is that I finished refactoring sql.lib.php, DisplayResults.class.php, Table.class.php and a huge part of the code related to export.

I hope that the next week I will finish refactoring the old code and fix as many bugs as possible.

To see my progress, you can check out my library repository or the pull request I submit for phpMyAdmin.

Week 5

During this week I paid a lot of attention to understanding the old code so I would not create any new bugs by mistake and I got the chance to find a few new ones (or had no knowledge of them previously).

Since most bugs are caused by edge cases that the old parser cannot handle I decided that the best approach to fixing them is to continue implementing the new library. This week the sql-parser library suffered quite a few changes and I got the chance to see how it behaves in real situations. It still lacks some functionality (e.g. query builder and query formatter) which are needed, but those are planed to be written later. For now, I implemented temporary methods that, given the conditions, seem to work as expected.

One of the most difficult parts was the code from sql.lib.php which has a high complexity, mixing some logic with view code and not being very consistent.

My task for the next two weeks is to refactor code related to the SQL library. I will definitely have to work more on sql.lib.php, being one of the key components of phpMyAdmin.

To see my progress, you can check out my library repository or the pull request I submit for phpMyAdmin.

Week 4

Unfortunately this week was slow and I did not get to do very much. Now, that I am done with school, I am going to have more time to work on phpMyAdmin.

Some of the things I did this week(end): added multiple contexts and implemented them into phpMyAdmin along with a mechanism which switches the context according to the version of the database server, edited the way keywords were handled, removed the tokens array from parser’s output (it was redundant), fixed tests, completely refactored routine methods.

My task for the upcoming week is to implement new features and fix bugs, but I’ll continue replacing calls to the old library as well.

To see my progress, you can check out my library repository or the pull request I submit for phpMyAdmin.