How is the Lines of Code Calculated?

  • SonarQube version
  • how is SonarQube deployed: zip

We recently upgraded from enterprise edition of SonarQube to the Developer edition. Due to some requirements we decided to set up a new server with a new Postgres database(a data dump from the old database was restored in this new database).

Info about the 2 Sonarqube servers: an older server with EE 9.5 version and the new one with DE 9.9.4 LTS version. Both the servers have separate Postgres13 DBs (the DE server’s DB was created by taking a data dump from the EE server’s DB).

Once the New server was set up we deleted the older one, however since the time it was set up the number of lines of code analysed shows as 2.2M. Is it because we restored data from the old database?

Hey there.

Yes, if you dumped the old database, it will contain all the Lines of Code from your previous instance. This is expected.

Did your old SonarQube sever have 2.2 million lines analyzed?

Yes it had 2.2 million lines analysed. We didn’t want to lose the previous analysis data so we restored it in the new database… Will this count towards my license usage? If yes, is there any way I can keep my old data and not have it count towards the new license usage?


No. The license usage is based on the sum total of the largest branch of all projects analyzed on your instance.

1 Like