Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'The main branch has no lines of code' problem #203

Closed
berkebalci opened this issue Dec 23, 2023 · 4 comments
Closed

'The main branch has no lines of code' problem #203

berkebalci opened this issue Dec 23, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists fixed on develop stale

Comments

@berkebalci
Copy link

berkebalci commented Dec 23, 2023

I use 0.5.1-SNAPSHOT version. I did everything correct, even I get "EXECUTION SUCCESS" but still in sonarqube project it says : "The main branch has no lines of code.".

INFO: Scanner configuration file: C:\Users\Berke\Desktop\tools\sonar-scanner-5.0.1.3006-windows\bin..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\Berke\Desktop\Staj\YazilimMuh-Mobil2\YazilimMuh-Mobil\sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\Berke.sonar\cache
INFO: Analyzing on SonarQube server 10.3.0.82913
INFO: Default locale: "tr_TR", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=77ms
INFO: Server id: 147B411E-AYyMNYW6PO7YmCjE5i1L
INFO: User cache: C:\Users\Berke.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=43ms
INFO: Load/download plugins (done) | time=155ms
INFO: Process project properties
INFO: Process project properties (done) | time=9ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: Talas-Kutuphaneler
INFO: Base dir: C:\Users\Berke\Desktop\Staj\YazilimMuh-Mobil2\YazilimMuh-Mobil
INFO: Working dir: C:\Users\Berke\Desktop\Staj\YazilimMuh-Mobil2\YazilimMuh-Mobil.scannerwork
INFO: Load project settings for component key: 'Talas-Kutuphaneler'
INFO: Load project settings for component key: 'Talas-Kutuphaneler' (done) | time=19ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=56ms
INFO: Load active rules
INFO: Load active rules (done) | time=2351ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=8ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=11ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 1 file indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module Talas-Kutuphaneler
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=37ms
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=3ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=36ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=10ms
INFO: Sensor JavaScript inside YAML analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=10ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=1ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=19ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=3ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=522ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=19ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=81ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
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: Analysis report generated in 99ms, dir size=153.5 kB
INFO: Analysis report compressed in 16ms, zip size=18.6 kB
INFO: Analysis report uploaded in 23ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://localhost:9000/dashboard?id=Talas-Kutuphaneler
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://localhost:9000/api/ce/task?id=AYyZA3setmE2AlDzCjMl
INFO: Analysis total time: 6.584 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.929s
INFO: Final Memory: 20M/74M
INFO: ------------------------------------------------------------------------

My sonar-project.properties is

Project identification

sonar.projectKey=Talas-Kutuphaneler
sonar.projectName=Talas-Kutuphaneler
sonar.projectVersion=1.0

Source code location.

Path is relative to the sonar-project.properties file. Defaults to .

Use commas to specify more than one file/folder.

It is good practice to add pubspec.yaml to the sources as the analyzer

may produce warnings for this file as well.

sonar.sources=lib
sonar.sources=pubspec.yaml
sonar.test = test

Encoding of the source code. Default is default system encoding.

sonar.sourceEncoding=UTF-8

Analyzer mode

Can be:

- DETECT (attempt to detect automatically) - default

- MANUAL (an existing report needs to be provided)

- FLUTTER (flutter analyze)

- DART (dart analyze)

- DARTANALYZER (dartanalyzer)

sonar.java.binaries= **/*.java

Allows reuse of an existing analyzer report when mode is MANUAL

sonar.dart.analyzer.report.path=

Analyzer report output mode

Can be:

- DETECT (attempt to detect automatically, requires Dart SDK on the PATH) - default

- MACHINE (a new machine readable output that is available for Dart 2.12+)

- LEGACY (attempts to parse human readable output from dart/flutter) - default

sonar.dart.analyzer.report.mode=

@lenaing
Copy link

lenaing commented Feb 13, 2024

Hi,

We were hit by this issue, a debug run showed:

15:29:38.692 DEBUG: Declared patterns of language Dart were converted to sonar.lang.patterns.dart :

To work around, we set in the sonar-project.properties :

sonar.lang.patterns.dart=**/*.dart

Hope this helps,

Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label May 14, 2024
@zippy1978
Copy link
Contributor

Duplicate of #212

@zippy1978 zippy1978 marked this as a duplicate of #212 May 16, 2024
@zippy1978 zippy1978 added duplicate This issue or pull request already exists fixed on develop labels May 16, 2024
@zippy1978
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists fixed on develop stale
Projects
None yet
Development

No branches or pull requests

3 participants