core: add incorrect code detection