This is definitely a pretty common situation with academic code.
I think there are two paths - (1) human code review to consider things like design patterns, and (2) automated code review through static analysis to consider things like linting, use of language idioms, cyclomatic complexity, code duplication, variable reuse, etc.
Code Climate [1] is one service that provides the latter pretty well. It's free for open source.
You can also run linting tools on your local machine, for instance ESLint for JavaScript or pycodestyle / pep8 or flake8 for Python.
[1]: https://codeclimate.com/