Rule for shadowed variables is incorrect for javascript

Using javascript analyzer for a es6 code I’m having problems with the shadowing rule parameter. In the examples bellow as you can see I didn’t do shadowing at all.

  • Sonarqube 8.4.2.36762
  • SonarScanner 4.4.0.2170 (Javascript Analyzer)

Example 1

Here I only change an object by changing it’s properties

jest.mock('@c6bank/internet-banking-utils', () => {
  const mockRequest = jest.fn(() => Promise.resolve({ data: {} }))
  const http = mockRequest

  http.put = mockRequest
  http.post = mockRequest

  return { http }
})

Example 2

And here I’m just deconstructing a property from the parameter and passing to another function as an argument.

const fetchData = useCallback(
    async ({ days, filter, dateStart, dateEnd }) => {
      setError(false)
      setLoadingTransactions(true)
      try {
        const { data, status } = await creditApi.getLinkedAccountData({
          mainBranch,
          mainAccount,
          filter,
          days,
          dateStart,
          dateEnd,
          contractNumber,
        })

Image from sonarqube

Hello Wellyngton,

Thank you for your message.

I am sorry to say that I am unable to reproduce these issues using the code snippet you provided. Those samples are probably pieces of some bigger code.

Would it be possible to provide me with a self-contained reproducer triggering these issues?

Yassin