New Code and over all code

I am using the Community Build version, along side IntelliJ so I initiate runs from the command prompt, I am trying to get how the maintainability rating of a code base changes. And I have been able to experience situation where the maintainability rating actually changed. When you check the maintainability metric it usually divided into new code and Overall code. What is the difference between these two??

Hi,

Welcome to the community!

The ratings aren’t actually “divided” between the two; they overlap. New code is part of Overall code. So the rating on New Code represents a subset of what’s reflected in Overall.

Does that help?

 
Ann

Hello Ann,

Thank you for this response, is it possible you give me more details of what you mean. The rating on the over all code and new code are actually different. The new code shows B while the over all shows A. So what is one measuring that makes it differ form the other?

Hi,

Let’s say I have a 100 LOC project (yes, it’s teeny, but it makes the math easy :smiley: ) with 0% coverage.

I edit 10 lines and add tests for all 10. My Coverage on New Code is now 100%. My Overall Coverage is 10%.

Does that help?

 
Ann

Thank you, Well I was referring to the maintainability rating, See the image attached New code is showing B over all code is showing A, this happens after an update. So why question is: How is sonarQube giving me two maintainability rating? what is it measuring in each instance. Thank you

Hi,

The docs will help with this. The Maintainability Rating is essentially about the ratio of time estimated to fix all the issues in the code versus the size of the codebase.

So seeing different values here essentially means that the issue density is lower in new code than in overall.

 
HTH,
Ann

Hello,

Ok. Thank you. I just got the code from github repo and I will try to figure out how the maintainability is been calculated. Is there any insight you can give me on which of the files to look into?

Hi,

Not really. The overall rating is going to be about every single file in the repo. The new code rating is going to be about what’s “new”.

 
Ann