Skip to content

Commit b0c4d34

Browse files
committed
chore: Add JSON method calls to detekt safe calls
Adds JSONObject and JSONArray method calls used in JsonExtensions.kt: - JSONObject.constructor(String): Parse JSON strings - JSONObject.get/put: Get and set values - JSONArray.get/put: Get and add elements These methods are used for recursive Map↔JSON conversion and are safe within the context of the conversion logic.
1 parent deeb794 commit b0c4d34

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

detekt_custom_safe_calls.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,11 +1228,16 @@ datadog:
12281228
- "okio.Buffer.constructor()"
12291229
# endregion
12301230
# region org.json
1231+
- "org.json.JSONArray.get(kotlin.Int)"
12311232
- "org.json.JSONArray.length()"
1233+
- "org.json.JSONArray.put(kotlin.Any?)"
12321234
- "org.json.JSONArray.toJsonArray()"
12331235
- "org.json.JSONObject.constructor()"
1234-
- "org.json.JSONObject.optString(kotlin.String?, kotlin.String?)"
1236+
- "org.json.JSONObject.constructor(kotlin.String)"
1237+
- "org.json.JSONObject.get(kotlin.String)"
12351238
- "org.json.JSONObject.keys()"
1239+
- "org.json.JSONObject.optString(kotlin.String?, kotlin.String?)"
1240+
- "org.json.JSONObject.put(kotlin.String, kotlin.Any?)"
12361241
- "org.json.JSONObject.toJsonObject()"
12371242
- "org.json.JSONObject.length()"
12381243
- "org.json.JSONObject.opt(kotlin.String?)"

0 commit comments

Comments
 (0)