Jenkins sonarqube插件无法分析文件

时间:2016-12-14 20:37:43

标签: javascript jenkins sonarqube jenkins-plugins

我正在尝试使用Jenkins Sonarqube插件分析项目。但是在此过程中会出现错误

   org.sonar.squidbridge.api.AnalysisException: Unable to analyse file: E:/Jenkins/Jobs/Abc.com/QA/web/Abc.Web/js/build/r.js
    at org.sonar.plugins.javascript.JavaScriptSquidSensor.analyse(JavaScriptSquidSensor.java:195)
    at org.sonar.plugins.javascript.JavaScriptSquidSensor.analyseFiles(JavaScriptSquidSensor.java:161)
    at org.sonar.plugins.javascript.JavaScriptSquidSensor.analyse(JavaScriptSquidSensor.java:152)
    at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
    at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: No break target can be found for label out
    at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitBreakStatement(ControlFlowGraphBuilder.java:446)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:223)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.buildSubFlow(ControlFlowGraphBuilder.java:641)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitIfStatement(ControlFlowGraphBuilder.java:458)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:211)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:199)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitBlock(ControlFlowGraphBuilder.java:393)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:227)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitTryStatement(ControlFlowGraphBuilder.java:575)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:231)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.buildSubFlow(ControlFlowGraphBuilder.java:641)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitIfStatement(ControlFlowGraphBuilder.java:458)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:211)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.visitLabelledStatement(ControlFlowGraphBuilder.java:535)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:229)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.build(ControlFlowGraphBuilder.java:199)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.createGraph(ControlFlowGraphBuilder.java:161)
    at org.sonar.javascript.cfg.ControlFlowGraphBuilder.createGraph(ControlFlowGraphBuilder.java:156)
    at org.sonar.javascript.cfg.ControlFlowGraph.build(ControlFlowGraph.java:107)
    at org.sonar.javascript.checks.DeadStoreCheck.checkFunction(DeadStoreCheck.java:98)
    at org.sonar.javascript.checks.DeadStoreCheck.visitFunctionExpression(DeadStoreCheck.java:77)
    at org.sonar.javascript.tree.impl.expression.FunctionExpressionTreeImpl.accept(FunctionExpressionTreeImpl.java:174)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitParameterList(DoubleDispatchVisitor.java:222)
    at org.sonar.javascript.tree.impl.declaration.ParameterListTreeImpl.accept(ParameterListTreeImpl.java:98)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitCallExpression(DoubleDispatchVisitor.java:438)
    at org.sonar.javascript.tree.impl.expression.CallExpressionTreeImpl.accept(CallExpressionTreeImpl.java:68)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitExpressionStatement(DoubleDispatchVisitor.java:250)
    at org.sonar.javascript.tree.impl.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:66)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitBlock(DoubleDispatchVisitor.java:234)
    at org.sonar.javascript.tree.impl.statement.BlockTreeImpl.accept(BlockTreeImpl.java:83)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitFunctionExpression(DoubleDispatchVisitor.java:483)
    at org.sonar.javascript.checks.DeadStoreCheck.visitFunctionExpression(DeadStoreCheck.java:78)
    at org.sonar.javascript.tree.impl.expression.FunctionExpressionTreeImpl.accept(FunctionExpressionTreeImpl.java:174)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitParenthesisedExpression(DoubleDispatchVisitor.java:459)
    at org.sonar.javascript.tree.impl.expression.ParenthesisedExpressionTreeImpl.accept(ParenthesisedExpressionTreeImpl.java:80)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitCallExpression(DoubleDispatchVisitor.java:437)
    at org.sonar.javascript.tree.impl.expression.CallExpressionTreeImpl.accept(CallExpressionTreeImpl.java:68)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitExpressionStatement(DoubleDispatchVisitor.java:250)
    at org.sonar.javascript.tree.impl.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:66)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitBlock(DoubleDispatchVisitor.java:234)
    at org.sonar.javascript.tree.impl.statement.BlockTreeImpl.accept(BlockTreeImpl.java:83)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitFunctionExpression(DoubleDispatchVisitor.java:483)
    at org.sonar.javascript.checks.DeadStoreCheck.visitFunctionExpression(DeadStoreCheck.java:78)
    at org.sonar.javascript.tree.impl.expression.FunctionExpressionTreeImpl.accept(FunctionExpressionTreeImpl.java:174)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitParameterList(DoubleDispatchVisitor.java:222)
    at org.sonar.javascript.tree.impl.declaration.ParameterListTreeImpl.accept(ParameterListTreeImpl.java:98)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitCallExpression(DoubleDispatchVisitor.java:438)
    at org.sonar.javascript.tree.impl.expression.CallExpressionTreeImpl.accept(CallExpressionTreeImpl.java:68)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitExpressionStatement(DoubleDispatchVisitor.java:250)
    at org.sonar.javascript.tree.impl.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:66)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitBlock(DoubleDispatchVisitor.java:234)
    at org.sonar.javascript.tree.impl.statement.BlockTreeImpl.accept(BlockTreeImpl.java:83)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitFunctionDeclaration(DoubleDispatchVisitor.java:229)
    at org.sonar.javascript.checks.DeadStoreCheck.visitFunctionDeclaration(DeadStoreCheck.java:72)
    at org.sonar.javascript.tree.impl.declaration.FunctionDeclarationTreeImpl.accept(FunctionDeclarationTreeImpl.java:118)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitBlock(DoubleDispatchVisitor.java:234)
    at org.sonar.javascript.tree.impl.statement.BlockTreeImpl.accept(BlockTreeImpl.java:83)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitFunctionExpression(DoubleDispatchVisitor.java:483)
    at org.sonar.javascript.checks.DeadStoreCheck.visitFunctionExpression(DeadStoreCheck.java:78)
    at org.sonar.javascript.tree.impl.expression.FunctionExpressionTreeImpl.accept(FunctionExpressionTreeImpl.java:174)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitCallExpression(DoubleDispatchVisitor.java:437)
    at org.sonar.javascript.tree.impl.expression.CallExpressionTreeImpl.accept(CallExpressionTreeImpl.java:68)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitParenthesisedExpression(DoubleDispatchVisitor.java:459)
    at org.sonar.javascript.tree.impl.expression.ParenthesisedExpressionTreeImpl.accept(ParenthesisedExpressionTreeImpl.java:80)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitExpressionStatement(DoubleDispatchVisitor.java:250)
    at org.sonar.javascript.tree.impl.statement.ExpressionStatementTreeImpl.accept(ExpressionStatementTreeImpl.java:66)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:125)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitModule(DoubleDispatchVisitor.java:146)
    at org.sonar.javascript.tree.impl.declaration.ModuleTreeImpl.accept(ModuleTreeImpl.java:56)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.visitScript(DoubleDispatchVisitor.java:141)
    at org.sonar.javascript.tree.impl.declaration.ScriptTreeImpl.accept(ScriptTreeImpl.java:73)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scan(DoubleDispatchVisitor.java:114)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor.scanTree(DoubleDispatchVisitor.java:109)
    at org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitorCheck.scanFile(DoubleDispatchVisitorCheck.java:34)
    at org.sonar.plugins.javascript.JavaScriptSquidSensor.scanFile(JavaScriptSquidSensor.java:232)
    at org.sonar.plugins.javascript.JavaScriptSquidSensor.analyse(JavaScriptSquidSensor.java:185)
    ... 32 more
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
15:10:30.043  Creating a summary markdown file...
15:10:30.049  Post-processing failed. Exit code: 1

看起来异常发生“引起:java.lang.IllegalStateException:没有找到标记输出的中断目标”但我不知道如何修复它...任何人都可以帮我解决这个问题?

感谢。

1 个答案:

答案 0 :(得分:1)

尝试更新JavaScript插件(SonarJS)。在2.14中有一个ticket使得这个异常不那么重要,你的文件根本就没有被解析(因此没有被分析),但项目的其余部分都没问题。

当你在之前未声明的break语句中使用label时,会发生这种情况。所以修复代码也应该有所帮助。