Vscode安装sonarlint后分析c++代码0错误

Please provide

  • Operating system:window11
  • SonarLint plugin version:3.22.0
  • Programming language you’re coding in: c++
  • Is connected mode used:no
    • Connected to SonarCloud or SonarQube (and which version):

And a thorough description of the problem / question:
安装sonarlint,并使用cmake生成了compile_commands.json,但一直显示0错误

Executing c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\jre\17.0.8.1-win32-x86_64.tar\bin\java -jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\server\sonarlint-ls.jar -stdio -analyzers c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonargo.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarjava.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarjs.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarphp.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarpython.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarhtml.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarxml.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonarcfamily.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonartext.jar c:\Users\zyu\.vscode\extensions\sonarsource.sonarlint-vscode-3.22.0-win32-x64\analyzers\sonariac.jar
[stderr] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[stderr] SLF4J: Defaulting to no-operation (NOP) logger implementation
[stderr] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception occurred while initializing the Git API: Error: Git model not found
[Debug - 10:15:48.480] Fetching global configuration
[Debug - 10:15:48.500] Queuing analysis of file "file:///w:/source/test/malgorithm.cpp" (version 1)
[Debug - 10:15:48.501] Queuing analysis of file "file:///w:/source/.vscode/c_cpp_properties.json" (version 1)
Error requesting ignored status, consider all files not ignored: 
 Error: Git model not found
[Debug - 10:15:48.504] Cached SCM ignore status for file "file:///w:/source/test/malgorithm.cpp": Not ignored
[Warn  - 10:15:48.508] Using ${workspaceFolder} variable in sonarlint.pathToCompileCommands is only supported for files in the workspace
[Info  - 10:15:58.576] Started embedded server on port 64120
[Debug - 10:15:58.584] Restoring previous local-only issue database from C:\Users\zyu\.sonarlint\storage\local_only_issue_backup.tar.gz
[Debug - 10:15:58.594] Starting local-only issue database from C:\Users\zyu\.sonarlint\xodus-local-only-issue-store16518706786045728356
[Debug - 10:15:58.841] No connections configured, skipping binding suggestions.
[Debug - 10:15:58.846] Fetching configuration for folder 'file:///w:/source'
[Debug - 10:15:58.849] No connections configured, skipping binding suggestions.
[Info  - 10:15:58.853] Analyzing file "file:///w:/source/test/malgorithm.cpp"...
[Debug - 10:15:58.853] Workspace folder 'WorkspaceFolder[name=source,uri=file:///w:/source]' configuration updated: WorkspaceFolderSettings[analyzerProperties={},connectionId=<null>,pathToCompileCommands=w:\source\build\compile_commands.json,projectKey=<null>,testFilePattern=]
[Debug - 10:15:58.856] Global settings updated: WorkspaceSettings[connections={},disableTelemetry=false,excludedRules=[],focusOnNewCode=false,includedRules=[cpp:S126, cpp:S1055, cpp:S991],pathToNodeExecutable=,ruleParameters={},showAnalyzerLogs=true,showVerboseLogs=true]
[Debug - 10:15:58.862] Default settings updated: WorkspaceFolderSettings[analyzerProperties={},connectionId=<null>,pathToCompileCommands=${workspaceFolder}\build\compile_commands.json,projectKey=<null>,testFilePattern=]
[Debug - 10:15:58.865] Analysis triggered with configuration:
[
  baseDir: w:\source
  extraProperties: {sonar.cfamily.compile-commands=w:\source\build\compile_commands.json}
  moduleKey: file:///w:/source
  excludedRules: []
  includedRules: [cpp:S126, cpp:S1055, cpp:S991]
  ruleParameters: {}
  inputFiles: [
    file:///w:/source/test/malgorithm.cpp (UTF-8) [cpp]
  ]
]

[Debug - 10:15:58.865] Starting standalone SonarLint engine...
[Debug - 10:15:58.865] Using 10 analyzers
[Debug - 10:15:58.871] Looking for node in the PATH
[Debug - 10:15:58.877] Execute command 'C:\Windows\System32\where.exe $PATH:node.exe'...
[Debug - 10:15:58.954] Command 'C:\Windows\System32\where.exe $PATH:node.exe' exited with 1
stderr: ��Ϣ: ���ṩ��ģʽ�޷��ҵ��ļ���
[Debug - 10:15:58.954] Unable to locate node
[Debug - 10:15:58.984] Plugin 'JavaScript/TypeScript/CSS Code Quality and Security' requires Node.js 14.17.0. Skip loading it.
[Debug - 10:15:58.988] Loaded 9 plugins
[Debug - 10:15:58.988]   * CFamily Code Quality and Security 6.49.0.62722 (cpp)
[Debug - 10:15:58.988]   * Python Code Quality and Security 4.8.0.12420 (python)
[Debug - 10:15:58.988]   * Java Code Quality and Security 7.25.0.32245 (java)
[Debug - 10:15:58.988]   * HTML Code Quality and Security 3.9.0.3600 (web)
[Debug - 10:15:58.988]   * XML Code Quality and Security 2.10.0.4108 (xml)
[Debug - 10:15:58.989]   * Go Code Quality and Security 1.15.0.4655 (go)
[Debug - 10:15:58.989]   * PHP Code Quality and Security 3.32.0.10180 (php)
[Debug - 10:15:58.989]   * IaC Code Quality and Security 1.21.0.5999 (iac)
[Debug - 10:15:58.989]   * Text Code Quality and Security 2.5.0.2293 (text)
[Debug - 10:16:00.346] Creating container for module 'file:///w:/source'
[Debug - 10:16:00.359] Standalone SonarLint engine started
[Debug - 10:16:00.419] Start analysis
[Info  - 10:16:00.436] Index files
[Debug - 10:16:00.440] Language of file "file:///w:/source/test/malgorithm.cpp" is set to "C++"
[Info  - 10:16:00.444] 1 file indexed
[Debug - 10:16:00.463] Loading C:\Users\zyu\AppData\Local\Temp\sonarsource-cfamily-jni3267253775472953908.dll
[Debug - 10:16:00.931] 'JavaSensor' skipped because there is no related files in the current project
[Debug - 10:16:00.932] Execute Sensor: CFamily
[Debug - 10:16:00.948] Unpacking analyzer to: C:\Users\zyu\.sonarlint\work\.sonarlinttmp_976197715684166064\16067070513089007753
[Info  - 10:16:02.366] Parsing compilation database w:\source\build\compile_commands.json
[Debug - 10:16:02.374] Time to parse Compilation Database: 12ms
[Info  - 10:16:02.375] \\192.168.60.12\root\source\test\malgorithm.cpp using compilation database entry with same name and different directory: /root/source/test/malgorithm.cpp
[Info  - 10:16:02.378] Subprocess(es) done in 28ms
[Info  - 10:16:02.378] 0 compilation units analyzed
[Debug - 10:16:02.378] 'Python Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.378] 'IPython Notebooks Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.379] Execute Sensor: HTML
[Debug - 10:16:02.380] 'XML Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.380] 'Code Quality and Security for Go' skipped because there is no related files in the current project
[Debug - 10:16:02.380] 'PHP sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.381] 'Analyzer for "php.ini" files' skipped because there is no related files in the current project
[Debug - 10:16:02.381] 'IaC Terraform Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.381] 'IaC CloudFormation Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.381] 'IaC Kubernetes Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.381] 'IaC AzureResourceManager Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.381] Execute Sensor: TextAndSecretsSensor
[Info  - 10:16:02.673] 1 source file to be analyzed
[Info  - 10:16:02.683] 1/1 source file has been analyzed
[Debug - 10:16:02.684] Execute Sensor: IaC Docker Sensor
[Info  - 10:16:02.687] 0 source files to be analyzed
[Info  - 10:16:02.742] 0/0 source files have been analyzed
[Info  - 10:16:02.759] Found 0 issues
Error requesting ignored status, consider all files not ignored: 
 Error: Git model not found
[Debug - 10:16:02.760] Cached SCM ignore status for file "file:///w:/source/.vscode/c_cpp_properties.json": Not ignored
[Info  - 10:16:02.761] Analyzing file "file:///w:/source/.vscode/c_cpp_properties.json"...
[Debug - 10:16:02.762] Analysis triggered with configuration:
[
  baseDir: w:\source
  extraProperties: {sonar.cfamily.compile-commands=w:\source\build\compile_commands.json}
  moduleKey: file:///w:/source
  excludedRules: []
  includedRules: [cpp:S126, cpp:S1055, cpp:S991]
  ruleParameters: {}
  inputFiles: [
    file:///w:/source/.vscode/c_cpp_properties.json (UTF-8)
  ]
]

[Debug - 10:16:02.778] Start analysis
[Info  - 10:16:02.785] Index files
[Info  - 10:16:02.786] 1 file indexed
[Debug - 10:16:02.822] 'JavaSensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'CFamily' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'Python Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'IPython Notebooks Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] Execute Sensor: HTML
[Debug - 10:16:02.823] 'XML Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'Code Quality and Security for Go' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'PHP sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'Analyzer for "php.ini" files' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'IaC Terraform Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'IaC CloudFormation Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'IaC Kubernetes Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] 'IaC AzureResourceManager Sensor' skipped because there is no related files in the current project
[Debug - 10:16:02.823] Execute Sensor: TextAndSecretsSensor
[Info  - 10:16:02.857] 1 source file to be analyzed
[Info  - 10:16:02.860] 1/1 source file has been analyzed
[Debug - 10:16:02.860] Execute Sensor: IaC Docker Sensor
[Info  - 10:16:02.861] 0 source files to be analyzed
[Info  - 10:16:02.866] 0/0 source files have been analyzed
[Info  - 10:16:02.871] Found 0 issues

Closing as duplicate of