John Carmack has pledged to release the source code of Doom 3 as soon as Rage was released but he hasn't fulfill that pledge yet, and the reason behind that turned out to legal and patent issues.
A key algorithm in the id Tech 4 graphics engine which powers Doom 3 is called "Carmack's reverse." This algorithm is a clever implementation of shadow volumes using the stencil buffer found in the GPU. Carmack developed that algorithm independently in 2000 before discovering that Creative Labs has filed a patent for a "Method for rendering shadows using a shadow volume and a stencil buffer" in 1999.
The USPTO granted the patent to Creative in 2002, so Carmack negotiated with them a deal to use the algorithm in exchange for supporting Creative's EAX technology and to display their logos in the game. Problem is, this deal doesn't extend to third party games that'll be created using the source code once it is freed.
To get past this hindrance, Carmack is now writing replacement code for the patented parts of the engine. Hopefully, the new code will be on par with the original code in terms of visual quality and performance.