Fixes check to handle undefined errors. Created a guard clause in stead of a ternary if/then/else.
Removes static attr from method to avoid duplication. Adds parsing of analysisContraints field to JSON.