Skip to content

Commit 5af2f7d

Browse files
committed
chore: lint
1 parent c4317d2 commit 5af2f7d

File tree

7 files changed

+4
-23
lines changed

7 files changed

+4
-23
lines changed

app/detekt-baseline.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<ID>ComposableParamOrder:HomeScreen.kt$Content</ID>
2929
<ID>ComposableParamOrder:InfoScreenContent.kt$InfoScreenContent</ID>
3030
<ID>ComposableParamOrder:Money.kt$MoneyCaptionB</ID>
31-
<ID>ComposableParamOrder:NumberPadTextField.kt$MoneyAmount</ID>
3231
<ID>ComposableParamOrder:OnboardingSlidesScreen.kt$OnboardingSlidesScreen</ID>
3332
<ID>ComposableParamOrder:OnboardingSlidesScreen.kt$OnboardingTab</ID>
3433
<ID>ComposableParamOrder:PriceCard.kt$PriceCard</ID>
@@ -168,13 +167,11 @@
168167
<ID>LongMethod:AppViewModel.kt$AppViewModel$private suspend fun proceedWithPayment()</ID>
169168
<ID>LongMethod:ContentView.kt$private fun NavGraphBuilder.widgets( navController: NavHostController, settingsViewModel: SettingsViewModel, currencyViewModel: CurrencyViewModel, )</ID>
170169
<ID>LongMethod:CoreService.kt$ActivityService$suspend fun generateRandomTestData(count: Int = 100)</ID>
171-
<ID>LongMethod:LightningRepo.kt$LightningRepo$suspend fun start( walletIndex: Int = 0, timeout: Duration? = null, shouldRetry: Boolean = true, eventHandler: NodeEventHandler? = null, customServer: ElectrumServer? = null, customRgsServerUrl: String? = null, ): Result&lt;Unit&gt;</ID>
172170
<ID>LongMethod:LightningService.kt$LightningService$private fun logEvent(event: Event)</ID>
173171
<ID>LongMethod:MainActivity.kt$MainActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
174172
<ID>LongMethod:WakeNodeWorker.kt$WakeNodeWorker$private suspend fun handleLdkEvent(event: Event)</ID>
175173
<ID>LongParameterList:ActivityRepo.kt$ActivityRepo$( filter: ActivityFilter? = null, txType: PaymentType? = null, tags: List&lt;String&gt;? = null, search: String? = null, minDate: ULong? = null, maxDate: ULong? = null, limit: UInt? = null, sortDirection: SortDirection? = null, )</ID>
176174
<ID>LongParameterList:ActivityRepo.kt$ActivityRepo$( id: String, paymentHash: String? = null, txId: String? = null, address: String, isReceive: Boolean, tags: List&lt;String&gt;, )</ID>
177-
<ID>LongParameterList:AppViewModel.kt$AppViewModel$( @ApplicationContext private val context: Context, @BgDispatcher private val bgDispatcher: CoroutineDispatcher, private val keychain: Keychain, private val lightningRepo: LightningRepo, private val walletRepo: WalletRepo, private val coreService: CoreService, private val ldkNodeEventBus: LdkNodeEventBus, private val settingsStore: SettingsStore, private val currencyRepo: CurrencyRepo, private val activityRepo: ActivityRepo, private val blocktankRepo: BlocktankRepo, connectivityRepo: ConnectivityRepo, healthRepo: HealthRepo, )</ID>
178175
<ID>LongParameterList:BiometricPrompt.kt$( activity: Context, title: String, cancelButtonText: String, onAuthSucceed: () -&gt; Unit, onAuthFailed: (() -&gt; Unit), onAuthError: ((errorCode: Int, errString: CharSequence) -&gt; Unit), )</ID>
179176
<ID>LongParameterList:BiometricPrompt.kt$( activity: Context, title: String, cancelButtonText: String, onAuthSucceeded: () -&gt; Unit, onAuthFailed: (() -&gt; Unit), onAuthError: ((errorCode: Int, errString: CharSequence) -&gt; Unit), onUnsupported: () -&gt; Unit, )</ID>
180177
<ID>LongParameterList:CoreService.kt$ActivityService$( filter: ActivityFilter? = null, txType: PaymentType? = null, tags: List&lt;String&gt;? = null, search: String? = null, minDate: ULong? = null, maxDate: ULong? = null, limit: UInt? = null, sortDirection: SortDirection? = null, )</ID>
@@ -184,7 +181,6 @@
184181
<ID>LongParameterList:LightningConnectionsViewModel.kt$LightningConnectionsViewModel$( @ApplicationContext private val context: Context, @BgDispatcher private val bgDispatcher: CoroutineDispatcher, private val lightningRepo: LightningRepo, internal val blocktankRepo: BlocktankRepo, private val logsRepo: LogsRepo, private val addressChecker: AddressChecker, private val ldkNodeEventBus: LdkNodeEventBus, private val walletRepo: WalletRepo, )</ID>
185182
<ID>LongParameterList:LightningRepo.kt$LightningRepo$( @BgDispatcher private val bgDispatcher: CoroutineDispatcher, private val lightningService: LightningService, private val ldkNodeEventBus: LdkNodeEventBus, private val settingsStore: SettingsStore, private val coreService: CoreService, private val lspNotificationsService: LspNotificationsService, private val firebaseMessaging: FirebaseMessaging, private val keychain: Keychain, private val lnurlService: LnurlService, private val cacheStore: CacheStore, )</ID>
186183
<ID>LongParameterList:LightningRepo.kt$LightningRepo$( address: Address, sats: ULong, speed: TransactionSpeed? = null, utxosToSpend: List&lt;SpendableUtxo&gt;? = null, feeRates: FeeRates? = null, isTransfer: Boolean = false, channelId: String? = null, )</ID>
187-
<ID>LongParameterList:LightningRepo.kt$LightningRepo$( walletIndex: Int = 0, timeout: Duration? = null, shouldRetry: Boolean = true, eventHandler: NodeEventHandler? = null, customServer: ElectrumServer? = null, customRgsServerUrl: String? = null, )</ID>
188184
<ID>LongParameterList:Notifications.kt$( title: String?, text: String?, extras: Bundle? = null, bigText: String? = null, id: Int = Random.nextInt(), context: Context, )</ID>
189185
<ID>LongParameterList:TransferViewModel.kt$TransferViewModel$( @ApplicationContext private val context: Context, private val lightningRepo: LightningRepo, private val blocktankRepo: BlocktankRepo, private val walletRepo: WalletRepo, private val currencyRepo: CurrencyRepo, private val settingsStore: SettingsStore, private val cacheStore: CacheStore, )</ID>
190186
<ID>LongParameterList:WalletRepo.kt$WalletRepo$( @BgDispatcher private val bgDispatcher: CoroutineDispatcher, private val db: AppDb, private val keychain: Keychain, private val coreService: CoreService, private val settingsStore: SettingsStore, private val addressChecker: AddressChecker, private val lightningRepo: LightningRepo, private val cacheStore: CacheStore, )</ID>
@@ -389,7 +385,6 @@
389385
<ID>MaxLineLength:BlocktankRegtestScreen.kt$"Initiating channel close with fundingTxId: $fundingTxId, vout: $vout, forceCloseAfter: $forceCloseAfter"</ID>
390386
<ID>MaxLineLength:BlocktankRepo.kt$BlocktankRepo$"Buying channel with lspBalanceSat: $receivingBalanceSats, channelExpiryWeeks: $channelExpiryWeeks, options: $options"</ID>
391387
<ID>MaxLineLength:ChannelOrdersScreen.kt$lnurl = "LNURL1DP68GURN8GHJ7CTSDYH8XARPVUHXYMR0VD4HGCTWDVH8GME0VFKX7CMTW3SKU6E0V9CXJTMKXGHKCTENVV6NVDP4XUEJ6ETRX33Z6DPEXU6Z6C34XQEZ6DT9XENX2WFNXQ6RXDTXGQAH4MLNURL1DP68GURN8GHJ7CTSDYH8XARPVUHXYMR0VD4HGCTWDVH8GME0VFKX7CMTW3SKU6E0V9CXJTMKXGHKCTENVV6NVDP4XUEJ6ETRX33Z6DPEXU6Z6C34XQEZ6DT9XENX2WFNXQ6RXDTXGQAH4M"</ID>
392-
<ID>MaxLineLength:CoreService.kt$CoreService$// val blocktankPeers = getInfo(refresh = true)?.nodes?.map { LnPeer(nodeId = it.pubkey, address = "TO_DO") }.orEmpty()</ID>
393388
<ID>MaxLineLength:CryptoTest.kt$CryptoTest$val ciphertext = "l2fInfyw64gO12odo8iipISloQJ45Rc4WjFmpe95brdaAMDq+T/L9ZChcmMCXnR0J6BXd8sSIJe/0bmby8uSZZJuVCzwF76XHfY5oq0Y1/hKzyZTn8nG3dqfiLHnAPy1tZFQfm5ALgjwWnViYJLXoGFpXs7kLMA=".fromBase64()</ID>
394389
<ID>MaxLineLength:CryptoTest.kt$CryptoTest$val decryptedPayload = """{"source":"blocktank","type":"incomingHtlc","payload":{"secretMessage":"hello"},"createdAt":"2024-09-18T13:33:52.555Z"}"""</ID>
395390
<ID>MaxLineLength:HeadlineCard.kt$headline = "How Bitcoin changed El Salvador in more ways a big headline to test the text overflooooooow"</ID>
@@ -554,14 +549,6 @@
554549
<ID>PreviewPublic:EmptyWalletView.kt$EmptyStateViewPreview</ID>
555550
<ID>PreviewPublic:HighlightLabel.kt$FlexibleLogoPreview</ID>
556551
<ID>PreviewPublic:HighlightLabel.kt$LongTextLogoPreview</ID>
557-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountBitcoinClassicEmpty</ID>
558-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountBitcoinClassicWithValue</ID>
559-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountBitcoinModernEmpty</ID>
560-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountBitcoinModernWithValue</ID>
561-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountBitcoinPartial</ID>
562-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountFiatEmpty</ID>
563-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountFiatPartial</ID>
564-
<ID>PreviewPublic:NumberPadTextField.kt$PreviewMoneyAmountFiatWithValue</ID>
565552
<ID>PreviewPublic:RestoreWalletScreen.kt$RestoreWalletViewPreview</ID>
566553
<ID>PreviewPublic:SplashScreen.kt$SplashScreenPreview</ID>
567554
<ID>PrintStackTrace:ShareSheet.kt$e</ID>
@@ -577,7 +564,6 @@
577564
<ID>TooGenericExceptionCaught:ActivityRepo.kt$ActivityRepo$e: Exception</ID>
578565
<ID>TooGenericExceptionCaught:AddressChecker.kt$AddressChecker$e: Exception</ID>
579566
<ID>TooGenericExceptionCaught:AppViewModel.kt$AppViewModel$e: Exception</ID>
580-
<ID>TooGenericExceptionCaught:AppViewModel.kt$AppViewModel$e: Throwable</ID>
581567
<ID>TooGenericExceptionCaught:ArticleModel.kt$e: Exception</ID>
582568
<ID>TooGenericExceptionCaught:BackupNavSheetViewModel.kt$BackupNavSheetViewModel$e: Throwable</ID>
583569
<ID>TooGenericExceptionCaught:BackupRepo.kt$BackupRepo$e: Throwable</ID>

app/src/main/java/to/bitkit/data/SettingsStore.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import to.bitkit.data.serializers.SettingsSerializer
1111
import to.bitkit.env.Env
1212
import to.bitkit.models.BitcoinDisplayUnit
1313
import to.bitkit.models.CoinSelectionPreference
14-
import to.bitkit.models.ElectrumServer
1514
import to.bitkit.models.PrimaryDisplay
1615
import to.bitkit.models.Suggestion
1716
import to.bitkit.models.TransactionSpeed

app/src/main/java/to/bitkit/env/Env.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import org.lightningdevkit.ldknode.Network
66
import to.bitkit.BuildConfig
77
import to.bitkit.ext.ensureDir
88
import to.bitkit.models.BlocktankNotificationType
9-
import to.bitkit.models.ElectrumProtocol
10-
import to.bitkit.models.ElectrumServer
119
import to.bitkit.models.LnPeer
1210
import to.bitkit.utils.Logger
1311
import java.io.File

app/src/main/java/to/bitkit/models/ElectrumServer.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ data class ElectrumServer(
2424
}
2525

2626
companion object {
27+
const val MAX_VALID_PORT = 65535
28+
2729
fun parse(url: String): ElectrumServer {
2830
val url = url.trim()
2931
require(url.isNotBlank()) { "URL cannot be blank" }
@@ -45,7 +47,7 @@ data class ElectrumServer(
4547
require(host.isNotBlank()) { "Host cannot be blank" }
4648

4749
val port = hostPort[1].trim().toIntOrNull()
48-
require(port != null && port > 0 && port <= 65535) { "Invalid port: ${hostPort[1]}" }
50+
require(port != null && port > 0 && port <= MAX_VALID_PORT) { "Invalid port: ${hostPort[1]}" }
4951

5052
val defaultTcp = ElectrumProtocol.TCP.getDefaultPort()
5153
val defaultSsl = ElectrumProtocol.SSL.getDefaultPort()

app/src/main/java/to/bitkit/repositories/LightningRepo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class LightningRepo @Inject constructor(
159159
}
160160
}
161161

162+
@Suppress("LongMethod", "LongParameterList")
162163
suspend fun start(
163164
walletIndex: Int = 0,
164165
timeout: Duration? = null,

app/src/main/java/to/bitkit/ui/components/Button.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import androidx.compose.foundation.layout.Box
66
import androidx.compose.foundation.layout.Column
77
import androidx.compose.foundation.layout.PaddingValues
88
import androidx.compose.foundation.layout.Row
9-
import androidx.compose.foundation.layout.Spacer
109
import androidx.compose.foundation.layout.fillMaxWidth
11-
import androidx.compose.foundation.layout.height
1210
import androidx.compose.foundation.layout.padding
1311
import androidx.compose.foundation.layout.requiredHeight
1412
import androidx.compose.foundation.layout.size
15-
import androidx.compose.foundation.layout.width
1613
import androidx.compose.material.icons.Icons
1714
import androidx.compose.material.icons.filled.Favorite
1815
import androidx.compose.material.icons.filled.Home
@@ -476,7 +473,6 @@ private fun TertiaryButtonPreview() {
476473
},
477474
)
478475
}
479-
480476
}
481477
}
482478
}

app/src/test/java/to/bitkit/repositories/LightningRepoTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import to.bitkit.data.keychain.Keychain
3131
import to.bitkit.ext.createChannelDetails
3232
import to.bitkit.models.BalanceState
3333
import to.bitkit.models.CoinSelectionPreference
34-
import to.bitkit.models.ElectrumServer
3534
import to.bitkit.models.LnPeer
3635
import to.bitkit.models.NodeLifecycleState
3736
import to.bitkit.models.TransactionSpeed

0 commit comments

Comments
 (0)