You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building the project, I noticed the following warnings for the Analytics.kt class:
In the method generateOSVersionString:
private fun generateOSVersionString(major: Any, minor: Any? = "0", patch: Any? = null): String {
val patchStr = if (patch != null) patch.toString().toAnalyticsVersionStr() else ""
val minorStr = minor.toString().padStart(2, '0').toLong().toString(2).toAnalyticsVersionStr()
val majorStr = major.toString().padStart(2, '0').toLong().toString(2).toAnalyticsVersionStr()
return "$majorStr$minorStr"
}
patchStr is never used
In the method String.toAnalyticsVersionStr()
private fun String.toAnalyticsVersionStr(): String {
val num = this.toInt(2)
return when (val num = this.toInt(2)) {
in 0..25 -> {
('A' + num).toString()
}
in 26..51 -> {
('a' + num - 26).toString()
}
else -> ('0' + num - 52).toString()
}
}
the local variable num is never used
In the method String.toAnalyticsVersionStr()
private fun String.toAnalyticsVersionStr(): String {
val num = this.toInt(2)
return when (val num = this.toInt(2)) {
in 0..25 -> {
('A' + num).toString()
}
in 26..51 -> {
('a' + num - 26).toString()
}
else -> ('0' + num - 52).toString()
}
}
There are two variables named num, thus causing variable shadowing
Building the project, I noticed the following warnings for the Analytics.kt class:
patchStr is never used
the local variable num is never used
There are two variables named num, thus causing variable shadowing
Relates to #107
The text was updated successfully, but these errors were encountered: