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
In the method String.toAnalyticsVersionStr()
the local variable num is never used
In the method String.toAnalyticsVersionStr()
There are two variables named num, thus causing variable shadowing
Relates to #107