aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--detekt-baselines/app.xml13
-rw-r--r--detekt-baselines/autofill-parser.xml1
-rw-r--r--detekt-baselines/random.xml12
3 files changed, 8 insertions, 18 deletions
diff --git a/detekt-baselines/app.xml b/detekt-baselines/app.xml
index eb5e9396..2b6993f8 100644
--- a/detekt-baselines/app.xml
+++ b/detekt-baselines/app.xml
@@ -7,13 +7,6 @@
<ID>ComplexCondition:GitServerConfigActivity.kt$GitServerConfigActivity$localDir.exists() &amp;&amp; localDirFiles.isNotEmpty() &amp;&amp; !(localDirFiles.size == 1 &amp;&amp; localDirFiles[0].name == ".git")</ID>
<ID>ComplexCondition:PasswordCreationActivity.kt$PasswordCreationActivity$(!editing || (editing &amp;&amp; suggestedName != file.nameWithoutExtension)) &amp;&amp; file.exists()</ID>
<ID>ComplexCondition:PasswordStore.kt$PasswordStore$(keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_F &amp;&amp; event.isCtrlPressed) &amp;&amp; !searchItem.isActionViewExpanded</ID>
- <ID>ComplexMethod:AutofillFilterView.kt$AutofillFilterView$private fun bindUI()</ID>
- <ID>ComplexMethod:GitCommandExecutor.kt$GitCommandExecutor$suspend fun execute(): Result&lt;Unit, Throwable&gt;</ID>
- <ID>ComplexMethod:GitServerConfigActivity.kt$GitServerConfigActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
- <ID>ComplexMethod:Migrations.kt$private fun migrateToGitUrlBasedConfig(sharedPrefs: SharedPreferences, gitSettings: GitSettings)</ID>
- <ID>ComplexMethod:PasswordCreationActivity.kt$PasswordCreationActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
- <ID>ComplexMethod:PasswordCreationActivity.kt$PasswordCreationActivity$private fun encrypt()</ID>
- <ID>ComplexMethod:PasswordFragment.kt$PasswordFragment$private fun initializePasswordList()</ID>
<ID>EmptyFunctionBlock:BasicBottomSheet.kt$BasicBottomSheet.&lt;no name provided&gt;${}</ID>
<ID>EmptyFunctionBlock:ItemCreationBottomSheet.kt$ItemCreationBottomSheet.&lt;no name provided&gt;${}</ID>
<ID>EmptyFunctionBlock:PasswordFragment.kt$PasswordFragment.&lt;no name provided&gt;.&lt;no name provided&gt;${}</ID>
@@ -60,7 +53,6 @@
<ID>MatchingDeclarationName:AutofillViewUtils.kt$DatasetMetadata</ID>
<ID>MaxLineLength:BaseGitActivity.kt$BaseGitActivity$"The server does not support multiple Git operations per SSH session. Please try again, a slower fallback mode will be used."</ID>
<ID>MaxLineLength:BaseGitActivity.kt$BaseGitActivity$"WARNING: The remote host key has changed. If this is expected, please go to Git server settings and clear the saved host key."</ID>
- <ID>MaxLineLength:DecryptScreen.kt$ |otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&amp;issuer=ACME%20Co&amp;algorithm=SHA1&amp;digits=6&amp;period=30</ID>
<ID>NestedBlockDepth:FieldItemAdapter.kt$FieldItemAdapter.FieldItemViewHolder$fun bind(fieldItem: FieldItem, showPassword: Boolean, copyTextToClipboard: (String?) -&gt; Unit)</ID>
<ID>NestedBlockDepth:GitOperation.kt$GitOperation$suspend fun executeAfterAuthentication(authMode: AuthMode): Result&lt;Unit, Throwable&gt;</ID>
<ID>NestedBlockDepth:PasswordExportService.kt$PasswordExportService$override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int</ID>
@@ -74,9 +66,10 @@
<ID>ReturnCount:ClipboardService.kt$ClipboardService$override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int</ID>
<ID>ReturnCount:Extensions.kt$fun File.contains(other: File): Boolean</ID>
<ID>ReturnCount:GitOperation.kt$GitOperation$suspend fun executeAfterAuthentication(authMode: AuthMode): Result&lt;Unit, Throwable&gt;</ID>
- <ID>ReturnCount:GitSettings.kt$GitSettings$fun updateConnectionSettingsIfValid( newAuthMode: AuthMode, newUrl: String, newBranch: String ): UpdateConnectionSettingsResult</ID>
+ <ID>ReturnCount:GitSettings.kt$GitSettings$fun updateConnectionSettingsIfValid( newAuthMode: AuthMode, newUrl: String ): UpdateConnectionSettingsResult</ID>
<ID>ReturnCount:OreoAutofillService.kt$OreoAutofillService$override fun onFillRequest( request: FillRequest, cancellationSignal: CancellationSignal, callback: FillCallback )</ID>
<ID>ReturnCount:OreoAutofillService.kt$OreoAutofillService$override fun onSaveRequest(request: SaveRequest, callback: SaveCallback)</ID>
+ <ID>ReturnCount:PasswordRepository.kt$PasswordRepository$fun getCurrentBranch(): String?</ID>
<ID>ReturnCount:PasswordStore.kt$PasswordStore$override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean</ID>
<ID>ReturnCount:ShortcutHandler.kt$ShortcutHandler$fun addPinnedShortcut(item: PasswordItem, intent: Intent)</ID>
<ID>SpreadOperator:Api30AutofillResponseBuilder.kt$Api30AutofillResponseBuilder$(*ignoredIds.toTypedArray())</ID>
@@ -103,6 +96,6 @@
<ID>UseCheckOrError:SshKey.kt$SshKey$throw IllegalStateException("SSH key does not exist in Keystore")</ID>
<ID>UseCheckOrError:SshKeyGenActivity.kt$SshKeyGenActivity$throw IllegalStateException("Impossible key type selection")</ID>
<ID>UtilityClassWithPublicConstructor:AutofillMatcher.kt$AutofillMatcher</ID>
- <ID>WildcardImport:GitOperation.kt$import app.passwordstore.util.auth.BiometricAuthenticator.Result.*</ID>
+ <ID>WildcardImport:Application.kt$import androidx.appcompat.app.AppCompatDelegate.*</ID>
</CurrentIssues>
</SmellBaseline>
diff --git a/detekt-baselines/autofill-parser.xml b/detekt-baselines/autofill-parser.xml
index aea58ad6..9a7f95f7 100644
--- a/detekt-baselines/autofill-parser.xml
+++ b/detekt-baselines/autofill-parser.xml
@@ -2,7 +2,6 @@
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
- <ID>ComplexMethod:AutofillStrategyDsl.kt$AutofillRule$fun match( allPassword: List&lt;FormField&gt;, allUsername: List&lt;FormField&gt;, allOtp: List&lt;FormField&gt;, singleOriginMode: Boolean, isManualRequest: Boolean ): AutofillScenario&lt;FormField&gt;?</ID>
<ID>DestructuringDeclarationWithTooManyEntries:AutofillStrategyDsl.kt$AutofillRule$(type, matcher, optional, matchHidden)</ID>
<ID>ForbiddenComment:AutofillFormParser.kt$AutofillFormParser$// TODO: Support WebViews in apps via Digital Asset Links</ID>
<ID>ForbiddenComment:AutofillStrategy.kt$// TODO: Introduce a custom fill/generate/update flow for this scenario</ID>
diff --git a/detekt-baselines/random.xml b/detekt-baselines/random.xml
index 345a7f94..d4728260 100644
--- a/detekt-baselines/random.xml
+++ b/detekt-baselines/random.xml
@@ -1,12 +1,10 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" ?>
<SmellBaseline>
- <ManuallySuppressedIssues/>
+ <ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
- <ID>ComplexCondition:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$!candidate.flags.hasFlag(nextBasicType) || (isStartOfPart &amp;&amp; candidate.flags hasFlag NOT_FIRST) || // Don't let a diphthong that starts with a vowel follow a vowel. (previousFlags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag DIPHTHONG) || // Don't add multi-character candidates if we would go over the targetLength. (password.length + candidate.length > targetLength) || (pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; candidate.isAmbiguous)</ID>
- <ID>ComplexMethod:PasswordGenerator.kt$PasswordGenerator$@Throws(PasswordGeneratorException::class) public fun generate(passwordOptions: List&lt;PasswordOption>, length: Int = DEFAULT_LENGTH): String</ID>
- <ID>ComplexMethod:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$fun generate(targetLength: Int, pwFlags: Int): String?</ID>
+ <ID>ComplexCondition:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$!candidate.flags.hasFlag(nextBasicType) || (isStartOfPart &amp;&amp; candidate.flags hasFlag NOT_FIRST) || // Don't let a diphthong that starts with a vowel follow a vowel. (previousFlags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag DIPHTHONG) || // Don't add multi-character candidates if we would go over the targetLength. (password.length + candidate.length &gt; targetLength) || (pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; candidate.isAmbiguous)</ID>
<ID>LongMethod:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$fun generate(targetLength: Int, pwFlags: Int): String?</ID>
- <ID>LoopWithTooManyJumpStatements:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$while (password.length &lt; targetLength) { // First part: Add a single letter or pronounceable pair of letters in varying case. val candidate = elements.secureRandomElement() // Reroll if the candidate does not fulfill the current requirements. if ( !candidate.flags.hasFlag(nextBasicType) || (isStartOfPart &amp;&amp; candidate.flags hasFlag NOT_FIRST) || // Don't let a diphthong that starts with a vowel follow a vowel. (previousFlags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag DIPHTHONG) || // Don't add multi-character candidates if we would go over the targetLength. (password.length + candidate.length > targetLength) || (pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; candidate.isAmbiguous) ) { continue } // At this point the candidate could be appended to the password, but we still have // to determine the case. If no upper case characters are required, we don't add // any. val useUpperIfBothCasesAllowed = (isStartOfPart || candidate.flags hasFlag CONSONANT) &amp;&amp; secureRandomBiasedBoolean(20) password += if ( pwFlags hasFlag PasswordGenerator.UPPERS &amp;&amp; (!(pwFlags hasFlag PasswordGenerator.LOWERS) || useUpperIfBothCasesAllowed) ) { candidate.upperCase } else { candidate.lowerCase } // We ensured above that we will not go above the target length. check(password.length &lt;= targetLength) if (password.length == targetLength) break // Second part: Add digits and symbols with a certain probability (if requested) if // they would not directly follow the first character in a pronounceable part. if ( !isStartOfPart &amp;&amp; pwFlags hasFlag PasswordGenerator.DIGITS &amp;&amp; secureRandomBiasedBoolean(30) ) { var randomDigit: Char do { randomDigit = secureRandomNumber(10).toString(10).first() } while ( pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; randomDigit in PasswordGenerator.AMBIGUOUS_STR ) password += randomDigit // Begin a new pronounceable part after every digit. isStartOfPart = true nextBasicType = if (secureRandomBoolean()) VOWEL else CONSONANT previousFlags = 0 continue } if ( !isStartOfPart &amp;&amp; pwFlags hasFlag PasswordGenerator.SYMBOLS &amp;&amp; secureRandomBiasedBoolean(20) ) { var randomSymbol: Char do { randomSymbol = PasswordGenerator.SYMBOLS_STR.secureRandomCharacter() } while ( pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; randomSymbol in PasswordGenerator.AMBIGUOUS_STR ) password += randomSymbol // Continue the password generation as if nothing was added. } // Third part: Determine the basic type of the next character depending on the letter // we just added. nextBasicType = when { candidate.flags.hasFlag(CONSONANT) -> VOWEL previousFlags.hasFlag(VOWEL) || candidate.flags.hasFlag(DIPHTHONG) || secureRandomBiasedBoolean(60) -> CONSONANT else -> VOWEL } previousFlags = candidate.flags isStartOfPart = false }</ID>
+ <ID>LoopWithTooManyJumpStatements:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$while (password.length &lt; targetLength) { // First part: Add a single letter or pronounceable pair of letters in varying case. val candidate = elements.secureRandomElement() // Reroll if the candidate does not fulfill the current requirements. if ( !candidate.flags.hasFlag(nextBasicType) || (isStartOfPart &amp;&amp; candidate.flags hasFlag NOT_FIRST) || // Don't let a diphthong that starts with a vowel follow a vowel. (previousFlags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag VOWEL &amp;&amp; candidate.flags hasFlag DIPHTHONG) || // Don't add multi-character candidates if we would go over the targetLength. (password.length + candidate.length &gt; targetLength) || (pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; candidate.isAmbiguous) ) { continue } // At this point the candidate could be appended to the password, but we still have // to determine the case. If no upper case characters are required, we don't add // any. val useUpperIfBothCasesAllowed = (isStartOfPart || candidate.flags hasFlag CONSONANT) &amp;&amp; secureRandomBiasedBoolean(20) password += if ( pwFlags hasFlag PasswordGenerator.UPPERS &amp;&amp; (!(pwFlags hasFlag PasswordGenerator.LOWERS) || useUpperIfBothCasesAllowed) ) { candidate.upperCase } else { candidate.lowerCase } // We ensured above that we will not go above the target length. check(password.length &lt;= targetLength) if (password.length == targetLength) break // Second part: Add digits and symbols with a certain probability (if requested) if // they would not directly follow the first character in a pronounceable part. if ( !isStartOfPart &amp;&amp; pwFlags hasFlag PasswordGenerator.DIGITS &amp;&amp; secureRandomBiasedBoolean(30) ) { var randomDigit: Char do { randomDigit = secureRandomNumber(10).toString(10).first() } while ( pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; randomDigit in PasswordGenerator.AMBIGUOUS_STR ) password += randomDigit // Begin a new pronounceable part after every digit. isStartOfPart = true nextBasicType = if (secureRandomBoolean()) VOWEL else CONSONANT previousFlags = 0 continue } if ( !isStartOfPart &amp;&amp; pwFlags hasFlag PasswordGenerator.SYMBOLS &amp;&amp; secureRandomBiasedBoolean(20) ) { var randomSymbol: Char do { randomSymbol = PasswordGenerator.SYMBOLS_STR.secureRandomCharacter() } while ( pwFlags hasFlag PasswordGenerator.NO_AMBIGUOUS &amp;&amp; randomSymbol in PasswordGenerator.AMBIGUOUS_STR ) password += randomSymbol // Continue the password generation as if nothing was added. } // Third part: Determine the basic type of the next character depending on the letter // we just added. nextBasicType = when { candidate.flags.hasFlag(CONSONANT) -&gt; VOWEL previousFlags.hasFlag(VOWEL) || candidate.flags.hasFlag(DIPHTHONG) || secureRandomBiasedBoolean(60) -&gt; CONSONANT else -&gt; VOWEL } previousFlags = candidate.flags isStartOfPart = false }</ID>
<ID>MagicNumber:PasswordGenerator.kt$PasswordGenerator$1000</ID>
<ID>MagicNumber:PasswordGenerator.kt$PasswordGenerator$6</ID>
<ID>MagicNumber:RandomNumberGenerator.kt$100</ID>
@@ -16,6 +14,6 @@
<ID>MagicNumber:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$30</ID>
<ID>MagicNumber:RandomPhonemesGenerator.kt$RandomPhonemesGenerator$60</ID>
<ID>ReturnCount:PasswordGenerator.kt$PasswordGenerator$internal fun isValidPassword(password: String, pwFlags: Int): Boolean</ID>
- <ID>ThrowsCount:PasswordGenerator.kt$PasswordGenerator$@Throws(PasswordGeneratorException::class) public fun generate(passwordOptions: List&lt;PasswordOption>, length: Int = DEFAULT_LENGTH): String</ID>
+ <ID>ThrowsCount:PasswordGenerator.kt$PasswordGenerator$@Throws(PasswordGeneratorException::class) public fun generate(passwordOptions: List&lt;PasswordOption&gt;, length: Int = DEFAULT_LENGTH): String</ID>
</CurrentIssues>
</SmellBaseline>