Fix javascript code based on static analysis feedback(quotes and code complexity)