lookout icon indicating copy to clipboard operation
lookout copied to clipboard

[WIP: Review needed] simplify enry service code

Open smacker opened this issue 6 years ago • 3 comments

this commit introduces constructors for Fn scanners and use them in enry service instead of custom constructor for each enry feature

It doesn't simplify too much in terms of lines of code (removed only 50 lines) but it removes one level of abstraction which makes it simpler in my opinion.

Enry service is an example, I can update other services in the same way if we agree it's good idea. @carlosms @se7entyse7en WDYT?

smacker avatar Apr 08 '19 14:04 smacker

it removes one level of abstraction which makes it simpler in my opinion.

I agree with this as the layer of abstraction is also very thin. Maybe I'd have added an AppendFn method to FnChangeScanner, but not a strong opinion.

As a side note, while looking at GetChanges and GetFiles I was wondering whether the order of the filter functions that we add is the optimal one. I mean that the filters that we know potentially prune the most should be the first ones for better performance.

se7entyse7en avatar Apr 10 '19 13:04 se7entyse7en

Well, I guess that the most important is that the filter for excluding vendor is the first one and it's already as is.

se7entyse7en avatar Apr 10 '19 13:04 se7entyse7en

ping @carlosms

smacker avatar Apr 16 '19 10:04 smacker