The main branch of this project is empty message in Dashboard

which versions are you using

SonarQube: Developer Edition 8.9.0.43852
Scanner: sonar-scanner-4.5.0.2216-linux

what are you trying to achieve

See project’s stats in the main dashboard.

The issue in more details

We can’t see the info of a project in the main dashboard.
Instead of the info we see the sentence: The main branch of this project is empty.

See screenshot for more details:

But, when we click on the project’s name and transferred to the projects page, we can see all the details under the New Code and Overall Code tabs.

See screenshots for more details:

New Code:

Overall Code:

Please note: before creating this new topic, I searched and read all most all of the older questions regarding similar issues, but to me, none of them seemed to be relevant.
I apologise in advanced if I created a duplicate topic…

Our setup:

Language: TypeScript
CI: Jenkins

Log

[Pipeline] stage
[Pipeline] { (SonarQube)
[Pipeline] script
[Pipeline] {
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: acme SonarQube Server
[Pipeline] {
[Pipeline] echo
acme SonarQube Server
[Pipeline] echo
http://sonar-dev.acme.com:9000
[Pipeline] echo
******
[Pipeline] sh
+ npm run sonar

> taxcalculator@0.0.1 sonar /jenkins-agent/workspace/acme_devops-sonar-reports-tests
> sonar-scanner

[07:54:51] Starting analysis...
[07:54:51] Checking if executable exists: /home/ubuntu/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/bin/sonar-scanner
[07:54:51] Platform binaries for SonarScanner found. Using it.
INFO: Scanner configuration file: /home/ubuntu/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/sonar-project.properties
INFO: SonarScanner 4.5.0.2216
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 5.4.0-1029-aws amd64
INFO: User cache: /home/ubuntu/.sonar/cache
INFO: Scanner configuration file: /home/ubuntu/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/sonar-project.properties
INFO: Analyzing on SonarQube server 8.9.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=104ms
INFO: Server id: 3F152884-AXmkqqq-JISkHS5NJ3VS
INFO: User cache: /home/ubuntu/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=52ms
INFO: Load/download plugins (done) | time=214ms
INFO: Loaded core extensions: developer-scanner
INFO: JavaScript/TypeScript frontend is enabled
INFO: Process project properties
INFO: Process project properties (done) | time=12ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: server-acme-project
INFO: Base dir: /jenkins-agent/workspace/acme_devops-sonar-reports-tests
INFO: Working dir: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork
INFO: Load project settings for component key: 'server-acme-project'
INFO: Load project settings for component key: 'server-acme-project' (done) | time=17ms
INFO: Load project branches
INFO: Load project branches (done) | time=23ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=23ms
INFO: Load branch configuration
INFO: Detected branch/PR in 'Jenkins'
INFO: Auto-configuring branch 'devops-sonar-reports-tests'
INFO: Load branch configuration (done) | time=3ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=72ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load active rules
INFO: Load active rules (done) | time=1223ms
INFO: Branch name: devops-sonar-reports-tests
INFO: Indexing files...
INFO: Project configuration:
INFO:   Included sources: src/**/*.ts
INFO:   Excluded sources: src/**/*.spec.ts, src/**/*mock*.ts, src/**/*Mock*.ts, src/**/*.test.ts, src/**/*.snap, src/docs/**/*, src/recordings/**/*, src/public/**/*, src/**/*.spec.ts, src/**/*.test.ts
INFO:   Included tests: src/**/*.spec.ts, src/**/*.test.ts
INFO: 553 files indexed
INFO: 840 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for ts: All in
INFO: ------------- Run sensors on module server-acme Project
INFO: JavaScript/TypeScript frontend is enabled
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=16ms
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=4ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=5ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=5ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=4ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Deploying custom rules bundle jar:file:/home/ubuntu/.sonar/cache/1c0d0d6d358b2ff25a27998c60079e2e/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules11312942776642891406
INFO: Found 1 tsconfig.json file(s): [/jenkins-agent/workspace/acme_devops-sonar-reports-tests/tsconfig.json]
ERROR: Unknown compiler option 'noImplicitOverride'.
INFO: Skipping 437 files with no tsconfig.json
INFO: 437 source files to be analyzed
INFO: 437/437 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=3577ms
INFO: Sensor JavaScript/TypeScript Coverage [javascript]
WARN: No coverage information will be saved because LCOV file cannot be found.
WARN: Provided LCOV file path: reports/jest-coverage/**/lcov.info. Seek file with path: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/reports/jest-coverage/**/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=1ms
INFO: Sensor Import of ESLint issues [javascript]
INFO: Importing /jenkins-agent/workspace/acme_devops-sonar-reports-tests/reports/eslint/js-lint-results.json
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/bitcoin-address-pair-mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/collaborator-mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/exchange-file-mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/transactions-mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/user-address-mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/user-mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/__mocks__/user-transaction-mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/binance/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/bit2c/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/bitfinex/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/bitstamp/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/bittrex/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/cryptopia/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/gemini/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/hitBtc/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/kraken/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/files/poloniex/index.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/mappers/exchange.mapper.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/services/fileTypeHandler.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/services/jsonData.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/tests/regressionParser.test.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/regression-parser/tests/regressionSpecific.test.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/report_summary_test/report-summary.test.ts. No ESLint issues will be imported on this file.
INFO: Load project repositories
INFO: Load project repositories (done) | time=94ms
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/DAL/userTransaction/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/DAL/utxo/utxo.mapper.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/models/strategyFillUserExchangeTransaction/rates.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/models/strategyFillUserExchangeTransaction/stratergyFillRates.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/models/strategyFillUserExchangeTransaction/uniqPoloniexRateDeposit.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/models/strategyFillUserExchangeTransaction/uniqueRatesGroup.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/models/xlsColumn.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/public/btcusd.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/public/ethusd.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/public/madad.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/public/madadOld.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/public/usdils.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/remote/blockchair/mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/remote/etherscan/mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Binance/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Bit2C/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Bitfinex/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Bitstamp/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Bittrex/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Cexio/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Coinbase/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/GeneralParserService/generalParserService.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Hitbtc/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Kraken/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Poloniex/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/Staking/Kraken/mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/deposit.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/fileType.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/rates.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/ratesWithdrawal.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/withdrawal.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FileTypeHandler/withdrawalRates.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/FillAsset/fillAsset.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/chain/fillCurrencies/fillCurrencies.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/cryptopia/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/exchange/gemini/geminiCsv.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/CommentService/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/calcService/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/client/mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/mappers/TablesXlsMapper.mock.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/mocks.ts. No ESLint issues will be imported on this file.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/reports/nodes.mock.ts. No ESLint issues will be imported on this file.
WARN: Invalid character encountered in file /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/services/utils.ts at line 77 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: No input file found for /jenkins-agent/workspace/acme_devops-sonar-reports-tests/src/types/custom.d.ts. No ESLint issues will be imported on this file.
INFO: Sensor Import of ESLint issues [javascript] (done) | time=621ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=2ms
INFO: Sensor Generic Test Executions Report
INFO: Parsing /jenkins-agent/workspace/acme_devops-sonar-reports-tests/reports/jestSonar-unit-test-reporter.xml
INFO: Imported test execution data for 116 files
INFO: Sensor Generic Test Executions Report (done) | time=232ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=12ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=0ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=0ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /jenkins-agent/workspace/acme_devops-sonar-reports-tests/.scannerwork/ucfg2/js
INFO: No UCFGs have been included for analysis.
INFO: Sensor JsSecuritySensor [security] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=3ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Load New Code definition
INFO: Load New Code definition (done) | time=15ms
INFO: Analysis report generated in 284ms, dir size=2 MB
INFO: Analysis report compressed in 527ms, zip size=873 KB
INFO: Analysis report uploaded in 76ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://sonar-dev.acme.com:9000/dashboard?id=server-acme-project&branch=devops-sonar-reports-tests
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://sonar-dev.acme.com:9000/api/ce/task?id=AXx4pcl2W9-h2efnCRWA
INFO: Analysis total time: 15.862 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 17.276s
INFO: Final Memory: 20M/74M
INFO: ------------------------------------------------------------------------
[07:55:08] Analysis finished.
[Pipeline] }

Thank you,
Boris.

1 Like

Hi @BorisT ,

Only the main/master branch is shown on the project dashboard. Also, SonarQube assumes “master” branch is the first branch you scan (we are changing this logic eventually, see [SONAR-11949] Allow different branch to be designated the main branch - SonarSource).

You can choose which is your “main branch” by navigating to the project > Project Settings > Branches & Pull Requests then click on the :gear: icon to the right of the “master” branch and click on “Rename branch”. It looks like your “Development” branch is the main branch, is that correct? It may be easier to delete your Development branch (in SonarQube), rename master to “Development”, then scan Development branch.

Joe

Hi @Joe,
Thank you for your quick reply.
We set the Development branch as the main branch for this project before I created this help request.
Look at the screenshot…

Do we still need to delete, rename and re-scan as you suggested?

Thanks,
Boris.

Hi @BorisT ,
Thanks for the screenshot. That looks correct. Have you tried scanning “Development” branch again yet? After setting it as the main branch, you need to scan “Development” branch once more.

Joe

Hi @Joe ,

Unfortunately, deleting the project, recreating it, setting Development as the main branch and scanning it several times did not resolve the issue. :frowning:

Is there something else that we can try?

Is there something in configuration files that can cause this issue?
Like in sonar-project.properties or package.json?

Thanks,
Boris.

Hi @BorisT ,

I cannot replicate your issue. Can you give me the exact steps in how you are creating this issue so that I can reproduce it?

Regards,
Joe

Is this happening on all your projects or just one project? Are you able to reproduce the problem with a new project?

Hi @Joe ,

This issue happens only in one of two projects.
As far as I can tell, I’m not doing anything different in terms of SonarQube properties or Jenkins pipeline SonarQube setup…

Please let me know what steps/files/configurations you need me to give you.

Thanks,
Boris.

Hi @BorisT ,

My colleague reminded me of another reason that the “The main branch of this project is empty” message appears: the nloc measure for the main branch of the project is null or equal to 0.

Can you verify there are actual lines of code in your main branch?

In any case, here are the steps that I used to try to reproduce your issue but failed to replicate your scenario:

  1. Provision a new project by clicking on “Create Project” > Manually
  2. Give a project name and project key and click on “Set Up”
  3. Go to Project Settings > Branches & Pull Requests and rename the “master” branch to “develop”
  4. Scan the project making sure that the git branch is “develop” and I use the right project key

Please try my procedure and see if that works for you.

Hi @Joe ,

I checked the line of codes in the project’s Code display and it is indeed Null!
Please refer to the screenshot.

When I took a look at another project, I noticed the same issue.
But, on closer inspection I’ve noticed that *.js files do have a line code count.
The *.ts files are ignored.
Since this is a TypeScript project, I don’t understand why the TypeScript files are not counted…
Please refer to the following screenshot.

Is there a setting I’m missing in the sonar-project.properties file?
Here’s my sonar-project.properties configuration:

# Project General Settings
sonar.projectKey=server-acme-project
sonar.projectName=server-acme Project
sonar.projectVersion=1.0
sonar.language=ts
sonar.sourceEncoding=UTF-8

# Source File Inclusions/Exclusions
sonar.sources=src
sonar.inclusions=src/**/*.ts
sonar.exclusions=src/**/*.spec.ts, src/**/*mock*.ts, src/**/*Mock*.ts, src/**/*.test.ts, src/**/*.snap, src/docs/**/*, src/recordings/**/*, src/public/**/*

# Test File Inclusions/Exclusions
sonar.tests=src
sonar.test.inclusions=src/**/*.spec.ts, src/**/*.test.ts
sonar.test.exclusions=

# Linter
sonar.ts.tslintconfigpath=.eslintrc.json
sonar.eslint.reportPaths=reports/eslint/js-lint-results.json

# JavaScript/TypeScript Code covarge
sonar.javascript.lcov.reportPaths=reports/jest-coverage/unit/lcov.info,reports/jest-coverage/parser/lcov.info,reports/jest-coverage/integration/lcov.info
sonar.testExecutionReportPaths=reports/jestSonar-unit-test-reporter.xml

Thanks,
Boris.

Hi @BorisT !

Thanks for confirming the null issue, now that makes sense.

Regarding your other TS project, You should remove the sonar.language=ts parameter since that is not necessary, our scanner will detect the proper language by itself.

Note that your sonar.inclusions says src/**/*.ts, that means only .ts files in the src directory (“Patterns used to include some source files and only these ones in analysis.”). Is that your intent? You are showing the workers folder, which seems to be excluded.

Can you paste the contents of one of those files or take a screenshot and show what SonarQube UI shows when you click on, say, reportWorker.ts?

Hi @Joe,

I’ve removed the sonar.language=ts, but it didn’t change the nloc measure. It is still null for TypeScript.

Yes, we only interested in *.ts files to be scanned (plus one single *.js file)

The screenshot with the workers folder is from another project (with the same issue).
The sonar-project.properties file for this project looks like this:

# Project General Settings
sonar.projectKey=bbat-project
sonar.projectName=acme-bitcoin-algo-tech
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8

# Source File Inclusions/Exclusions
sonar.sources=src, DAL, remote, service, userMovements, workers
sonar.inclusions=src/**/*.ts, DAL/**/*.ts, models/**/*.ts, DAL/**/*.ts, remote/**/*.ts, service/**/*.ts, userMovements/**/*.ts, workers/**/*.ts, workers/**/*.js
sonar.exclusions=src/**/*.spec.ts, src/**/*mock*.ts, src/**/*Mock*.ts, src/**/*.test.ts, src/**/*.snap, src/docs/**/*, src/recordings/**/*, src/public/**/*

# Test File Inclusions/Exclusions
sonar.test.inclusions=**/*.spec.ts, **/*.test.ts
sonar.test.exclusions=dist, node_modules, .husky, .vscode, config, diagrams, helm, 

# Linter
sonar.ts.tslintconfigpath=.eslintrc.json
sonar.eslint.reportPaths=reports/eslint/js-lint-results.json

# JavaScript/TypeScript Code covarge
sonar.javascript.lcov.reportPaths=reports/jest-coverage/unit/lcov.info
sonar.testExecutionReportPaths=reports/jestSonar-unit-test-reporter.xml

The content of reportWorker.ts:

import { mongoDbConnections } from '../mongo-db-connections.service';
import { isMainThread, parentPort } from 'worker_threads';
import { Message } from '../service/pubsub/models/message/message';
import { BBAT } from '../src/BBAT';
import { UserMovementsMapperAndSaver } from '../userMovements/userMovements.service';
import { TimeService } from '../service/time/time.service';
import { ReportWorkerResponse } from './reportWorkerResponse';
import { concatMap, last } from 'rxjs/operators';
import { reject } from 'lodash';
import { Country, TaxMethodTypes } from '../models/bbatReportSummary.model';

const pubsubBBATSubtopicName = 'Start';

async function bbatReportCreation(userId: string) {
	const userMovementsMapperAndSaver = new UserMovementsMapperAndSaver(userId);
	const startTime: number = TimeService.toMillisecondsTimeStamp();
	const movementsCount = await userMovementsMapperAndSaver.saveMovementsInChunks();
	console.log(`===================== number of movements: ${movementsCount} ================`);
	console.log(`======================= for user ${userId} ==========================`);
	const bbat = new BBAT(
		userId,
		movementsCount,
		[TaxMethodTypes.FIFO, TaxMethodTypes.FIFO_EXCHANGES, TaxMethodTypes.FIFO_TECH],
		Country.ISR,
		false
	);
	const diff = TimeService.differentInMillisecondsByTimeStamps(startTime);
	console.log(`Fetch and convert movements in ${TimeService.toFormat(diff, 'HH:mm:ss.SSS')}`);

	let deferredResolve: (value: void | PromiseLike<void>) => void;

	const promise = new Promise<void>((resolve, reject) => {
		deferredResolve = resolve;
	});

	(await bbat.createStock())
		.pipe(
			last(),
			concatMap(_ => bbat.createReport())
		)
		.subscribe({
			complete: () => {
				console.log('Finished calculation job on report worker!');
				deferredResolve();
			},
			error: err => {
				reject(err);
			}
		});

	return promise;
}

async function connect() {
	const promiseBbatConnection = mongoDbConnections.getBbatDbConnection();
	const promiseAcmeConnection = mongoDbConnections.getAcmeDbConnection();
	return await Promise.all([promiseBbatConnection, promiseAcmeConnection]);
}

async function setupWorker() {
	console.log('Loading BBAT report worker...');
	if (!isMainThread) {
		try {
			await connect();
		} catch (error) {
			console.log(`Failed to initiate MongoDB connection for BBAT - ${error.message}`);
			throw error;
		}

		parentPort.on('message', async (message: Message) => {
			if (message.subTopic === pubsubBBATSubtopicName) {
				try {
					await bbatReportCreation(message.payload.userId);
					parentPort.postMessage({ success: true, data: { message: message } } as ReportWorkerResponse);
				} catch (error) {
					parentPort.postMessage({
						success: false,
						data: { errorMessage: error.message, pubsubMessage: message }
					} as ReportWorkerResponse);
				}
			} else {
				console.warn(`Received unknown message with subtopic ${message.subTopic}. Ignoring.`);
			}
		});
	}
}

void setupWorker();

Thanks,
Boris.

Hi @BorisT ,

Apologies for the delay. Here are my observations:

  • sonar.ts.tslintconfigpath=.eslintrc.json is not a valid analysis parameter, does this work? You can delete this parameter.
  • Looking at your reportWorker.ts file reveals that all looks fine. My suggestion, based on your slightly complex sonar.source, inclusions, exclusions settings, is to start from a blank slate and slowly add the following analysis scopes in this order:
    1. Define sonar.exclusions
    2. Once sonar.exclusions looks correct, define sonar.sources
    3. If it looks fine, then define sonar.inclusions

Ideally, you shouldn’t have to define such detailed analysis scope. Usually, sonar.exclusions should be enough. On rare occasions will you need to use sonar.inclusions.

Please try adding each parameter and its values slowly, one by one to deconstruct and hopefully reproduce the issue.

Joe

@Joe I’m having this problem with a project that was working fine and that now displays “The main branch of this project is empty” and has characteristics similar to what @BorisT describes. Except that we dont have any inclusions, just exclusions. I dont know when this started displaying that message but it was recent, within the last few weeks.

Ours is a node v12.16.1 project (we have work in progress to bring it up to v16 but thats not happening for a few days or weeks.).

Hi @StingyJack ,

I suggest creating a new thread so they’ll be a greater audience to see your issue.

Have you reviewed this thread yet? There are several things to check here:

If you still need an explanation for your issue, can you attach your DEBUG Sonar scanner analysis logs in the new thread so we can inspect it?

This is the thread that most closely matches the problem I am seeing. I will have to figure out how to get the DEBUG sonar logs. This may require help from another team in my org.

1 Like

It took me a long time to figure this out, but this was in the build information:

WARN: SonarScanner for .NET detected only TEST files and no MAIN files for C# in the current solution. Only TEST-code related results will be imported to your SonarQube/SonarCloud project. Many of our rules (e.g. vulnerabilities) are raised only on MAIN-code. Read more about how the SonarScanner for .NET detects test projects: https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects

The solution was to add this to the non-test csproj files:

<PropertyGroup>
  <!-- Project is not a test project -->
  <SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>

I also marked the test projects csproj files with

<PropertyGroup>
  <!-- Project is a test project -->
  <SonarQubeTestProject>true</SonarQubeTestProject>
</PropertyGroup>
3 Likes

And this was found in our build logs recently…

ERROR: Only Node.js v12.22 or later is supported, got 12.16.1.
org.sonarsource.nodejs.NodeCommandException: Only Node.js v12.22 or later is supported, got 12.16.1.
	at org.sonarsource.nodejs.NodeCommandBuilderImpl.checkNodeCompatibility(NodeCommandBuilderImpl.java:172)
	at org.sonarsource.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:143)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.initNodeCommand(EslintBridgeServerImpl.java:183)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServer(EslintBridgeServerImpl.java:128)
	at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:212)

All of the sonarcloud facilities seem to be working: coverage, duplication, issues, sec hotspots. I can browse the code files in sonarcloud but it just shows 0 lines.


We are updating to node 16 tomorrow, hopefully that will fix the build log issue and the line counting.

1 Like

updating to node v 16 did fix this.

3 Likes

Hi @StingyJack ,

Thanks for coming back to us :+1:.

@BorisT Did you try updating your version of NodeJS? Did that solve the problem?