Software/code/scripts are increasingly shared in parallel with data. Well-documented, preserved, and shared code is aligned with FAIR principles.
These guides can help you select an appropriate license to enable use and attribution for your code:
Check the repository where you deposit the code or scripts to see which licenses it supports.