Skip to content

Refactor ReportingManager.GetMerchants to satisfy Codacy LOC limit#511

Merged
StuartFerguson merged 5 commits intomainfrom
copilot/fix-reportingmanager-getmerchants-complexity
Mar 17, 2026
Merged

Refactor ReportingManager.GetMerchants to satisfy Codacy LOC limit#511
StuartFerguson merged 5 commits intomainfrom
copilot/fix-reportingmanager-getmerchants-complexity

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

  • Inspect the new PR comment and identify the failing CI/build run
  • Retrieve the failing workflow/job logs and determine the root cause
  • Make the smallest code change needed to resolve the build failure
  • Run the most targeted validation available for the fix
  • Review the final diff, update the PR comment, and finalize
Original prompt

This section details on the original issue you should resolve

<issue_title>[Complexity] Method ReportingManager::GetMerchants has 51 lines of code (limit is 50)</issue_title>
<issue_description>

Codacy ID: a3bf68eccd557f9049df68d8454cc415

File: EstateReportingAPI.BusinessLogic/ReportingManager.cs
Line: 935
Rule: Complexity (Warning)
Commit: c6ec82b8138936189d33b99020db45b30d2d8343

Message: Method ReportingManager::GetMerchants has 51 lines of code (limit is 50)

**Code Snippet:**
```csharp
    public async Task<Result<List<Merchant>>> GetMerchants(MerchantQueries.GetMerchantsQuery request, 
```

</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 2 commits March 17, 2026 11:13
Copilot AI changed the title [WIP] [Complexity] Refactor GetMerchants method to reduce lines of code Refactor ReportingManager.GetMerchants to satisfy Codacy LOC limit Mar 17, 2026
Copilot AI requested a review from StuartFerguson March 17, 2026 11:19
Comment thread EstateReportingAPI.BusinessLogic/ReportingManager.cs Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 17, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp ; (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI.sln --packages /tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI.csproj --packages /tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from StuartFerguson March 17, 2026 11:43
@StuartFerguson StuartFerguson marked this pull request as ready for review March 17, 2026 11:46
@StuartFerguson
Copy link
Copy Markdown
Member

@copilot got a build error can you investigate and resolve ?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 17, 2026

@copilot got a build error can you investigate and resolve ?

I checked the failing PR workflow and fixed the compile error. The break was from BuildMerchantBalanceLookup(...) referencing MerchantBalanceProjectionState without the projection-engine type being in scope in ReportingManager; that’s addressed in d902e56.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.3/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI.sln --packages /tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI/EstateReportingAPI.csproj --packages /tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-f294ada2fef3658c/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@StuartFerguson StuartFerguson merged commit f5000a2 into main Mar 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Complexity] Method ReportingManager::GetMerchants has 51 lines of code (limit is 50)

2 participants