How to have frontend + backend sonar scan results displayed together on a single project

Hi,

We have a azure repo containing both frontend and backend test cases. We have created a project based on azure repo on sonarqube portal.I have created a azure pipeline wherein it runs test cases for both frontend and backend in stages. Pipeline run frontend stage(run unit test + code coverage + sonar scan) and then same backend(.net unt test cases) while backend stage runs I can see the result published for frontend on sonarqube portal but when backend stage is completed, front end test and sonar scan data is overridden by backend. Is it possible to hold front end + backend scan data together on sonarqube portal?

Here is the snipped of code that I am using:

jobs:
      - job: Running_frontend_unit
        displayName: Running frontend Unit 
        pool:
          #vmImage: windows-latest

        steps:
          - checkout: self

          - task: SonarQubePrepare@5
            displayName: Prepare SonarQube analysis
            inputs:
              SonarQube: 'YYYYYYYYYYY'
              scannerMode: 'CLI'
              configMode: 'manual'
              cliProjectKey: 'XXXXXXXXXXX'
              cliSources: 'sc'
              extraProperties: |
                # Additional properties that will be passed to the scanner, 
                # Put one key=value per line, example:
                # sonar.exclusions=**/*.bin
                sonar.tests=sc
                sonar.sourceEncoding=UTF-8
                sonar.test.inclusions=**/*.spec.js
                sonar.testExecutionReportPaths=sc/coverage/test-reporter.xml
                sonar.javascript.lcov.reportPaths=sc/coverage/lcov.info

          - task: NodeTool@0
            displayName: Install Node Tool
            inputs:
              versionSource: 'spec'
              versionSpec: '14.x'

          - task: Npm@1
            displayName: npm install
            inputs:
              command: 'install'
              workingDir: 'sc/'
      
          - task: Npm@1
            displayName: npm run test
            inputs:
              command: 'custom'
              workingDir: 'sc/'
              customCommand: 'run test'
        

          - task: PublishTestResults@2
            displayName: 'Publishing test results'
            condition: succeededOrFailed()
            inputs:
              testResultsFormat: 'JUnit'
              testResultsFiles: '**/junit.xml'


          - task: PublishCodeCoverageResults@1
            displayName: 'Publish code coverage results'
            condition: succeededOrFailed()
            inputs:
              codeCoverageTool: Cobertura
              summaryFileLocation: $(System.DefaultWorkingDirectory)/sc/coverage/cobertura-coverage.xml
          
          - task: SonarQubeAnalyze@5
            inputs:
              jdkversion: 'JAVA_HOME_17_X64'
            displayName: Run Code Analysis

          - task: SonarQubePublish@5
            displayName: Publish Quality Gate Result





  ###############################################################################
  ############## BACKEND- RUN .NET UNIT TESTS & SONARQUBE TESTS #################
  ###############################################################################

  - stage: Running_Backend_Unit_Tests
    displayName: "🚀 Running Backend Unit Tests 🚀"
    variables:
      - group: "BUILD-OneDigital-SC-Variable-Sonarqube"

    jobs:
      - job: Running_backend_unit_tests
        displayName: Running Backend Unit Tests
        pool:
          #vmImage: windows-latest
        timeoutInMinutes: 0  
        steps:
          - checkout: self
            persistCredentials: true

          - task: SonarQubePrepare@5
            displayName: Prepare SonarQube analysis
            inputs:
              SonarQube: YYYYYYYYY
              projectKey: XXXXXXXXXX
              projectName: sonarproject
              extraProperties: "# Additional properties that will be passed to the scanner, \n# Put one key=value per line, example:\n# sonar.exclusions=**/*.bin\n"

          - task: NuGetToolInstaller@1
            displayName: Download latest version of NuGet.exe
            inputs:
              checkLatest: true

          - task: NuGetCommand@2
            displayName: NuGet restore
            inputs:
              feedsToUse: config
              nugetConfigPath: sc/NuGet.config

          - task: VSBuild@1
            displayName: Build solution **\.sln
            continueOnError: True
            inputs:
              solution: '**\.sln'
              configuration: Debug
              maximumCpuCount: true

          - task: VSTest@2
            displayName: VsTest - testAssemblies
            inputs:
              codeCoverageEnabled: true
              runInParallel: true

          - task: SonarQubeAnalyze@5
            displayName: Run Code Analysis

          - task: SonarQubePublish@5
            displayName: Publish Quality Gate Result

Hey there.

You’ll need to include your frontend (JS) files in your backend (.NET) analysis. Take a look at this section of the documentation.