[SERVER-59468] Coverity analysis defect 120437: Missing break in switch Created: 20/Aug/21  Updated: 20/Sep/21  Resolved: 20/Sep/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Ted Tuckman
Resolution: Duplicate Votes: 0
Labels: coverity, greenerbuild, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2021-08-20 at 11.24.23 AM.png    
Issue Links:
Related
related to SERVER-59465 Coverity analysis defect 120434: Unus... Closed
Operating System: ALL
Sprint: QO 2021-10-04
Participants:

 Description   

Missing break in switch

Execution falls through to the next case statement or default; this might indicate a common typo. Missing break statement between cases in switch statement
/src/mongo/db/pipeline/document_source_densify.cpp:90: MISSING_BREAK 120437 The case for value "mongo::String" is not terminated by a "break" statement.
/src/mongo/db/pipeline/document_source_densify.cpp:96: MISSING_BREAK 120437 The above case falls through to this one.



 Comments   
Comment by Kyle Suarez [ 20/Aug/21 ]

All of the cases in this switch statement should be checked. Either each case needs a break, or the inner if statements need a default else, since as written it does look like a mistake.

Generated at Thu Feb 08 05:47:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.