Why are all these calculations needed?
Krakatau makes varying levels of measurements. The simplest is LOC and SLOC.
However the tool also reports on advanced metrics like LCOM (Lack of Cohesion in Methods) and DIT (Depth of Inheritance Tree) and V(G) (Cyclomatic Complexity).
These calculations involve cross referencing and matching of external methods, and other metrics involve tracking depth of inheritanace.
For this reason advanced mathematics is required in a professional metrics tool.
Why does Krakatau need a database?
Krakatau is designed for 'real world' use. Many tools will manage a demonstration or a trial with a few hundred thousand lines of code.
Krakatau has been tested to millions of lines of code.
This is especially important for 'change' metrics where the comparison of two projects doubles the size of the source code under analysis.
The database allows Krakatau to scale from a few thousand to millions of lines of source code.
This makes Krakatau usable across all your projects now and as they develop in the future.