-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy path.swiftlint-baseline.json
More file actions
512 lines (512 loc) · 21.4 KB
/
Copy path.swiftlint-baseline.json
File metadata and controls
512 lines (512 loc) · 21.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
[
{
"text": " func fetchSyncRegion(latitude: Double, longitude: Double) async throws -> SyncRegionResponse {",
"violation": {
"location": {
"character": 5,
"file": "RadarSDK/RadarAPIClient.swift",
"line": 40
},
"reason": "Function body should span 50 lines or less excluding comments and whitespace: currently spans 52 lines",
"ruleDescription": "Function bodies should not span too many lines",
"ruleIdentifier": "function_body_length",
"ruleName": "Function Body Length",
"severity": "warning"
}
},
{
"text": " if let v = try? container.decode(Bool.self) {",
"violation": {
"location": {
"character": 16,
"file": "RadarSDK/RadarGeofence.swift",
"line": 168
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " } else if let v = try? container.decode(Int.self) {",
"violation": {
"location": {
"character": 23,
"file": "RadarSDK/RadarGeofence.swift",
"line": 170
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " } else if let v = try? container.decode(Double.self) {",
"violation": {
"location": {
"character": 23,
"file": "RadarSDK/RadarGeofence.swift",
"line": 172
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " } else if let v = try? container.decode(String.self) {",
"violation": {
"location": {
"character": 23,
"file": "RadarSDK/RadarGeofence.swift",
"line": 174
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " case .string(let v): try container.encode(v)",
"violation": {
"location": {
"character": 26,
"file": "RadarSDK/RadarGeofence.swift",
"line": 184
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " case .int(let v): try container.encode(v)",
"violation": {
"location": {
"character": 23,
"file": "RadarSDK/RadarGeofence.swift",
"line": 185
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " case .double(let v): try container.encode(v)",
"violation": {
"location": {
"character": 26,
"file": "RadarSDK/RadarGeofence.swift",
"line": 186
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " case .bool(let v): try container.encode(v)",
"violation": {
"location": {
"character": 24,
"file": "RadarSDK/RadarGeofence.swift",
"line": 187
},
"reason": "Variable name 'v' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": "public final class RadarInAppMessage_Swift: RadarInAppMessage {",
"violation": {
"location": {
"character": 20,
"file": "RadarSDK/RadarInAppMessage.swift",
"line": 11
},
"reason": "Type name 'RadarInAppMessage_Swift' should only contain alphanumeric and other allowed characters",
"ruleDescription": "Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length.\nPrivate types may start with an underscore.",
"ruleIdentifier": "type_name",
"ruleName": "Type Name",
"severity": "error"
}
},
{
"text": " var image: UIImage? = nil",
"violation": {
"location": {
"character": 17,
"file": "RadarSDK/RadarInAppMessageDelegate.swift",
"line": 42
},
"reason": "Optional should be implicitly initialized without nil",
"ruleDescription": "Optionals should be consistently initialized, either with `= nil` or without.",
"ruleIdentifier": "implicit_optional_initialization",
"ruleName": "Implicit Optional Initialization",
"severity": "warning"
}
},
{
"text": " ) { result in",
"violation": {
"location": {
"character": 15,
"file": "RadarSDK/RadarInAppMessageManager.swift",
"line": 82
},
"reason": "Trailing closure syntax should not be used when passing more than one closure argument",
"ruleDescription": "Trailing closure syntax should not be used when passing more than one closure argument",
"ruleIdentifier": "multiple_closures_with_trailing_closure",
"ruleName": "Multiple Closures with Trailing Closure",
"severity": "warning"
}
},
{
"text": " }) {",
"violation": {
"location": {
"character": 28,
"file": "RadarSDK/RadarInAppMessageView.swift",
"line": 49
},
"reason": "Trailing closure syntax should not be used when passing more than one closure argument",
"ruleDescription": "Trailing closure syntax should not be used when passing more than one closure argument",
"ruleIdentifier": "multiple_closures_with_trailing_closure",
"ruleName": "Multiple Closures with Trailing Closure",
"severity": "warning"
}
},
{
"text": " ]) as! RadarInAppMessage_Swift,",
"violation": {
"location": {
"character": 16,
"file": "RadarSDK/RadarInAppMessageView.swift",
"line": 105
},
"reason": "Force casts should be avoided",
"ruleDescription": "Force casts should be avoided",
"ruleIdentifier": "force_cast",
"ruleName": "Force Cast",
"severity": "error"
}
},
{
"text": "let RADAR_NOTIFICATION_PREFIX = \"radar_\"",
"violation": {
"location": {
"character": 5,
"file": "RadarSDK/RadarNotification.swift",
"line": 8
},
"reason": "Variable name 'RADAR_NOTIFICATION_PREFIX' should only contain alphanumeric and other allowed characters",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": "let GEOFENCE_NOTIFICATION_PREFIX = \"radar_geofence_\"",
"violation": {
"location": {
"character": 5,
"file": "RadarSDK/RadarNotification.swift",
"line": 9
},
"reason": "Variable name 'GEOFENCE_NOTIFICATION_PREFIX' should only contain alphanumeric and other allowed characters",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " init(from settings: UNNotificationSettings) {",
"violation": {
"location": {
"character": 5,
"file": "RadarSDK/RadarNotification.swift",
"line": 199
},
"reason": "Function should have complexity 10 or less; currently complexity is 26",
"ruleDescription": "Complexity of function bodies should be limited.",
"ruleIdentifier": "cyclomatic_complexity",
"ruleName": "Cyclomatic Complexity",
"severity": "error"
}
},
{
"text": " init(from settings: UNNotificationSettings) {",
"violation": {
"location": {
"character": 5,
"file": "RadarSDK/RadarNotification.swift",
"line": 199
},
"reason": "Initializer body should span 50 lines or less excluding comments and whitespace: currently spans 64 lines",
"ruleDescription": "Function bodies should not span too many lines",
"ruleIdentifier": "function_body_length",
"ruleName": "Function Body Length",
"severity": "warning"
}
},
{
"text": " if !existingTagsSet.contains(tag) {",
"violation": {
"location": {
"character": 13,
"file": "RadarSDK/RadarSettings.swift",
"line": 338
},
"reason": "`where` clauses are preferred over a single `if` inside a `for`",
"ruleDescription": "`where` clauses are preferred over a single `if` inside a `for`",
"ruleIdentifier": "for_where",
"ruleName": "Prefer For-Where",
"severity": "warning"
}
},
{
"text": "public final class RadarSyncManager: NSObject {",
"violation": {
"location": {
"character": 14,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 13
},
"reason": "Class body should span 350 lines or less excluding comments and whitespace: currently spans 603 lines",
"ruleDescription": "Type bodies should not span too many lines",
"ruleIdentifier": "type_body_length",
"ruleName": "Type Body Length",
"severity": "error"
}
},
{
"text": " private static func greatCircleInterpolate(from a: CLLocationCoordinate2D, to b: CLLocationCoordinate2D, fraction t: Double) -> CLLocationCoordinate2D {",
"violation": {
"location": {
"character": 119,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 257
},
"reason": "Variable name 't' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " let h = sinHalfDLat * sinHalfDLat + cos(lat1) * cos(lat2) * sinHalfDLon * sinHalfDLon",
"violation": {
"location": {
"character": 13,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 267
},
"reason": "Variable name 'h' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " @objc public static func reconcileSyncState(user: RadarUser) {",
"violation": {
"location": {
"character": 18,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 620
},
"reason": "Function should have complexity 10 or less; currently complexity is 11",
"ruleDescription": "Complexity of function bodies should be limited.",
"ruleIdentifier": "cyclomatic_complexity",
"ruleName": "Cyclomatic Complexity",
"severity": "warning"
}
},
{
"text": " @objc public static func reconcileSyncState(user: RadarUser) {",
"violation": {
"location": {
"character": 25,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 620
},
"reason": "Function body should span 50 lines or less excluding comments and whitespace: currently spans 58 lines",
"ruleDescription": "Function bodies should not span too many lines",
"ruleIdentifier": "function_body_length",
"ruleName": "Function Body Length",
"severity": "warning"
}
},
{
"text": "}",
"violation": {
"location": {
"character": 1,
"file": "RadarSDK/RadarSyncManager.swift",
"line": 871
},
"reason": "File should contain 400 lines or less: currently contains 871",
"ruleDescription": "Files should not span too many lines.",
"ruleIdentifier": "file_length",
"ruleName": "File Length",
"severity": "warning"
}
},
{
"text": " func InAppMessageTestConstruction() throws {",
"violation": {
"location": {
"character": 10,
"file": "RadarSDKTests/InAppMessageTest.swift",
"line": 108
},
"reason": "Function name 'InAppMessageTestConstruction()' should start with a lowercase character",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " func InAppMessageTestToDictionary() throws {",
"violation": {
"location": {
"character": 10,
"file": "RadarSDKTests/InAppMessageTest.swift",
"line": 126
},
"reason": "Function name 'InAppMessageTestToDictionary()' should start with a lowercase character",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " func InAppMessageTestCreateView() async throws {",
"violation": {
"location": {
"character": 10,
"file": "RadarSDKTests/InAppMessageTest.swift",
"line": 159
},
"reason": "Function name 'InAppMessageTestCreateView()' should start with a lowercase character",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " func InAppMessageViewAlreadyExist() async throws {",
"violation": {
"location": {
"character": 10,
"file": "RadarSDKTests/InAppMessageTest.swift",
"line": 185
},
"reason": "Function name 'InAppMessageViewAlreadyExist()' should start with a lowercase character",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " private var _registeredNotifications: [NotificationValue]? = nil",
"violation": {
"location": {
"character": 17,
"file": "RadarSDKTests/MockRadarState.swift",
"line": 12
},
"reason": "Optional should be implicitly initialized without nil",
"ruleDescription": "Optionals should be consistently initialized, either with `= nil` or without.",
"ruleIdentifier": "implicit_optional_initialization",
"ruleName": "Implicit Optional Initialization",
"severity": "warning"
}
},
{
"text": " for i in 0..<10 {",
"violation": {
"location": {
"character": 13,
"file": "RadarSDKTests/RadarNotificationHelperTest.swift",
"line": 259
},
"reason": "Variable name 'i' should be between 3 and 40 characters long",
"ruleDescription": "Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.",
"ruleIdentifier": "identifier_name",
"ruleName": "Identifier Name",
"severity": "error"
}
},
{
"text": " userDefaults.dictionaryRepresentation().forEach { key, value in",
"violation": {
"location": {
"character": 64,
"file": "RadarSDKTests/RadarSettingsTest.swift",
"line": 22
},
"reason": "Unused parameter in a closure should be replaced with _",
"ruleDescription": "Unused parameter in a closure should be replaced with _",
"ruleIdentifier": "unused_closure_parameter",
"ruleName": "Unused Closure Parameter",
"severity": "warning"
}
},
{
"text": " struct RadarSyncManagerTests {",
"violation": {
"location": {
"character": 5,
"file": "RadarSDKTests/RadarSyncManagerTests.swift",
"line": 16
},
"reason": "Struct body should span 350 lines or less excluding comments and whitespace: currently spans 672 lines",
"ruleDescription": "Type bodies should not span too many lines",
"ruleIdentifier": "type_body_length",
"ruleName": "Type Body Length",
"severity": "error"
}
},
{
"text": "}",
"violation": {
"location": {
"character": 1,
"file": "RadarSDKTests/RadarSyncManagerTests.swift",
"line": 876
},
"reason": "File should contain 400 lines or less: currently contains 876",
"ruleDescription": "Files should not span too many lines.",
"ruleIdentifier": "file_length",
"ruleName": "File Length",
"severity": "warning"
}
}
]