2013-03-14 101 views
3

我使用声纳来检查jQuery代码,但它总是抛出一个异常:声纳检查jQuery代码错误

C:\Documents and Settings\user\.jenkins\workspace\ksp2\ant\sonar_web.xml:31: com.sonar.sslr.impl.LexerException: Unable to lex url: file:/C:/Documents%20and%20Settings/user/.jenkins/workspace/ksp2/WebContent/js/post/viewEditRevisions.js 
Caused by: com.sonar.sslr.impl.LexerException: Unable to lex source code at line : 197 and column : 42 in file : file:/C:/Documents%20and%20Settings/user/.jenkins/workspace/ksp2/WebContent/js/post/viewEditRevisions.js 
Caused by: java.lang.IllegalStateException: None of the channel has been able to handle character '"' (decimal value 34) at line 197, column 42 
    at org.sonar.channel.ChannelDispatcher.consume(ChannelDispatcher.java:87) 
    at com.sonar.sslr.impl.Lexer.lex(Lexer.java:126) 

我不知道为什么。我的jQuery文件太长,而且在这行抛出异常:

var postTemplate = '<h3><div class="title">'+data.postResult.title+'</div></h3><p>'+data.postResult.contentPreview+'</p>'+postTags; 

我很困惑,我已经设置编码为UTF-8,但它仍然抛出异常。

回答