MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
Tell me what your code looks like...

Code line distribution over all projectsFrom time to time it is necessary to get a bigger picture of your project in terms of size, test coverage, code vs. comments ratio and others (aka metrics). While it is quite difficult to find a good (and free) code coverage tool for C++ there is already a very nice tool package called DPack, which is not only freely available but also gives us some very useful additions in our IDE. One of those features is code statistics.

Below is a series of diagrams and tables showing details about the current code base of the MySQL Workbench. The entire project consists of 1310 files written in C, C++ and C#, which make up a total of 397.797 lines of code, comments and empty lines. Wait, I think Alfredo just committed a new patch. Make that 400K lines, for simplicity. The entire Visual Studio solution has 59 projects, including third-party stuff. The table below shows the 20 largest of them plus the overall size.

Top 20 projects ordered by total linesCode line distribution without 3rd party code

As you can see a vast majority of code went into our parser project, which demonstrates the pure amount of work that we put in this area, which is used by such important parts like reverse engineering and the catalog difference and compare features. The pie chart below visualizes the ratio of our top 20 projects (without 3rd party code). More than a third of all code lines deal with parsing! Also our unit test suite ranks among the largest parts, which is a good thing. Still, there is enough work to be done yet, so that we get an excellent test coverage.

Another interesting fact is the ratio between C++ and C# as shown in the next diagram (without any 3rd party code). A close fourth is C#, which is mainly used for the front end. So this is a good indicator that we reached our goal of a cleaner separation of front end and back end code. The back end is platform independent while the front end is (and will) be written for each of our supported platforms individually.

Language ratio without 3rd party code

Overall we see that coding goes the route we wanted to take for the new workbench, once we get more testing code in place and get the front end for the other platform going.

Author: Mike Lischke

Team Lead MySQL Workbench