How do I analyze 2 languages in 1 repo

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Languages of the repository: C#, JS/TS/CSS

I’m just evaluating SonarCloud. We have have a repo with 1 C# project and 1 JS project.

For c# project I use:

  • task: SonarCloudPrepare@1
    inputs:
    SonarCloud: ‘SonarCloud connection’
    organization: ‘xxxx’
    scannerMode: ‘MSBuild’
    projectKey: ‘xxxx_ProjName’
    projectName: ‘ProjName’

For JS project I use:

  • task: SonarCloudPrepare@1
    inputs:
    SonarCloud: ‘SonarCloud connection’
    organization: ‘xxxx’
    scannerMode: ‘CLI’
    configMode: ‘manual’
    cliProjectKey: ‘xxxx_ProjName’
    cliProjectName: ‘ProjName’
    cliSources: ‘src/Web/UI’

The pipeline runs the 2 builds in parallel. I can see that analysis for the C# gets created first, then the analysis for the JS, so I only see the latest analysis for the JS. Is there any way to combine these into 1 analysis, or should I create 2 projects in SonarCloud?

Hey there.

Creating two projects in SonarCloud is one option – but you can also combine these into one analysis. Check the documentation on Scanner for .NET > Advanced Topics > Analyzing languages other than C# and VB

Thanks for the fast response. For now, I’ve set things up as a monorepo with 2 projects, but I may try your other suggestion later.

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