Updates on KBibTeX
Jan. 7th, 2016 10:23 pmIn this posting, I am going to tell about the changes and development done in KBibTeX during the last few months. Most notably, KBibTeX has been ported to KDE Frameworks 5, but also some effort has been spent into code quality.
Port to Frameworks
Since Spring 2015, I have been working on a KDE Frameworks 5 (KF5) port of KBibTeX. In August, this KF5 port has become master and the last KDE 4 version resides in branch kbibtex/0.7 which is still due to be released. Except for the major refactoring for KF5, both master and kbibtex/0.7 are still quite similar.
The KF5 version is stable enough for (my) daily work and from bug reports I know that some people are already using it. For everyone who tries to run a Frameworks/Plasma 5-exclusive environment, I can recommend this version.
For both kbibtex/0.7 and master (which would become version 0.8) I plan to make releases really soonTM. Some known bugs need to be addressed and then building of tar balls for alpha/beta/rc releases can start. Some fixes will be ported to kbibtex/0.6 as well and there will be a minor bugfix release for 0.6 as well.
Now, if those names like kbibtex/0.6 or master have been confusing, please see my posting from June as well as the development documentation.
Code Quality
The other large focus next to the KDE Frameworks 5 port was code quality using code analysis tools. In particular, I am employing three tools:
- Coverity Scan is a commercial tool, but offers to scan open source projects for free. Very useful at identifying dead code, uninitialized variables, bad memory management. It even found a copy&paste errors where variables were renamed inconsistently. Some hard-to-trace crashes have been identified as well. This tool can be strongly recommended. Usage requires to compile your code with a special wrapper provided by Coverity that generates a considerable amount of data that needs to be packed and uploaded to Coverity for analysis (automation for CI possible).
- Krazy 2 through the English Breakfast Network. This tool I have been using the longest. From what I understand, most recommendations are more about ‘best practice’ than finding ‘real’ bugs. Still very useful and no overhead for a developer as EBN does make automated Git checkouts to run Krazy.
- Clazy is the new kid on the block. It makes use of LLVM/Clang and checks code for proper use of Qt-specific features such as efficient construction of strings without temporary instances. Maybe of less usefulness for non-Qt projects, but very helpful to Qt/KDE projects. It requires a bleeding-edge LLVM and there are only few Linux distributions (e. g. ArchLinux) that ship such a version by default at the time of writing.
I don't recall seeing any overlap in identified issues between those three tools, so for best results in your code, you should use all three.
By now virtually all issues and warnings found by those three tools have been fixed in KBibTeX, at least in the master branch. Some fixes have been backported to older branches. I recommend to check out the Git logs, as messages state which code checker a commit/change was due.
DBus
One major feature currently under development and one of the largest external code contributions in recent times is DBus support by Shunsuke Shimizu. With ‘support’ I mean that you can remotely control KBibTeX via DBus. As of now, basic operations such as opening, saving, and closing files as well as inserting elements exist. The code resides in a special branch (branch bugs/kde332380 in repository clones/kbibtex/thomasfischer/kbibtex.git) for the bug report originally requesting DBus support. An example Python 3 script demonstrates how to control KBibTeX through DBus.