Review an existing piece of code for syntax problems, poor structure, readability, and maintainability
Asked in the Superday Round 1 (coding & code review) stage. Implement a static reviewer for Python source code.
Implement review_code(code), where code is a Python source string. Return a sorted list of applicable issue labels:
syntax_error, bare_except, deep_nesting, long_function, magic_number, missing_docstring, and unclear_names.
Use these rules: syntax errors return only syntax_error; nesting deeper than three control-flow levels adds deep_nesting; functions containing more than 12 statement nodes add long_function; numeric constants other than -1, 0, and 1 add magic_number; public functions without docstrings add missing_docstring; bare except clauses add bare_except; one-character names other than i, j, and k add unclear_names.
def review_code(code):