Skip to content

Conversation

@PRAteek-singHWY
Copy link
Contributor

@PRAteek-singHWY PRAteek-singHWY commented Jan 15, 2026

Note

Stacked PR: This PR is built on top of PR #716 (Backend Optimization). Please merge #716 first.

Summary

This PR adjusts the categorization logic for Gap Analysis links in the frontend. It lowers the score threshold for "Weak" links from 20 to 7 to better reflect the true quality of connections, as requested by the maintainers.

Motivation

The maintainer noted:

"By the way, I notice we don't seem to have weak links anymore: should we change our categorization and make 3-6 average and 7+ weak?"

Previously, a "Weak" link was defined as having a penalty score of 20 or higher. This score is practically unreachable in normal operation (requires ~10 hops of "related" links), causing truly weak connections to be mislabeled as "Average" or "Strong". This change aligns the UI with the maintainer's request and the user's intuitive understanding of link strength.

Changes

  • application/frontend/src/pages/GapAnalysis/GapAnalysis.tsx:
    • Updated GetStrength function: Changed condition for 'Weak' from >= 20 to >= 7.
    • Updated GetStrengthColor function: Changed condition for Red color from >= 20 to >= 7.
    • Updated the UI Popup Legend to explicitly state that "Weak" links start at score 7.

Related Issue

Verification

  1. Navigate to the map analysis page.
  2. Hover over the strength indicator (Popup).
  3. Verify the legend states: "Weakly connected likely to have small or no overlap" corresponds to score 7.
  4. Verify that paths with a score of 7+ appear as Red/Weak.

Checklist

- Introduce tiered gap analysis queries (strong → medium → wildcard)
- Stop traversal early when strong or medium paths exist
- Preserve existing scoring and semantics
- Add unit test to verify Tier-3 traversal is skipped when not needed

Fixes OWASP#506
@PRAteek-singHWY
Copy link
Contributor Author

Hi @northdpole

Verification Report
I have verified the frontend logic changes in GapAnalysis.tsx.

  • Logic Check: Confirmed that GetStrength and colors now treat scores 7+ as Weak (Red), previously 20.
  • Requirement Met: This matches the maintainer's request to make "3-6 average and 7+ weak".
  • UI Update: The Legend has been updated to reflect the new threshold.

Always open to iterating further based on your guidance. I'm really learning a lot from this process—thanks for the review and the honest responses!

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.

Prune map analysis search to save time and memory

1 participant