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