SonarLint - Proxy - Apex support

Template for a good new topic, formatted with Markdown:

  • ALM used - Azure DevOps
  • CI system used Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository - Apex
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • When a apex component is saved, SonarLint identifies the class as “Apex” and when behind the proxy, the codequality errors are not returned or shown.
    When outside the proxy, works like a charm

Hi @anilkumar.sistla

Could you please specify the IDE you are using (I’m assuming this is VSCode, but I would like to be sure)? Can you look at the SonarLint output and provide us logs of the error?

SonarLint for VSCode do not supports HTTP proxy with authentication, but I think you can make it work if you can have anonymous access. Can you explain your case.

Thanks for the feedback,

Hello @Julien_HENRY
We are using Visual Studio Code (VSCode). Proxy is with authentication.
Below is the log (obfuscated the username), as you can see from the log file the apex analyzer is not getting downloaded

Executing C:\Program Files\Java\jdk1.8.0_211\bin\java -jar c:\Users\XXXXXXX\.vscode\extensions\sonarsource.sonarlint-vscode-1.9.0\server\sonarlint-ls.jar 61741 file:///c:/Users/XXXXXXX/.vscode/extensions/sonarsource.sonarlint-vscode-1.9.0/analyzers/sonarjs.jar file:///c:/Users/XXXXXXX/.vscode/extensions/sonarsource.sonarlint-vscode-1.9.0/analyzers/sonarphp.jar file:///c:/Users/XXXXXXX/.vscode/extensions/sonarsource.sonarlint-vscode-1.9.0/analyzers/sonarpython.jar file:///c:/Users/XXXXXXX/.vscode/extensions/sonarsource.sonarlint-vscode-1.9.0/analyzers/sonarts.jar file:///c:/Users/XXXXXXX/.vscode/extensions/sonarsource.sonarlint-vscode-1.9.0/analyzers/sonarhtml.jar
Binding to 61741
Child process connected on port 61741
Starting connected SonarLint engine for bFOCodeQualityGateCheck...
Create : C:\Users\XXXXXXX\.sonarlint\plugins
Plugin cache: C:\Users\XXXXXXX\.sonarlint\plugins
Create : C:\Users\XXXXXXX\.sonarlint\plugins\_tmp
Load plugins
Load plugins (done) | time=1ms
No plugins loaded
[Warn  - 4:31:03 PM] No storage for server 'bFOCodeQualityGateCheck'. Please update.
Connected SonarLint engine started for bFOCodeQualityGateCheck
[Warn  - 4:31:03 PM] Storage of server 'bFOCodeQualityGateCheck' requires an update
Analysis triggered on file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PermissionSetGroupMethods.cls with configuration: 
[
  baseDir: c:\bfocode\development
  extraProperties: {}
  excludedRules: []
  includedRules: []
  inputFiles: [
    file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PermissionSetGroupMethods.cls (UTF-8) [apex]
  ]
]

Starting standalone SonarLint engine...
Using 5 analyzers
Create : C:\Users\XXXXXXX\.sonarlint\plugins
Plugin cache: C:\Users\XXXXXXX\.sonarlint\plugins
Create : C:\Users\XXXXXXX\.sonarlint\plugins\_tmp
Load plugins
Load plugins (done) | time=34ms
Plugins:
  * SonarPHP 3.0.0.4537 (php)
  * SonarPython 1.12.0.2726 (python)
  * SonarTS 1.9.0.3766 (typescript)
  * SonarHTML 3.1.0.1615 (web)
  * SonarJS 5.1.1.7506 (javascript)
[Info  - 4:31:10 PM] Starting SonarTS Server
Deploying bundle to C:\Users\XXXXXXX\.sonarlint\work\.sonartmp_3725850202857372756\6416716603050279769
[Info  - 4:31:24 PM] Using typescript at [c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript], version 3.5.2
[Info  - 4:31:24 PM] SonarTS Server is started
Standalone SonarLint engine started
[Info  - 4:31:24 PM] SonarTS Server connected to 61804
Available languages:
  * PHP => "php"
  * Python => "py"
  * TypeScript => "ts"
  * HTML => "web"
  * JSP => "jsp"
  * JavaScript => "js"
Start analysis
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
[Info  - 4:31:24 PM] Index files
Language of file 'file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PermissionSetGroupMethods.cls' is set to 'apex'
[Info  - 4:31:25 PM] 1 file indexed
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
'Contextual SonarTS' skipped because there is no related file in current project
Execute Sensor: HTML
'SonarJS' skipped because there is no related file in current project
'ESLint-based SonarJS' skipped because there is no related file in current project
Aug 19, 2019 4:31:27 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 1
Analysis triggered on file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PLAT_ProcessUSGAssignment.cls with configuration: 
[
  baseDir: c:\bfocode\development
  extraProperties: {}
  excludedRules: []
  includedRules: []
  inputFiles: [
    file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PLAT_ProcessUSGAssignment.cls (UTF-8) [apex]
  ]
]

Available languages:
  * PHP => "php"
  * Python => "py"
  * TypeScript => "ts"
  * HTML => "web"
  * JSP => "jsp"
  * JavaScript => "js"
Start analysis
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language TypeScript were converted to ts: **/*.ts,**/*.tsx
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
[Info  - 4:34:18 PM] Index files
Language of file 'file:///c%3A/bfocode/development/force-app/main/default/classes/AP_PLAT_ProcessUSGAssignment.cls' is set to 'apex'
[Info  - 4:34:18 PM] 1 file indexed
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
'Contextual SonarTS' skipped because there is no related file in current project
Execute Sensor: HTML
'SonarJS' skipped because there is no related file in current project
'ESLint-based SonarJS' skipped because there is no related file in current project

Starting connected SonarLint engine for bFOCodeQualityGateCheck…
[Warn - 4:31:03 PM] No storage for server ‘bFOCodeQualityGateCheck’. Please update.

That’s the first issue to investigate.

Could you please: