There are several ways to code state machines.
The simplest is 'one hot', where your 12 states would use 12 flip flops, only one of which would be active at any time. This is simple to debug, and avoids much decoding.
To save flip flops, you could use a binary code to use only four of them. What you save in flip flops, you may lose in decoding circuitry. If your state machine has a linear sequence through the states, then a Gray-type encoding could avoid race conditions decoding to unwanted output glitches.
With any coding scheme, what do you do if the SM ends up in an illegal state? One option is to decode all illegal states as a prompt transition to the idle state, or reset, or power-on. This would make recovery automatic, but would mask what happened. Another possibility would be for them to stick in the illegal state forever more, so you'd have something to debug.
It depends on whether this is a life-critical system, and whether failure would be merely inconvenient, or very important.