cqfn / veniq

Veniq uses Machine Learning to analyze source code, find possible refactorings, and suggest those that seem optimal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEMI recommendation api: add method to check validity of input method declaration and create error codes

KatGarmash opened this issue · comments

Why

The current implementation #121 takes as input a list of strings, assuming it is a valid method declaration.

What we want

Add a subprocedure in ``recommend_for_method'' checking it is a valid method declaration. If it is not valid, the API should return an error code.

Proposed solution

  • Validity checks:
    • check it is not a class declaration
    • check for bracket balance
    • part of the errors can be caught by try-catch wrapper around procedure creating AST tree from string.
  • Error codes: TODO

@acheshkov @lyriccoder