Upgraded the detekt dependency to version 1.23.8. * Fixed: NoNameShadowing detekt issue

This commit is contained in:
MohitMaliFtechiz 2025-02-24 14:52:14 +05:30
parent 422e93c6c5
commit 3725e929a5
3 changed files with 14 additions and 15 deletions

View File

@ -22,7 +22,7 @@ dependencies {
implementation("com.google.http-client:google-http-client-jackson2:1.40.0") {
exclude(group = "com.google.guava", module = "guava")
}
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8")
implementation("com.googlecode.json-simple:json-simple:1.1")
implementation("com.squareup.okhttp3:okhttp:4.10.0")

View File

@ -1828,8 +1828,7 @@ abstract class CoreReaderFragment :
zimReaderContainer?.let { zimReaderContainer ->
zimReaderContainer.setZimReaderSource(zimReaderSource)
val zimFileReader = zimReaderContainer.zimFileReader
zimFileReader?.let { zimFileReader ->
zimReaderContainer.zimFileReader?.let { zimFileReader ->
// uninitialized the service worker to fix https://github.com/kiwix/kiwix-android/issues/2561
if (!isFromManageExternalLaunch) {
openArticle(UNINITIALISER_ADDRESS)
@ -2693,7 +2692,7 @@ abstract class CoreReaderFragment :
(
backToTopButton?.visibility == View.GONE ||
backToTopButton?.visibility == View.INVISIBLE
) &&
) &&
ttsControls?.visibility == View.GONE
) {
backToTopButton?.show()

View File

@ -74,17 +74,17 @@ object FileUtils {
@JvmStatic
suspend fun deleteZimFile(path: String) {
fileOperationMutex.withLock {
var path = path
if (path.substring(path.length - ChunkUtils.PART.length) == ChunkUtils.PART) {
path = path.substring(0, path.length - ChunkUtils.PART.length)
var filePath = path
if (filePath.substring(filePath.length - ChunkUtils.PART.length) == ChunkUtils.PART) {
filePath = filePath.substring(0, filePath.length - ChunkUtils.PART.length)
}
val file = File(path)
val file = File(filePath)
if (file.path.substring(file.path.length - 3) != "zim") {
var alphabetFirst = 'a'
fileloop@ while (alphabetFirst <= 'z') {
var alphabetSecond = 'a'
while (alphabetSecond <= 'z') {
val chunkPath = path.substring(0, path.length - 2) + alphabetFirst + alphabetSecond
val chunkPath = filePath.substring(0, filePath.length - 2) + alphabetFirst + alphabetSecond
val fileChunk = File(chunkPath)
if (fileChunk.isFileExist()) {
fileChunk.deleteFile()
@ -97,7 +97,7 @@ object FileUtils {
}
} else {
file.deleteFile()
deleteZimFileParts(path)
deleteZimFileParts(filePath)
}
}
}
@ -514,15 +514,15 @@ object FileUtils {
@JvmStatic
suspend fun hasPart(file: File): Boolean {
var file = file
file = File(getFileName(file.path))
if (file.path.endsWith(".zim")) {
var tempFile = file
tempFile = File(getFileName(tempFile.path))
if (tempFile.path.endsWith(".zim")) {
return false
}
if (file.path.endsWith(".part")) {
if (tempFile.path.endsWith(".part")) {
return true
}
val path = file.path
val path = tempFile.path
for (firstCharacter in 'a'..'z') {
for (secondCharacter in 'a'..'z') {
val chunkPath = path.substring(0, path.length - 2) + firstCharacter + secondCharacter