Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit 120f9d2

Browse files
authored
Remove unreachable code (#613)
1 parent 6218174 commit 120f9d2

File tree

12 files changed

+0
-358
lines changed

12 files changed

+0
-358
lines changed

src/ApiPort/ApiPort/EmptyDependencyFinder.cs

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/ApiPort/ApiPort/FileOutputApiPortService.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ public Task<ServiceResponse<IEnumerable<AvailableTarget>>> GetTargetsAsync()
8181
return Task.FromResult(response);
8282
}
8383

84-
public Task<ServiceResponse<UsageDataCollection>> GetUsageDataAsync(int? skip = default(int?), int? top = default(int?), UsageDataFilter? filter = default(UsageDataFilter?), IEnumerable<string> targets = null)
85-
{
86-
_progress.ReportIssue(LocalizedStrings.FileOutputServiceNotSupported);
87-
var response = ServiceResponse.Create(new UsageDataCollection());
88-
89-
return Task.FromResult(response);
90-
}
91-
9284
public Task<ServiceResponse<IReadOnlyCollection<ApiInformation>>> QueryDocIdsAsync(IEnumerable<string> docIds)
9385
{
9486
_progress.ReportIssue(LocalizedStrings.FileOutputServiceNotSupported);

src/ApiPort/ApiPort/Modules/DataTransferModule.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/lib/Microsoft.Fx.Portability.Offline/OfflineApiPortService.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ private static Task<ServiceResponse<T>> WrapResponse<T>(T data)
106106
return Task.FromResult(response);
107107
}
108108

109-
public Task<ServiceResponse<UsageDataCollection>> GetUsageDataAsync(int? skip = null, int? top = null, UsageDataFilter? filter = null, IEnumerable<string> targets = null)
110-
{
111-
throw new NotImplementedException();
112-
}
113-
114109
public static Task<ServiceResponse<AnalyzeResponse>> GetAnalysisAsync(string submissionId)
115110
{
116111
throw new NotImplementedException();

src/lib/Microsoft.Fx.Portability/ApiPortClient.cs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class ApiPortClient
3535
private readonly IEnumerable<IgnoreAssemblyInfo> _assembliesToIgnore;
3636
private readonly IFileWriter _writer;
3737

38-
public ITargetMapper TargetMapper { get { return _targetMapper; } }
39-
4038
public ApiPortClient(IApiPortService apiPortService, IProgressReporter progressReport, ITargetMapper targetMapper, IDependencyFinder dependencyFinder, IReportGenerator reportGenerator, IEnumerable<IgnoreAssemblyInfo> assembliesToIgnore, IFileWriter writer)
4139
{
4240
_apiPortService = apiPortService;
@@ -48,32 +46,6 @@ public ApiPortClient(IApiPortService apiPortService, IProgressReporter progressR
4846
_writer = writer;
4947
}
5048

51-
/// <summary>
52-
/// Analyzes assemblies provided by options
53-
/// </summary>
54-
/// <param name="options"></param>
55-
/// <returns>A reporting result for the supplied assemblies</returns>
56-
public async Task<ReportingResult> AnalyzeAssembliesAsync(IApiPortOptions options)
57-
{
58-
ValidateOptions(options);
59-
60-
var assemblies = options.InputAssemblies?.Keys ?? Array.Empty<IAssemblyFile>();
61-
var dependencyInfo = _dependencyFinder.FindDependencies(assemblies, _progressReport);
62-
63-
if (dependencyInfo.UserAssemblies.Any())
64-
{
65-
AnalyzeRequest request = GenerateRequest(options, dependencyInfo);
66-
67-
return await GetResultFromServiceAsync(request, dependencyInfo);
68-
}
69-
else
70-
{
71-
_progressReport.ReportIssue(LocalizedStrings.NoFilesAvailableToUpload);
72-
73-
return null;
74-
}
75-
}
76-
7749
/// <summary>
7850
/// Retrieve a list of targets available from the service
7951
/// </summary>
@@ -332,19 +304,6 @@ private AnalyzeRequest GenerateRequest(IApiPortOptions options, IDependencyInfo
332304
};
333305
}
334306

335-
/// <summary>
336-
/// Gets the Portability of an application as a ReportingResult.
337-
/// </summary>
338-
/// <returns>Set of APIs/assemblies that are not portable/missing.</returns>
339-
private async Task<ReportingResult> GetResultFromServiceAsync(AnalyzeRequest request, IDependencyInfo dependencyInfo)
340-
{
341-
var fullResponse = await RetrieveResultAsync(request);
342-
343-
CheckEndpointStatus(fullResponse.Headers.Status);
344-
345-
return GetReportingResult(request, fullResponse.Response, dependencyInfo);
346-
}
347-
348307
private ReportingResult GetReportingResult(AnalyzeRequest request, AnalyzeResponse response, IDependencyInfo dependencyInfo)
349308
{
350309
if (response == null)
@@ -376,22 +335,6 @@ private ReportingResult GetReportingResult(AnalyzeRequest request, AnalyzeRespon
376335
}
377336
}
378337

379-
private async Task<ServiceResponse<AnalyzeResponse>> RetrieveResultAsync(AnalyzeRequest request)
380-
{
381-
using (var progressTask = _progressReport.StartTask(LocalizedStrings.AnalyzingCompatibility))
382-
{
383-
try
384-
{
385-
return await _apiPortService.SendAnalysisAsync(request);
386-
}
387-
catch (Exception)
388-
{
389-
progressTask.Abort();
390-
throw;
391-
}
392-
}
393-
}
394-
395338
/// <summary>
396339
/// Verifies that the service is alive. If the service is not alive, then an issue is logged
397340
/// that will be reported back to the user.

src/lib/Microsoft.Fx.Portability/ApiPortService.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ public async Task<ServiceResponse<IEnumerable<AvailableTarget>>> GetTargetsAsync
7171
return await _client.CallAsync<IEnumerable<AvailableTarget>>(HttpMethod.Get, Endpoints.Targets);
7272
}
7373

74-
public async Task<ServiceResponse<UsageDataCollection>> GetUsageDataAsync(int? skip = null, int? top = null, UsageDataFilter? filter = null, IEnumerable<string> targets = null)
75-
{
76-
var usedApiUrl = UrlBuilder.Create(Endpoints.UsedApi)
77-
.AddQuery("skip", skip)
78-
.AddQuery("top", top)
79-
.AddQuery("filter", filter)
80-
.AddQueryList("targets", targets)
81-
.Url;
82-
83-
return await _client.CallAsync<UsageDataCollection>(HttpMethod.Get, usedApiUrl);
84-
}
85-
8674
public async Task<ServiceResponse<AnalyzeResponse>> GetAnalysisAsync(string submissionId)
8775
{
8876
var submissionUrl = UrlBuilder.Create(Endpoints.Analyze).AddPath(submissionId).Url;

src/lib/Microsoft.Fx.Portability/IApiPortService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public interface IApiPortService
1212
Task<ServiceResponse<IEnumerable<AvailableTarget>>> GetTargetsAsync();
1313
Task<ServiceResponse<AnalyzeResponse>> SendAnalysisAsync(AnalyzeRequest a);
1414
Task<ServiceResponse<IEnumerable<ReportingResultWithFormat>>> SendAnalysisAsync(AnalyzeRequest a, IEnumerable<string> format);
15-
Task<ServiceResponse<UsageDataCollection>> GetUsageDataAsync(int? skip = null, int? top = null, UsageDataFilter? filter = null, IEnumerable<string> targets = null);
1615
Task<ServiceResponse<ApiInformation>> GetApiInformationAsync(string docId);
1716
Task<ServiceResponse<IReadOnlyCollection<ApiDefinition>>> SearchFxApiAsync(string query, int? top = null);
1817
Task<ServiceResponse<IEnumerable<ResultFormatInformation>>> GetResultFormatsAsync();

src/lib/Microsoft.Fx.Portability/ObjectModel/IAnalyzeRequest.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/lib/Microsoft.Fx.Portability/ObjectModel/IStorage.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ public interface IStorage
1313
Task<IEnumerable<string>> RetrieveSubmissionIdsAsync();
1414
Task AddJobToQueueAsync(string submissionId);
1515
IEnumerable<ProjectSubmission> GetProjectSubmissions();
16-
Task<IEnumerable<UsageData>> GetUsageDataAsync();
1716
}
1817
}

src/lib/Microsoft.Fx.Portability/ObjectModel/UsageData.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)