Browse Source

feat(replays): Negatively score replays sub 5 sec (#38028)

Added a substraction for the score result if the replay has 5 secs or less. Closes #38005
Jesus Padron 2 years ago
parent
commit
49e732a69d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      static/app/components/replays/replayHighlight.tsx

+ 5 - 0
static/app/components/replays/replayHighlight.tsx

@@ -20,6 +20,11 @@ function ReplayHighlight({replay}: Props) {
     const pagesVisitedOverTime = pagesVisited / (duration || 1);
 
     score = (countErrors * 25 + pagesVisited * 5 + pagesVisitedOverTime) / 10;
+    // negatively score sub 5 second replays
+    if (duration <= 5) {
+      score = score - 10 / (duration || 1);
+    }
+
     score = Math.floor(Math.min(10, Math.max(1, score)));
   }