Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MapperService to reduce class complexity #857

Open
coderabbitai bot opened this issue Feb 11, 2025 · 0 comments
Open

Refactor MapperService to reduce class complexity #857

coderabbitai bot opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
code complexity and formatting Reduce code complexity or fix formatting php Pull requests that update Php code

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2025

The MapperService class in zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php has exceeded the complexity threshold (101 vs 100).

Current State

  • The class handles mapping logic for multiple entity types
  • Current complexity: 101 (threshold: 100)
  • Multiple TODO comments already suggest extracting mapping logic into specialized mapper classes

Proposed Solution

Extract mapping logic into specialized mapper classes for each entity type to:

  • Reduce overall class complexity
  • Improve maintainability
  • Follow Single Responsibility Principle

References

  • PR Discussion:
  • File: zmscitizenapi/src/Zmscitizenapi/Services/Core/MapperService.php
@ThomasAFink ThomasAFink added php Pull requests that update Php code code complexity and formatting Reduce code complexity or fix formatting labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code complexity and formatting Reduce code complexity or fix formatting php Pull requests that update Php code
Projects
None yet
Development

No branches or pull requests

1 participant