Setup Project with C# , Python and java

We have SonarQube version 9.3.0.51899. We have a new repository with .net and python codes in 2 separate folders. Is it possible to scan both and generate a single report?
I already tried below suggested by @ganncamp and it still doesn’t scan Python files.

Added my references like this in a .csproj file:

<ItemGroup>
	<Content Include="..\..\..\deploy\CDK\CDKInfrastructure\my_cdk_stack.py" />
  </ItemGroup>

Please suggest.

Hi @savanthakkar - welcome to the community.

It’s possible the python files are not being analysed because they are not under the directory containing the MSBuild project.

Try setting the sonar.projectBaseDir property to a directory higher up the directory tree - one that is a parent directory to both the .NET and python files (i.e. pass /d:sonar.projectBaseDir=xxx in the begin step).

If that doesn’t work, please share the verbose logs for the end step. You can get verbose logs by passing /d:sonar.verbose=true to the scanner in the begin step.

Setting sonar.projectBaseDir did the trick. Thank you @duncanp !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.