⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@MarkLee131
Copy link
Contributor

This PR addresses the duplicate logic issue in PACM PL conference identification while maintaining all existing functionality. The refactoring centralizes conference mapping configuration and creates a reusable helper function, resulting in cleaner, more maintainable code.

Original code
The original code had duplicate logic for handling PACM PL conferences (OOPSLA, POPL, PLDI, ICFP) in two different functions:

  • fetchFromCache()
  • fetchFromDblpApi()

Both functions contained nearly identical 50+ lines of code to:

  1. Extract the number field from API response
  2. Handle missing number information by traversing the resp.hit array
  3. Map conference numbers to their corresponding DBLP URLs
  4. Fall back to PACM PL journal path for unmatched cases

Key Changes:

  • ✅ Created centralized PACM_PL_CONFERENCE_MAP configuration
  • ✅ Implemented processPacmPlJournal() helper function
  • ✅ Eliminated duplicate logic in fetchFromCache() and fetchFromDblpApi()
  • ✅ Enhanced OOPSLA recognition for both old and new number formats
  • ✅ Maintained backward compatibility for all existing functionality

Testing:

  • Verified all conference mappings work correctly
  • Confirmed fallback behavior for missing number fields
  • Tested both cache and API code paths
  • No breaking changes introduced

Files Changed:

  • js/fetchRank.js - Main refactoring changes

This refactoring follows the DRY principle and makes the codebase more maintainable while preserving the exact same user experience.

@MarkLee131
Copy link
Contributor Author

@WenyanLiu If all goes as planned, this PR addresses the following issues:

One more thing: the solution in Issue #137 likely requires “substantial” changes (at least, built on the current framework 🥲 ); we need to decide whether—and how—to refactor components. Since we’ve already been planning a design refinement, this may be the right time.

@ttttonyhe
Copy link

image Hello @MarkLee131, thank you for looking into this issue. Your code seem to have caused an error with displaying the labels (see the attached screenshot). Refreshing the page can resolve the error.

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.

2 participants