aglinxinyuan opened a new issue, #7459:
URL: https://github.com/apache/texera/issues/7459

   ### Task Summary
   
   Two small pieces of unreachable code, each found by a mutation that survived 
while testing the surrounding behaviour — i.e. each was demonstrated to have no 
observable effect, not merely suspected.
   
   **1. `hugging-face-image-upload.component.html` — an unreachable fallback.**
   
   ```html
   <span>{{ displayFileName || "Selected image" }}</span>
   ```
   
   The enclosing block is `*ngIf="previewSrc"`, and `previewSrc` is non-empty 
only when `hasImage` is true. `displayFileName` already returns `"Uploaded 
image"` in exactly that case, so it is never empty where this renders and the 
right-hand side of the `||` can never be evaluated.
   
   **2. `drag-drop.service.ts` — a guard subsumed by the next one.**
   
   ```ts
   const jointLink = paper.getModelById(link.linkID) as joint.dia.Link;
   if (!jointLink) { continue; }
   
   const linkView = paper.findViewByModel(jointLink) as joint.dia.LinkView;
   if (!linkView) { continue; }
   ```
   
   `paper.findViewByModel(undefined)` returns `undefined`, so the second guard 
already catches everything the first one does. Removing the first changes no 
observable behaviour — confirmed by mutation.
   
   ### Suggested next steps
   
   Delete both. Neither is load-bearing, and both are the kind of thing that 
reads as a meaningful guard to the next person.
   
   Note the second one is genuinely defensive in intent, so if the preference 
is to keep belt-and-braces null handling that is a reasonable call — but it 
should be a deliberate one rather than an accident.
   
   ### Task Type
   
   - [x] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to