Description
During the SPM migration work (#189), we fixed several Swift compiler warnings to get a clean pod lib lint run. Some of the fixes revealed deeper code quality concerns that warrant a dedicated investigation.
Areas to investigate
-
AppStart.swift — dead code in getAppStartDuration(): Lines 51–54 compute values that are immediately discarded. The function returns a duration computed via sysctl, while a second (unused) computation based on ProcessInfo.systemUptime is left dangling. Verify the sysctl-based approach is correct and remove the dead code.
-
AppStart.swift — getAppStartEndMillis() return type: Returns Double? but the backing field appStartEndMillis is a non-optional Double (initialized to 0.0). The optional return type is misleading.
-
FaroPlugin.swift — unused variables in getMemoryUsage case: A CACurrentMediaTime() call result and an empty [String] array are created but never used.
-
CrashReportingIntegration.swift — unused jsonString: A JSON string is constructed but never used.
-
General: Review all iOS native code for correctness, remove dead code, and ensure consistent code style.
Context
These issues are pre-existing and were not introduced by the SPM migration. They were surfaced by compiler warnings during pod lib lint.
Related: #189, #35
Description
During the SPM migration work (#189), we fixed several Swift compiler warnings to get a clean
pod lib lintrun. Some of the fixes revealed deeper code quality concerns that warrant a dedicated investigation.Areas to investigate
AppStart.swift— dead code ingetAppStartDuration(): Lines 51–54 compute values that are immediately discarded. The function returns a duration computed viasysctl, while a second (unused) computation based onProcessInfo.systemUptimeis left dangling. Verify thesysctl-based approach is correct and remove the dead code.AppStart.swift—getAppStartEndMillis()return type: ReturnsDouble?but the backing fieldappStartEndMillisis a non-optionalDouble(initialized to0.0). The optional return type is misleading.FaroPlugin.swift— unused variables ingetMemoryUsagecase: ACACurrentMediaTime()call result and an empty[String]array are created but never used.CrashReportingIntegration.swift— unusedjsonString: A JSON string is constructed but never used.General: Review all iOS native code for correctness, remove dead code, and ensure consistent code style.
Context
These issues are pre-existing and were not introduced by the SPM migration. They were surfaced by compiler warnings during
pod lib lint.Related: #189, #35