Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception analyzing SonarJS code: java.lang.IllegalArgumentException: Start pointer [...] should be before end pointer [...] #4207

Closed
alex-sonar opened this issue Sep 27, 2023 · 0 comments · Fixed by #4257
Assignees
Labels
type: bug Exceptions and blocking issues during analysis

Comments

@alex-sonar
Copy link
Contributor

Running SQ analysis on our code triggers exception when saving issues from packages/jsts/tests/tools/testers/comment-based/helpers/quickfixes.ts

java.lang.IllegalArgumentException: Start pointer [line=48, lineOffset=22] should be before end pointer [line=48, lineOffset=22]
        at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:383)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:324)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.newSecondaryLocation(AnalysisProcessor.java:344)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.lambda$saveIssue$0(AnalysisProcessor.java:283)
        at java.base/java.util.ArrayList.forEach(Unknown Source)

config:

sonar.sources=packages
sonar.tests=packages
sonar.exclusions=packages/**/*.test.ts,packages/**/*.fixture.*,packages/**/fixtures/**/*
sonar.test.inclusions=packages/**/*.test.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.typescript.tsconfigPath=packages/tsconfig.app.json,packages/tsconfig.test.json
sonar.cpd.exclusions=sonar-plugin/javascript-checks/src/main/resources/**/*.html
sonar.sourceEncoding=UTF-8
sonar.verbose=true

log fragment:

14:17:13.464 DEBUG: Cache strategy set to 'WRITE_ONLY' for file 'packages/jsts/tests/tools/testers/comment-based/helpers/quickfixes.ts' as current analysis requires all files to be analyzed
14:17:13.465 DEBUG: Analyzing file: file:///C:/Users/alexander.kamushkin/Work/sonarjs/packages/jsts/tests/tools/testers/comment-based/helpers/quickfixes.ts
14:17:13.467 DEBUG: Analyzing file "C:/Users/alexander.kamushkin/Work/sonarjs/packages/jsts/tests/tools/testers/comment-based/helpers/quickfixes.ts" with linterId "default"
14:17:13.471 DEBUG: Using linter configuration for {"fileType":"MAIN","language":"ts"}
14:17:13.541 DEBUG: Saving issue for rule slow-regex on line 29
14:17:13.542 DEBUG: Saving issue for rule regex-complexity on line 38
14:17:13.545 ERROR: Failure during analysis, Node.js command to start the bridge was: C:\Program Files\nodejs\node.exe C:\Users\alexander.kamushkin\Work\sonarjs\.scannerwork\.sonartmp\bridge-bundle\package\bin\server 63096 127.0.0.1 C:\Users\alexander.kamushkin\Work\sonarjs\.scannerwork true false C:\Users\alexander.kamushkin\Work\sonarjs\.scannerwork\.sonartmp\bridge-bundle\package\custom-rules18220177188350572283\package
java.lang.IllegalArgumentException: Start pointer [line=48, lineOffset=22] should be before end pointer [line=48, lineOffset=22]
        at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:383)
        at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:324)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.newSecondaryLocation(AnalysisProcessor.java:344)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.lambda$saveIssue$0(AnalysisProcessor.java:283)
        at java.base/java.util.ArrayList.forEach(Unknown Source)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.saveIssue(AnalysisProcessor.java:282)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.saveIssues(AnalysisProcessor.java:179)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.processResponse(AnalysisProcessor.java:112)
        at org.sonar.plugins.javascript.eslint.AnalysisWithProgram.analyze(AnalysisWithProgram.java:164)
        at org.sonar.plugins.javascript.eslint.AnalysisWithProgram.analyzeProgram(AnalysisWithProgram.java:133)
        at org.sonar.plugins.javascript.eslint.AnalysisWithProgram.analyzeFiles(AnalysisWithProgram.java:94)
        at org.sonar.plugins.javascript.eslint.JsTsSensor.analyzeFiles(JsTsSensor.java:124)
        at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:74)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
        at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:398)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:394)
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:363)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:139)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        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:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
        at org.sonarsource.scanner.cli.Main.main(Main.java:62)
@alex-sonar alex-sonar added the type: bug Exceptions and blocking issues during analysis label Sep 27, 2023
@alex-sonar alex-sonar changed the title Exception analyzing SonarJS code: java.lang.IllegalArgumentException: Start pointer [line=48, lineOffset=22] should be before end pointer [line=48, lineOffset=22] Exception analyzing SonarJS code: java.lang.IllegalArgumentException: Start pointer [...] should be before end pointer [...] Sep 27, 2023
@alex-sonar alex-sonar self-assigned this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Exceptions and blocking issues during analysis
Projects
None yet
1 participant