added code_to_text_ratio util func