Numerous extractors (for example, the package-lock.json extractor) fail mostly-silently when encountering files larger than MaxFileSizeBytes. Somewhat-helpfully, they will report these files as "size limit exceeded" to any configured stats.Collector. Unfortunately, this capability is only used in tests, and is not generally accessible from the .Scan() interface, which does accept a stats.Collector, but does not propagate it to the extractors, only to filesystem.go.
I'm currently using reflection to store the collector in each plugin that has a "Stats" field of the correct type, but this feels bad. Unfortunately, the lifecycle of the plugins and the scan seems decoupled such that the current contracts don't provide a good way to pass the stats to the multiple extractor entry-points (FileRequired/Extract).
Would a patch for this be accepted?
Numerous extractors (for example, the
package-lock.jsonextractor) fail mostly-silently when encountering files larger thanMaxFileSizeBytes. Somewhat-helpfully, they will report these files as "size limit exceeded" to any configuredstats.Collector. Unfortunately, this capability is only used in tests, and is not generally accessible from the.Scan()interface, which does accept astats.Collector, but does not propagate it to the extractors, only tofilesystem.go.I'm currently using reflection to store the collector in each plugin that has a "Stats" field of the correct type, but this feels bad. Unfortunately, the lifecycle of the plugins and the scan seems decoupled such that the current contracts don't provide a good way to pass the stats to the multiple extractor entry-points (FileRequired/Extract).
Would a patch for this be accepted?