# Sonar scanner hangs indefinitely on \`deprecation\` sonar eslint rule

**URL:** <https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, scanner\
**Created:** [July 10, 2024, 4:10am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730 "2024-07-10T04:10:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![passbyval](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@passbyval](https://community.sonarsource.com/u/passbyval)\
**Post date:** [July 10, 2024, 4:10am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/1 "2024-07-10T04:10:48Z")

</div>

Setup:

- SonarQube@10.5.1.90531 (Community Edition)
- Scanner@6.1.0.4477
- `localhost` setup with postgresql

Tried

- Complete reinstall
- Numerous sonar settings, exclusions, etc

The [`deprecation`](https://github.com/un-ts/SonarJS/blob/4c88bf1af5b3eed98cafeaccb5ec863ca17d6f12/packages/jsts/src/rules/S1874/rule.ts) rule took `99911.889ms` to execute.

```auto
20:09:26.307 INFO Rule | Time (ms) | Relative
20:09:26.307 INFO :----------------------------------------------|---------------:|---------:
20:09:26.307 INFO deprecation | 99911.889 | 69.0%
20:09:26.307 INFO aws-restricted-ip-admin-access | 10739.742 | 7.4%
20:09:26.307 INFO no-redundant-assignments | 4776.300 | 3.3%
20:09:26.307 INFO no-dead-store | 3821.831 | 2.6%
20:09:26.307 INFO no-duplicates | 2666.670 | 1.8%
20:09:26.307 INFO no-misused-promises | 2351.199 | 1.6%
20:09:26.307 INFO no-direct-mutation-state | 1129.350 | 0.8%
20:09:26.307 INFO no-unstable-nested-components | 1069.325 | 0.7%
20:09:26.307 INFO no-deprecated-react | 1048.066 | 0.7%
20:09:26.307 INFO prefer-object-spread | 864.321 | 0.6%
20:09:26.307 INFO no-array-index-key | 832.733 | 0.6%
20:09:26.307 INFO no-clear-text-protocols | 621.379 | 0.4%
20:09:26.307 INFO no-base-to-string | 378.586 | 0.3%
20:09:26.307 INFO cognitive-complexity | 371.332 | 0.3%
20:09:26.307 INFO hook-use-state | 365.799 | 0.3%

```

---

<div class="post-metadata">

**Author:** ![Yassin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/yassin/32/36096_2.png) [@Yassin](https://community.sonarsource.com/u/Yassin)\
**Post date:** [July 12, 2024, 8:54am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/5 "2024-07-12T08:54:35Z")

</div>

Hello @passbyval,

Welcome to the Sonar community and thank you for the feedback!

We recently made an attempt to enhance the performance of this rule. However, it appears that it did not have the expected impact, at least in your project. In order to assist you, we would need the following:

- A rough estimate of the project size, including the number of source files and TSConfigs if you are using TypeScript.
- The debug logs from the scanner during the analysis can be made available by setting the command-line option. `-X` , `--verbose` , or `-Dsonar.verbose=true`.

It’s currently just an assumption, but it’s possible that the issue is related to a specific file in your source code.

Best,  
Yassin

---

<div class="post-metadata">

**Author:** ![passbyval](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@passbyval](https://community.sonarsource.com/u/passbyval)\
**Post date:** [July 12, 2024, 10:25pm UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/6 "2024-07-12T22:25:50Z")

</div>

Hello, thank you for the response!

The project is an NX monorepo with about **2,485** source `{tsx,ts}` files. **3,082** including `index.{ts,tsx}` or barrel files.

Each project and app have a base `tsconfig.json` that a `tsconfig.lib.json` and `tsconfig.spec.json` inherit from. However, SQ does not use `tsconfig.spec.json`. Only Jest does.

The entire project has a single `tsconfig.base.json`, located in the project root, that each sub `tsconfig.json` inherits from.

Roughly, we have the following number of TS config files:

- `tsconfig.base.json`: 1
- `tsconfig.json`: 33
- `tsconfig.lib.json`: 28
- `tsconfig.spec.json`: 29

**Total: ~91**

When I enable verbose or debug logging, the scan hangs on processing the files, repeating an empty `INFO` over and over:

```auto
# ...
15:22:08.575 DEBUG Declared patterns of language CloudFormation were converted to sonar.lang.patterns.cloudformation : 
15:22:08.575 DEBUG Declared patterns of language YAML were converted to sonar.lang.patterns.yaml : **/*.yaml,** /*.yml
15:22:08.575 DEBUG Declared patterns of language Go were converted to sonar.lang.patterns.go : **/*.go
15:22:08.575 DEBUG Declared patterns of language Kotlin were converted to sonar.lang.patterns.kotlin : **/*.kt,** /*.kts
15:22:08.575 DEBUG Declared patterns of language Secrets were converted to sonar.lang.patterns.secrets : 
15:22:08.575 DEBUG Declared patterns of language Ruby were converted to sonar.lang.patterns.ruby : **/*.rb
15:22:08.575 DEBUG Declared patterns of language C# were converted to sonar.lang.patterns.cs : **/*.cs,** /*.razor
15:22:08.575 DEBUG Declared patterns of language PHP were converted to sonar.lang.patterns.php : **/*.php,** /*.php3, **/*.php4,** /*.php5, **/*.phtml,** /*.inc
15:22:08.575 DEBUG Declared patterns of language Terraform were converted to sonar.lang.patterns.terraform : **/*.tf
15:22:08.575 DEBUG Declared patterns of language AzureResourceManager were converted to sonar.lang.patterns.azureresourcemanager : **/*.bicep
15:22:08.576 DEBUG Declared patterns of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,** /*.tsx, **/*.cts,** /*.mts
15:22:08.582 INFO Preprocessing files...
15:22:08.591 DEBUG loading config FileBasedConfig[/Users/***/.config/jgit/config]
15:22:08.592 DEBUG readpipe [bash, --login, -c, which git],/Users/***
15:22:08.616 DEBUG readpipe may return '/usr/bin/git'
15:22:08.616 DEBUG remaining output:

15:22:08.616 DEBUG readpipe [xcode-select, -p],/Users/***
15:22:08.623 DEBUG readpipe may return '/Applications/Xcode.app/Contents/Developer'
15:22:08.623 DEBUG remaining output:

15:22:08.623 DEBUG readpipe [/usr/bin/git, --version],/usr/bin
15:22:08.651 DEBUG readpipe may return 'git version 2.39.3 (Apple Git-145)'
15:22:08.651 DEBUG remaining output:

15:22:08.651 DEBUG readpipe [/usr/bin/git, config, --system, --show-origin, --list, -z],/usr/bin
15:22:08.673 DEBUG readpipe may return 'null'
15:22:08.673 DEBUG remaining output:

15:22:08.699 DEBUG readpipe rc=128
15:22:08.699 DEBUG Exception caught during execution of command '[/usr/bin/git, config, --system, --show-origin, --list, -z]' in '/usr/bin', return code '128', error message 'fatal: unable to read config file '/etc/gitconfig': No such file or directory
'
15:22:08.700 DEBUG loading config FileBasedConfig[/Users/***/.config/git/config]
15:22:08.700 DEBUG loading config UserConfigFile[/Users/***/.gitconfig]
15:22:08.882 DEBUG 3737 non excluded files in this Git repository
15:22:18.588 INFO  
15:22:28.591 INFO  
15:22:38.596 INFO  
15:22:48.601 INFO  
15:22:58.607 INFO  
15:23:08.612 INFO  
15:23:18.617 INFO  
15:23:28.622 INFO  
15:23:38.627 INFO  
15:23:48.633 INFO  
15:23:58.638 INFO  
15:24:08.639 INFO  

```

The other thing is, this is only an issue locally. The sonar scan runs on CI just fine.

---

<div class="post-metadata">

**Author:** ![Yassin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/yassin/32/36096_2.png) [@Yassin](https://community.sonarsource.com/u/Yassin)\
**Post date:** [July 16, 2024, 7:34am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/7 "2024-07-16T07:34:34Z")

</div>

Thanks for sharing this!

Are these the only logs? Does the analysis eventually end?

---

<div class="post-metadata">

**Author:** ![passbyval](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@passbyval](https://community.sonarsource.com/u/passbyval)\
**Post date:** [August 13, 2024, 1:41am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/9 "2024-08-13T01:41:53Z")

</div>

It does eventually end, yes! No obvious errors or issues except for the total time reported as shown in my original post.

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [December 20, 2024, 9:48am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/10 "2024-12-20T09:48:05Z")

</div>

Hi,

We have created a [ticket](https://sonarsource.atlassian.net/browse/SONAR-24067) to improve the logs. This won’t solve the possible performance issue, but it might help to investigate.

---

<div class="post-metadata">

**Author:** ![passbyval](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@passbyval](https://community.sonarsource.com/u/passbyval)\
**Post date:** [December 27, 2024, 8:58am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/11 "2024-12-27T08:58:40Z")

</div>

Much thanks.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [January 3, 2025, 8:59am UTC](https://community.sonarsource.com/t/sonar-scanner-hangs-indefinitely-on-deprecation-sonar-eslint-rule/118730/12 "2025-01-03T08:59:35Z")

</div>

Closed on January 3, 2025, 8:59am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
