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

Fix ScoredPhrase Bug #2440

Open
wants to merge 3 commits into
base: integration
Choose a base branch
from

Conversation

apmoriarty
Copy link
Collaborator

@apmoriarty apmoriarty commented Jun 26, 2024

Fixes #2441

  • added a test suite for ContentFunctionsDescriptor
  • corrected how fields are parsed from a scored function when calling fieldsAndTerms

ivakegg
ivakegg previously approved these changes Jun 26, 2024
drewfarris
drewfarris previously approved these changes Jun 26, 2024
Copy link
Collaborator

@drewfarris drewfarris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add some additional commentary in the comments, but fundamentally this code looks ok.

For future work, it would be nice to consider restructuring the code to avoid a bunch of nested if/else statements. I'm curious how sonar would rate the cyclomatic complexity of this class.

@apmoriarty
Copy link
Collaborator Author

It would be nice to add some additional commentary in the comments, but fundamentally this code looks ok.

For future work, it would be nice to consider restructuring the code to avoid a bunch of nested if/else statements. I'm curious how sonar would rate the cyclomatic complexity of this class.

I originally wanted to break apart that method but decided not to for the sake of keeping the change set small. Since you've asked, I'm more than happy to split out the scored phrase logic into it's own method. Sonar Lint shows the method complexity at 100 -- far too much.

@apmoriarty apmoriarty dismissed stale reviews from drewfarris and ivakegg via 82776c4 July 1, 2024 15:08
@apmoriarty
Copy link
Collaborator Author

It would be nice to add some additional commentary in the comments, but fundamentally this code looks ok.
For future work, it would be nice to consider restructuring the code to avoid a bunch of nested if/else statements. I'm curious how sonar would rate the cyclomatic complexity of this class.

I originally wanted to break apart that method but decided not to for the sake of keeping the change set small. Since you've asked, I'm more than happy to split out the scored phrase logic into it's own method. Sonar Lint shows the method complexity at 100 -- far too much.

I took a look at this and to do it right would require a massive expansion of scope. Wrote #2456 to track that.

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.

ContentFunctionsDescriptor fails to parse field from scored functions
3 participants