The pull request consists mostly of changes related to the addition of the shelf ready analysis functionality for the UNIMARC schema. There's however a couple of refactoring changes that were made to simplify some methods and flatten some statements. In addition to that, comments have been added to a couple of places with the intention to clarify the usage of some fields.
Here are listed a couple of issues that I identified during and after refactoring the code:
If a category is a "one of" category, then the record isn't analyzed at all. In the new code, that's evident here, and in the old code here. In this case, the score is equal to category.getScore() regardless of whether the marcRecord actually satisfies any selectors of that category.
Only the existence of the selectors is checked and not if they're equal to the values used in the ShelfReadyFieldsBooks enum. That can be observed in the refactored and the old code.
One kind of a more difficult to notice irregularity is what's described in the comment ~here~ (EDIT: comment misleading, I changed it here). I apologize for the poorly written comment and will try to further expand on that here.
This code block shows that we iterate through the selectors of the given category. In case a selector doesn't have subfields specified, the following portion of the code is executed:
In this case it's evident that we'll iterate through the selectors of the category, and then for each selector that doesn't have a subfield specification, the method getScoreWhenNoCodes will get executed in such a way that it only gets the first selector from that category (why particularly first) and assigns the score if that selector is satisfied. The issue in the original code can be accessed here.
The pull request consists mostly of changes related to the addition of the shelf ready analysis functionality for the UNIMARC schema. There's however a couple of refactoring changes that were made to simplify some methods and flatten some statements. In addition to that, comments have been added to a couple of places with the intention to clarify the usage of some fields.
Here are listed a couple of issues that I identified during and after refactoring the code:
category.getScore()
regardless of whether themarcRecord
actually satisfies any selectors of that category.ShelfReadyFieldsBooks
enum. That can be observed in the refactored and the old code.One kind of a more difficult to notice irregularity is what's described in the comment ~here~ (EDIT: comment misleading, I changed it here). I apologize for the poorly written comment and will try to further expand on that here.
This code block shows that we iterate through the selectors of the given category. In case a selector doesn't have subfields specified, the following portion of the code is executed:
In this case it's evident that we'll iterate through the selectors of the category, and then for each selector that doesn't have a subfield specification, the method
getScoreWhenNoCodes
will get executed in such a way that it only gets the first selector from that category (why particularly first) and assigns the score if that selector is satisfied. The issue in the original code can be accessed here.