p00rg
(Roy George)
January 14, 2019, 5:15pm
22
And my sonar-project.properties has this
unique project identifier (required)
sonar.projectKey=test-sonar
project metadata (used to be required, optional since SonarQube 6.1)
sonar.projectName=test-sonar
sonar.projectVersion=1.0
path to source directories (required)
sonar.java.source=8
sonar.sources=./src/main
path to Java project compiled classes (optional)
sonar.java.binaries=./target/classes
#sonar .analysis.mode=$mode
sonar.scanAllFiles=true
#sonar .stash.notification=true
#sonar .stash.project=$project
sonar.verbose=true
p00rg
(Roy George)
January 16, 2019, 9:20pm
23
I enabled TRACE logging and when I call mvn sonar:sonar - here is what gets printed in the ce.log
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.CeWorkerImpl] Execute task | project=com.fishersci:test-sonar | type=REPORT | id=AWhYhFtJRIky3GjpSVq7
2019.01.16 21:14:57 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExtractReportStep] Analysis report is 85 KB uncompressed
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Extract report | status=SUCCESS | time=54ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist scanner context | status=SUCCESS | time=6ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Propagate analysis warnings from scanner report | status=SUCCESS | time=4ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Execute DB migrations for current project | status=SUCCESS | time=8ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Generate analysis UUID | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load analysis metadata | status=SUCCESS | time=11ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Initialize | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Verify billing | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Build tree of components | components=9 | status=SUCCESS | time=3ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Validate project | status=SUCCESS | time=2ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load quality profiles | status=SUCCESS | time=201ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load Quality gate | status=SUCCESS | time=10ms
2019.01.16 21:14:57 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.LoadPeriodsStep] Resolving new code period by previous version: 0.0.1
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=SUCCESS | time=6ms
2019.01.16 21:14:57 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.f.FileMoveDetectionStep] Either no files added or no files removed. Do nothing.
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Detect file moves | reportFiles=4 | dbFiles=4 | addedFiles=0 | status=SUCCESS | time=4ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load duplications | duplications=1 | status=SUCCESS | time=0ms
2019.01.16 21:14:57 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.d.CrossProjectDuplicationStatusHolderImpl] Cross project duplication is enabled
2019.01.16 21:14:57 WARN ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.d.IntegrateCrossProjectDuplications] This analysis uses the deprecated cross-project duplication feature.
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute cross project duplications | status=SUCCESS | time=6ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute size measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute new coverage | status=SUCCESS | time=11ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute coverage measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute comment measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Copy custom measures | status=SUCCESS | time=2ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute duplication measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute duplication data measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute size measures on new code | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute language distribution | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute test measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2019.01.16 21:14:57 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=4ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] Execution time for each component visitor:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - LoadComponentUuidsHavingOpenIssuesVisitor | time=3ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - IntegrateIssuesVisitor | time=35ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - CloseIssuesOnRemovedComponentsVisitor | time=0ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - MaintainabilityMeasuresVisitor | time=0ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - NewMaintainabilityMeasuresVisitor | time=0ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - ReliabilityAndSecurityRatingMeasuresVisitor | time=1ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - NewReliabilityAndSecurityRatingMeasuresVisitor | time=0ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - LastCommitVisitor | time=0ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.ExecuteVisitorsStep] - MeasureComputersVisitor | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=39ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute measure variations | status=SUCCESS | time=16ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Compute Quality profile measures | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Generate Quality profile events | status=SUCCESS | time=5ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Generate Quality gate events | status=SUCCESS | time=4ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist components | status=SUCCESS | time=12ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist analysis | status=SUCCESS | time=7ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist analysis properties | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist measures | inserts=338 | status=SUCCESS | time=32ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=448 | status=SUCCESS | time=473ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist new ad hoc Rules | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist issues | inserts=0 | updates=0 | merged=0 | untouched=0 | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist project links | status=SUCCESS | time=7ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist events | status=SUCCESS | time=10ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist sources | status=SUCCESS | time=4ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist tests | status=SUCCESS | time=6ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Persist cross project duplications | inserts=41 | status=SUCCESS | time=9ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Enable analysis | status=SUCCESS | time=9ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Update last usage date of quality profiles | status=SUCCESS | time=10ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per day between 2018-12-19 and 2019-01-15
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AWhYTM0cRIky3GjpSVqv:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per week between 2018-01-17 and 2018-12-19
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AWhYTM0cRIky3GjpSVqv:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per month between 2014-01-22 and 2018-01-17
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AWhYTM0cRIky3GjpSVqv:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.KeepWithVersionFilter] -> Keep analyses with a version prior to 2017-01-18
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AWhYTM0cRIky3GjpSVqv:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DeleteAllFilter] -> Delete data prior to: 2014-01-22
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AWhYTM0cRIky3GjpSVqv:
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.d.purge.PurgeDao] <- Delete aborted builds
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Purge db | status=SUCCESS | time=59ms
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.measure.index.ProjectMeasuresIndexer@5c4b1cb0
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.component.index.ComponentIndexer@118cc529
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.issue.index.IssueIndexer@5ddd57fb
2019.01.16 21:14:58 DEBUG ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.test.index.TestIndexer@14f7db4
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Index analysis | status=SUCCESS | time=133ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | newIssuesNotifs=0 | newIssuesDeliveries=0 | myNewIssuesNotifs=0 | myNewIssuesDeliveries=0 | changesNotifs=0 | changesDeliveries=0 | status=SUCCESS | time=4ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | status=SUCCESS | time=0ms
2019.01.16 21:14:58 INFO ce[AWhYhFtJRIky3GjpSVq7][o.s.c.t.CeWorkerImpl] Executed task | project=com.fishersci:test-sonar | type=REPORT | id=AWhYhFtJRIky3GjpSVq7 | status=SUCCESS | time=1259ms
Michael
(Michael Gumowski)
January 17, 2019, 9:56am
24
Hello,
So I tried my best to reproduce your case. But I didn’t managed to have the same behavior on my side. Everything is working fine, even starting from scratch.
Here is what I have done:
download SonarQube 7.5 (fresh install - no extra plugin - no configuration)
Setup a Java Quality Profile (QP) with only S3518 enabled
Make this QP as being the default QP for Java, to be used by all projects
Setup a maven project with single class, containing a single method, the one from your code snippet - no external dependencies
Execute mvn clean install sonar:sonar
Rule S3518 is correctly triggered, and I perfectly see the issue in the UI
Because I see you are using a sonar-project.properties
file, setup such file with all the properties you have set (which is absolutely NOT recommended for maven projects)
Execute sonarScanner (version 3.2.0.1227)
Rule S3518 is correctly triggered, and I perfectly see the issue in the UI
Here is my project used as test if you want to try to have a look on your side: https://github.com/m-g-sonar/sonar-tests/tree/master/div_by_zero
I have no idea what you are doing wrong, but everything is working on my side with the same steps you mentioned. Your logs tells nothing wrong as well (please use formatting in your message next time, it makes things easier to read). I doubt I can help you more.
Good luck,
Michael
p00rg
(Roy George)
January 17, 2019, 2:17pm
25
One final question on this - we have several projects - and many many lines of code - although mine is only a small test project. Is there any limitation from that aspect?
Thanks
Roy
ganncamp
(G Ann Campbell)
January 21, 2019, 8:30am
26
Hi,
If analysis is succeeding, then this shouldn’t have any impact. If you’re on a licensed version and you’ve hit your LoC limit, you should see a notification that the background task processing has failed. The background task error will tell you why.
Ann