Static Analysis

KambojaJS use static analysis when generating the route from controller. Static analysis mean, the issue analyzed before the the code/controller ran by the request handler. This is useful to prevent developer from getting error that sometime hard to trace, and identify the issue immediately

Here are the list of static analysis provided.

  1. Unassociated Parameter occur when you defined a parameter in the route but the backing parameter in the action is not exists.

  2. Missing Route Parameters Only applied on GET method, occur when action contains parameter but route doesn’t have the appropriate parameter.

  3. Missing Action Parameters occur when router contains parameter, but action doesn’t have any parameter

  4. Conflict Decorators occur when some decorator applied to an action analyzed cause conflict. for example @route decorator applied with @internal

  5. Duplicate Routes occur when duplicate route defined accidentally

  6. DuplicateParameter Name occur when duplicate parameter applied on the route, possibly happened in combination of @route.root() and @route.get()

  7. Class not inherited from controller occur when a class that is appears in the controller folder but not inherited from controller

  8. Class not exported occur when a controller you provide in the controller folder not exported. This warning also applied for the namespaces.

  9. Convention fail occur when you are using ApiController your method is match with the convention name but has lack of parameters.

  10. Reserved word used occur when you are accidentally override the methods of the controller such as json, view etc.