Python coverage and duplications on new code not showing up

33 views
Skip to first unread message

clark...@gmail.com

unread,
Mar 29, 2018, 4:11:06 AM3/29/18
to SonarQube
Hello everyone,

we have a Django application analysed on Sonarqube 6.5, with our coverage report imported every time.
our project is also set with leak per = previous version.

after each analysis, we are missing Coverage and Duplications on New Code only.



We also enabled 0 line coverage on the project without any changes.



And the SCM sensor is enabled (we can see blames in code)



Any idea to help us get these metrics on new code will be much appreciated!

Thanks,
Gabriel

clark...@gmail.com

unread,
Mar 29, 2018, 4:23:50 AM3/29/18
to SonarQube
I'm not sure you can see the screenshots, sorry about that. Another funny think is that coverage on new code does appear next to the quality gate... (it's one of the conditions of our quality gate).

clark...@gmail.com

unread,
Mar 29, 2018, 5:38:29 AM3/29/18
to SonarQube
After some more digging, I decided to get the same metrics using the web api. And voila! all the metrics are there!

{  
   "component":{  
      "id":"secret",
      "key":"secret",
      "name":"secret",
      "qualifier":"TRK",
      "measures":[  
         {  
            "metric":"duplicated_blocks",
            "value":"17",
            "periods":[  
               {  
                  "index":1,
                  "value":"8"
               }
            ]
         },
         {  
            "metric":"ncloc",
            "value":"68323",
            "periods":[  
               {  
                  "index":1,
                  "value":"3153"
               }
            ]
         },
         {  
            "metric":"bugs",
            "value":"0",
            "periods":[  
               {  
                  "index":1,
                  "value":"0"
               }
            ]
         },
         {  
            "metric":"line_coverage",
            "value":"50.0",
            "periods":[  
               {  
                  "index":1,
                  "value":"3.0"
               }
            ]
         },
         {  
            "metric":"code_smells",
            "value":"2756",
            "periods":[  
               {  
                  "index":1,
                  "value":"97"
               }
            ]
         }
      ]
   },
   "periods":[  
      {  
         "index":1,
         "mode":"previous_version",
         "date":"2018-03-27T09:58:42+0000",
         "parameter":"0fda4944b33ed4a978553c4687ba444asasdc"
      }
   ]
}



So my problem description shifted to: all my metrics are completely outdated in my projects' "dashboard" view. How to get things updated?

Thanks,
Gabriel

G. Ann Campbell

unread,
Mar 29, 2018, 10:45:15 AM3/29/18
to SonarQube
Hi Gabriel,

The UI is serviced by those same web services you called manually, so this sounds like it might be a caching issue in your browser.


Ann
Reply all
Reply to author
Forward
0 new messages