# Very slow scanning process at large and legacy java project

**URL:** <https://community.sonarsource.com/t/very-slow-scanning-process-at-large-and-legacy-java-project/15109>\
**Category:** SonarQube Server / Community Build\
**Tags:** maven, java, scanner\
**Created:** [October 7, 2019, 6:43am UTC](https://community.sonarsource.com/t/very-slow-scanning-process-at-large-and-legacy-java-project/15109 "2019-10-07T06:43:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fhgomes](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/fhgomes/32/6820_2.png) [@fhgomes](https://community.sonarsource.com/u/fhgomes)\
**Post date:** [October 7, 2019, 6:43am UTC](https://community.sonarsource.com/t/very-slow-scanning-process-at-large-and-legacy-java-project/15109/1 "2019-10-07T06:43:29Z")

</div>

Hi i´m working with a big and legacy product, and i have some performance issues when i run my sonar scanner.

Product:

- More then 600k loc.
- More then 8k vulnerabilities, 2k bugs, 100k code smells.
- More then 4k classes
- Duplication 12%
- A lot of cyclomatic complexity and cognitive issues
- Some classes are too big (30k loc)
- Some methods and algorithms are unbelievably dumb, wrong and nonperformance

Relevant properties:

- Java source and target version is 1.6
- Maven wrapper 3.6.1
- Maven compiler plugin 3.6.0
- Maven surefire plugin 2.22.2
- Sonar maven plugin 3.6.1.1688
- Sonar server is 6.7

Some of my properties:

- \<sonar.language\>java\</sonar.language\>
- \<sonar.java.source\>1.6\</sonar.java.source\>

It tooks 09:30 hours to run sonar.  
00:30 is about sending the scanner results to server and 9 hours is about running the scanner.

- Analysis report generated dir size=107 MB

Slowest steps:

- Java Main Files AST scan
- Sensor JavaSquidSensor

I know that are some Rules that causes more slow than others.  
But i don´t know how to find out which are these slowest rules.

> sh “export MAVEN\_OPTS=‘-Xms1512m -Xmx8096m -XX:PermSize=512m -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=128m’ ;” +" ./mvnw sonar:sonar -T 4 -X"

---

<div class="post-metadata">

**Author:** ![Nicolas\_Peru](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas_peru/32/22_2.png) [@Nicolas\_Peru](https://community.sonarsource.com/u/Nicolas_Peru)\
**Post date:** [January 21, 2020, 3:52pm UTC](https://community.sonarsource.com/t/very-slow-scanning-process-at-large-and-legacy-java-project/15109/2 "2020-01-21T15:52:07Z")

</div>

Hi,

Those are really interesting numbers : could you confirm that you are running with the community edition ?
