Here's the source code of the implementation of the tax code: https://github.com/etalab/calculette-impots-m-source-code
As a side-note, the source code appears to have moved here: https://gitlab.adullact.net/dgfip/ir-calcul
As most AI, it's regex and ifs all the way down.
This made me laugh way more than expected, mostly because of how true it is.
application : pro, batch , iliad,oceans ;