rxJava3 Observable being detected as deprecated

Hi,

Usaged of io.reactivex.rxjava3.core.Observable in our code base keeps getting picked up as being deprecated.

Eg.

fun getSelectableThings(): Observable<Things> {
  return thingsStore.getAvailableThings().flatMapObservable {
    Observable.fromIterable(it)
  }
}

Sonar is raising a code smell with Observable<Things>.
Deprecated code should not be used.

Is this a known issue? Is there a way to ignore this issue?

Thank you

1 Like

Hi,

Welcome to the community!

What version of SonarQube are you seeing this on?

 
HTH,
Ann

Hello

sonar-scanner-cli-4.6.2.2472

This is what our CI/CD is using. Is this what you mean?

Thanks
Tim

Hi Tim,

Please go to the SonarQube interface and look at the page footer. You’ll see the SonarQube version there.

 
Thx,
Ann

@ganncamp

Hi, Sorry I should have clarified that we are using SonarCloud. Is there a way to check the version of SonarQube that SonarCloud is using?

Thank you
Tim

Hi Tim,

In fact, it’s two separate things now. so just knowing it’s SonarCloud is enough.

Thanks for reporting this. The language experts should be along soon to look at it.

 
Ann

1 Like

Hi,

Has there been any updates from the language experts?

Thank you,

Tim

Hey @timw,
Can you help us narrow down a few details:

  • Is this a new FP? Is this an FP you only recently observed or has this been there since your first analysis?
  • Is the issue only raised on kotlin code?
  • What is the rule reporting the issue? S1874 ? S5738?

Hey @Dorian_Burihabwa Im working with Tim and I want to join the conversation:

  1. Yea it’s something that occurred recently (couple months ago), previously sonar was not raising those code smells.
  2. Yes on Kotlin code
  3. rule code: kotlin:S1874

Hey @Patryk_Springer, thank you for answering these clarifications.

I am having a hard time reproducing the issue. Could you share a self-contained bit of code that reproduces the issue?

In addition, do you know what analysis method you are using on SonarCloud? SonarCloud Automated analysis mode? Gradle-based analysis? Maven-based analysis?

That would help us understand if it is a misconfiguration issue or an actual false-positve.

1 Like