analysis code