@@ -3,8 +3,6 @@ namespace Microsoft.ComponentDetection.Detectors.Dockerfile;
33using System ;
44using System . Collections . Generic ;
55using System . IO ;
6- using System . Linq ;
7- using System . Reactive . Linq ;
86using System . Threading ;
97using System . Threading . Tasks ;
108using Microsoft . ComponentDetection . Common ;
@@ -46,13 +44,6 @@ public DockerfileComponentDetector(
4644
4745 protected override IList < string > SkippedFolders => [ "node_modules" ] ;
4846
49- protected override Task < IObservable < ProcessRequest > > OnPrepareDetectionAsync (
50- IObservable < ProcessRequest > processRequests ,
51- IDictionary < string , string > detectorArgs ,
52- CancellationToken cancellationToken = default ) =>
53- Task . FromResult ( processRequests . Where ( processRequest =>
54- ! this . IsInSkippedFolder ( processRequest . ComponentStream . Location ) ) ) ;
55-
5647 protected override async Task OnFileFoundAsync ( ProcessRequest processRequest , IDictionary < string , string > detectorArgs , CancellationToken cancellationToken = default )
5748 {
5849 var singleFileComponentRecorder = processRequest . SingleFileComponentRecorder ;
@@ -81,12 +72,6 @@ protected override async Task OnFileFoundAsync(ProcessRequest processRequest, ID
8172 }
8273 }
8374
84- private bool IsInSkippedFolder ( string filePath )
85- {
86- var pathSegments = filePath . Split ( [ '/' , '\\ ' ] , StringSplitOptions . RemoveEmptyEntries ) ;
87- return this . SkippedFolders . Any ( skippedFolder => pathSegments . Contains ( skippedFolder , StringComparer . OrdinalIgnoreCase ) ) ;
88- }
89-
9075 private Task ParseDockerFileAsync ( string fileContents , string fileLocation , ISingleFileComponentRecorder singleFileComponentRecorder , Dictionary < string , string > stageNameMap )
9176 {
9277 var dockerfileModel = Dockerfile . Parse ( fileContents ) ;
0 commit comments