在我们公司,我们运行Sonar并启用了javascript插件。 在突出显示代码时,插件似乎有时会破坏。声纳跑步者没有问题,但服务器中的后台任务有时会运行30分钟,因为有几个例外。
我们正在SonarQube 5.3上运行javascript插件最新版本,目前已启用2.11。
我们的例外情况如下:
2016.03.09 13:32:02 WARN [o.s.s.c.s.HighlightingLineReader] Inconsistency detected in Highlighting data. Highlighting will be ignored for file '[filename]'
org.sonar.server.computation.source.RangeOffsetConverter$RangeOffsetConverterException: End offset 25 is defined outside the length (24) of the line 2
at org.sonar.server.computation.source.RangeOffsetConverter.checkExpression(RangeOffsetConverter.java:67) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.RangeOffsetConverter.validateEndOffsetNotGreaterThanLineLength(RangeOffsetConverter.java:61) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.RangeOffsetConverter.offsetToString(RangeOffsetConverter.java:37) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.HighlightingLineReader.processHighlighting(HighlightingLineReader.java:105) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.HighlightingLineReader.processHighlightings(HighlightingLineReader.java:92) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.HighlightingLineReader.read(HighlightingLineReader.java:79) ~[sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.ComputeFileSourceData.read(ComputeFileSourceData.java:62) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.source.ComputeFileSourceData.compute(ComputeFileSourceData.java:49) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.PersistFileSourcesStep$FileSourceVisitor.visitFile(PersistFileSourcesStep.java:132) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:80) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:52) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:40) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:99) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:55) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:40) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:99) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:55) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:40) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitChildren(DepthTraversalTypeAwareCrawler.java:99) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:55) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:40) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.PersistFileSourcesStep.execute(PersistFileSourcesStep.java:92) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:81) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:56) [sonar-server-5.3.jar:na]
at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-5.3.jar:na]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_65]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_65]
在对问题进行一些分析后,我们发现BOM字符存在问题,但在之前的版本中已经解决了。可能是它崩溃的文件是带有BOM字符的文件,因此我们也怀疑BOM文件的修复是否有效。荧光笔崩溃的线是随机的,并不总是第一行。
我查看了javascript插件的代码,我认为在计算偏移时存在错误。
非常感谢任何帮助!
更新:
以下是它试图突出显示的文件的前四行(它在第二行中断):
require('./sass/site.scss');
require('./sass/ns-popover.scss');
window.jQuery = window.$ = require('./bower_components/jquery/dist/jquery.js');