Reduce code duplication in MCCL detectors #190
hayakawa16
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
This was by design to reduce coupling between classes and use the same pattern an external developer would use to build a detector. If they're trying to copy-paste the implementation, it's going to be a lot more cognitive load to understand inheritance and/or factory methods. On that last point - if we did go this direction, I would heavily favor static factory helper classes (like we do for some source distributions? can't remember...) over inheritance and base classes. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently when new detectors are added, the duplication in new code is ~33% and does not pass the SonarCloud build and analyze quality review.
Reduce code duplication by creating Base classes for types of detectors (like what is done for Sources). This could be done by general groups (reflectance/transmittance or 1D/2D). Not sure until code is analyzed for best approach.
Also, possibly group detectors into folders once segmenting is performed (like how Sources are organized).
Currently we increase the check limit to 33% in order to pass quality check, then reduce back after branch is merged.
Beta Was this translation helpful? Give feedback.
All reactions