Usage Description Placeholder
ID |
swift.usage_description_placeholder |
Severity |
info |
Remediation Complexity |
medium |
Remediation Risk |
low |
Remediation Effort |
medium |
Resource |
Code Smell |
Language |
Swift |
Tags |
code-smell, suspicious-code |
Description
Reports privacy purpose-strings in Info.plist (keys matching
NS*UsageDescription) whose value is empty, whitespace-only, or a
recognisable placeholder such as TODO, FIXME, lorem ipsum, an
ellipsis or a row of asterisks.
<key>NSCameraUsageDescription</key>
<string>TODO</string> <!-- FLAW -->
<key>NSMicrophoneUsageDescription</key>
<string>...</string> <!-- FLAW -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>Show nearby coffee shops on the map.</string> <!-- OK -->
Rationale
App Store review rejects submissions whose purpose-strings are unhelpful, and iOS displays the text verbatim in the permission prompt and the privacy nutrition label. A placeholder shipped to production embarrasses the team and delays release.
Remediation
Replace the placeholder with a concise sentence that explains why the
app needs the permission, in user-facing terms. Localise the string
through InfoPlist.strings if the app ships in multiple languages.