I’m analysing a massive legacy project that contains files of lots of different types. When I run an analysis, I got the following error partway through:
INFO: Could not find files for the given pattern(s).
Node.js not found in PATH. PATH value was: [snipped]
There’s no information on what files are causing this, or what patterns it means. From research I’ve found that node is required when analysing js, ts or css files - there are some of those in this project, but I don’t want them to be analysed.
Since I don’t know what files specifically are causing the error, and hunting manually through this huge project isn’t feasible, I’m wondering if it’s possible to blanket exclude file types, so I can fix this issue and also cut down on the number of files being analysed, since we also have performance concerns.
I think you’re looking for File exclusions, including the ability to set glob patterns like
Unfortunately that hasn’t solved the problem I’m having - I’m still seeing this node error, even though we’re no longer supposed to be analysing ts, js or css files.
Hm. It’s possible there could be some other file types, such as
Can you try excluding
A subset of my exclusions are the following (the rest are individual files):
And in the logs, we’re seeing things like:
11:19:28 Detected os: Windows Server 2016 arch: amd64 alpine: false. Platform: WIN_X64
11:19:28 Using Node.js executable: 'C:\Program Files\nodejs\node.exe'.
11:20:24 1 source file to be analyzed
11:20:24 1/1 source file has been analyzed
11:20:24 > Task :sonar
11:20:24 Hit the cache for 0 out of 1
11:20:24 Miss the cache for 1 out of 1: ANALYSIS_MODE_INELIGIBLE [1/1]
11:20:24 11 source files to be analyzed
11:20:24 11/11 source files have been analyzed
11:20:24 14 source files to be analyzed
11:20:24 14/14 source files have been analyzed
11:20:24 960 source files to be analyzed
Which to me indicates that HTML or JS files are being analysed despite the exclusions. Do you know why this might be? This post ERROR: INFO: Could not find files for the given pattern(s) implies that setting sonar.verbose to true prints detail of individual files being analysed ,but that’s not the case for me.