My experience with CMMI level 5 was from a vendor with that certification providing us code years ago.
They claimed as part of CMMI level 5 that errors would be detected at every possible point in the code. The problem was, this was applied without any thought to maintainability, nor to the fact that in certain places, if an error occurs, the implication is the system is so far gone that the error handler won't be able to run. The language was Sybase stored procedures; the below is a rough example. Their error blocks were even longer.
Maintainability when you can see at most 3 lines that actually DO something on your screen at once is greatly limited - everything else is the same error block copied again and again and again, so even figuring out what variables were used took much scrolling.
We asked the vendor to cut the crap, and they said this was mandated by CMM Level 5 and they couldn't change it without risking their certification.
I briefly considered asking them if they should perhaps add statements of the form "IF 0 = 1 THEN (some error handler relating to the server being broken)" just in case that happened.
The reality of course is that if the server didn't have enough memory to declare variables, it would most likely crash entirley. It certainly wouldn't have enough memory to run the error handler.
/*
* @company_identifier will hold a numeric(15,0) ... [snip]
*/
DECLARE @company_identifier numeric(15,0)
IF @@ERROR > 0
BEGIN
INSERT INTO ERR_LOG (error, time) VALUES ( 'Error: Unable to declare @company_identifier due to error ' + @@ERROR, getDate())
PRINT 'Error Logged In ERR_LOG TABLE with ID ' + @@IDENTITY
EXEC sp_logErrorRemote @@IDENTITY
SELECT @ERRORSTATE = 1
ROLLBACK TRANSACTION
RETURN
END
/*
* Documentation on @person_identifier
*/
DECLARE @person_identifier numeric(15,0)
IF @@ERROR > 0
BEGIN
INSERT INTO ERR_LOG (error, time) VALUES ( 'Error: Unable to declare @person_identifier due to error ' + @@ERROR, getDate())
PRINT 'Error Logged In ERR_LOG TABLE with ID ' + @@IDENTITY
EXEC sp_logErrorRemote @@IDENTITY
SELECT @ERRORSTATE = 1
ROLLBACK TRANSACTION
RETURN
END