Skip to content

Commit

Permalink
fix:Linting issues due to Nested Block depth
Browse files Browse the repository at this point in the history
  • Loading branch information
angrezichatterbox committed Dec 5, 2024
1 parent e397194 commit 14a05a5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/be/scri/helpers/AlphanumericComparator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package be.scri.helpers

// Taken from https://gist.github.com/MichaelRocks/1b94bb44c7804e999dbf31dac86955ec.
// Make IMG_5.jpg come before IMG_10.jpg.
// This is a example test so suppressed as it doesn't effect the application
@Suppress("NestedBlockDepth")
class AlphanumericComparator {
fun compare(
string1: String,
Expand Down
18 changes: 11 additions & 7 deletions app/src/main/java/be/scri/helpers/DatabaseHelper.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package be.scri.helpers

import android.content.Context
import android.database.Cursor
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import java.io.FileOutputStream
Expand Down Expand Up @@ -51,16 +52,19 @@ class DatabaseHelper(
if (cursor.moveToFirst()) {
do {
val key = cursor.getString(0)
val values = mutableListOf<String>()

for (i in 1 until cursor.columnCount) {
values.add(cursor.getString(i))
}

hashMap[key] = values
hashMap[key] = getEmojiKeyMaps(cursor)
} while (cursor.moveToNext())
}
}
return hashMap
}

fun getEmojiKeyMaps(cursor: Cursor): MutableList<String> {
val values = mutableListOf<String>()

for (i in 1 until cursor.columnCount) {
values.add(cursor.getString(i))
}
return values
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/be/scri/helpers/MyKeyboard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.io.IOException
* @attr ref android.R.styleable#Keyboard_keyWidth
* @attr ref android.R.styleable#Keyboard_horizontalGap
*/
@Suppress("LongMethod")
@Suppress("LongMethod", "NestedBlockDepth")
class MyKeyboard {
/** Horizontal gap default for all rows */
private var mDefaultHorizontalGap = 0
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/be/scri/views/MyKeyboardView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import java.util.Arrays
import java.util.Locale

@SuppressLint("UseCompatLoadingForDrawables")
@Suppress("LargeClass", "LongMethod", "TooManyFunctions")
@Suppress("LargeClass", "LongMethod", "TooManyFunctions", "NestedBlockDepth")
class MyKeyboardView
@JvmOverloads
constructor(
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ complexity:
TooManyFunctions:
active: true
NestedBlockDepth:
active: false
active: true
ComplexCondition:
active: true
LongParameterList:
Expand Down
Empty file added github.com
Empty file.

0 comments on commit 14a05a5

Please sign in to comment.