slopbrick 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -36,7 +36,7 @@ var VERSION;
36
36
  var init_header = __esm({
37
37
  "src/types/_header.ts"() {
38
38
  "use strict";
39
- VERSION = "0.28.0";
39
+ VERSION = "0.29.0";
40
40
  }
41
41
  });
42
42
 
@@ -30768,6 +30768,115 @@ var init_data_class_defaults_overuse = __esm({
30768
30768
  }
30769
30769
  });
30770
30770
 
30771
+ // src/rules/kotlin/force-unwrap.ts
30772
+ var FORCE_UNWRAP_REGEX, kotlinForceUnwrapRule;
30773
+ var init_force_unwrap = __esm({
30774
+ "src/rules/kotlin/force-unwrap.ts"() {
30775
+ "use strict";
30776
+ init_rule();
30777
+ FORCE_UNWRAP_REGEX = /!!(?=\s*[.\)}\};,\n\[])/g;
30778
+ kotlinForceUnwrapRule = createRule({
30779
+ id: "kotlin/force-unwrap",
30780
+ category: "logic",
30781
+ severity: "medium",
30782
+ aiSpecific: false,
30783
+ description: "!! force-unwrap \u2014 use ?. (safe call) or a proper null check",
30784
+ create(_context) {
30785
+ return {};
30786
+ },
30787
+ analyze(_context, facts) {
30788
+ const issues = [];
30789
+ const source = facts.v2?._source;
30790
+ if (!source) return issues;
30791
+ if (!/\.kts?$/i.test(facts.filePath)) return issues;
30792
+ let m;
30793
+ FORCE_UNWRAP_REGEX.lastIndex = 0;
30794
+ while ((m = FORCE_UNWRAP_REGEX.exec(source)) !== null) {
30795
+ const line = source.slice(0, m.index).split("\n").length;
30796
+ const lineStart = source.lastIndexOf("\n", m.index) + 1;
30797
+ const lineText = source.slice(lineStart, m.index);
30798
+ const quoteCount = (lineText.match(/"/g) || []).length;
30799
+ if (quoteCount % 2 === 1) continue;
30800
+ issues.push({
30801
+ ruleId: "kotlin/force-unwrap",
30802
+ category: "logic",
30803
+ severity: "medium",
30804
+ aiSpecific: false,
30805
+ message: `!! force-unwrap at line ${line}`,
30806
+ line,
30807
+ column: m.index - lineStart + 1,
30808
+ advice: "Use ?. (safe call) with ?: (Elvis) for a default, or a proper when/if check. !! throws NullPointerException at runtime \u2014 it bypasses Kotlin's type system. Reference: kotlin/force-unwrap v0.29."
30809
+ });
30810
+ }
30811
+ return issues;
30812
+ }
30813
+ });
30814
+ }
30815
+ });
30816
+
30817
+ // src/rules/kotlin/hardcoded-credential.ts
30818
+ var KEY_REGEX, VALUE_REGEX, FALSE_POSITIVES, kotlinHardcodedCredentialRule;
30819
+ var init_hardcoded_credential = __esm({
30820
+ "src/rules/kotlin/hardcoded-credential.ts"() {
30821
+ "use strict";
30822
+ init_rule();
30823
+ KEY_REGEX = /\b(api[_-]?key|apikey|secret|token|password|auth|access[_-]?key|client[_-]?secret|private[_-]?key)\b\s*[=:]/i;
30824
+ VALUE_REGEX = /["']([A-Za-z0-9_\-+/=.@*!]{16,})["']/;
30825
+ FALSE_POSITIVES = /* @__PURE__ */ new Set([
30826
+ "passwordless",
30827
+ "tokenize",
30828
+ "tokenizer",
30829
+ "authorizationrequired",
30830
+ "authenticated",
30831
+ "authenticatortoken",
30832
+ "authtoken",
30833
+ "placeholder",
30834
+ // common in test fixtures
30835
+ "changeme"
30836
+ // placeholder, but still suspicious — kept for review
30837
+ ]);
30838
+ kotlinHardcodedCredentialRule = createRule({
30839
+ id: "kotlin/hardcoded-credential",
30840
+ category: "security",
30841
+ severity: "high",
30842
+ aiSpecific: false,
30843
+ description: "Hardcoded credential literal \u2014 use env vars or a secrets manager",
30844
+ create(_context) {
30845
+ return {};
30846
+ },
30847
+ analyze(_context, facts) {
30848
+ const issues = [];
30849
+ const source = facts.v2?._source;
30850
+ if (!source) return issues;
30851
+ if (!/\.kts?$/i.test(facts.filePath)) return issues;
30852
+ const lines = source.split("\n");
30853
+ for (let i = 0; i < lines.length; i++) {
30854
+ const line = lines[i];
30855
+ if (!KEY_REGEX.test(line)) continue;
30856
+ const valueMatch = VALUE_REGEX.exec(line);
30857
+ if (!valueMatch) continue;
30858
+ const value = valueMatch[1];
30859
+ if (FALSE_POSITIVES.has(value.toLowerCase())) continue;
30860
+ if (!/[a-zA-Z]/.test(value) || !/[0-9]/.test(value)) continue;
30861
+ if (value.startsWith("$")) continue;
30862
+ if (/\/test\//i.test(facts.filePath) || /\.test\.kts?$/i.test(facts.filePath)) continue;
30863
+ issues.push({
30864
+ ruleId: "kotlin/hardcoded-credential",
30865
+ category: "security",
30866
+ severity: "high",
30867
+ aiSpecific: false,
30868
+ message: `Hardcoded credential at line ${i + 1}`,
30869
+ line: i + 1,
30870
+ column: 1,
30871
+ advice: "Move the credential to an environment variable, a .env file that is .gitignore'd, or a secrets manager (Vault, AWS Secrets Manager, GCP Secret Manager). Hardcoded credentials are the #1 source of secret leaks on GitHub. Reference: kotlin/hardcoded-credential v0.29 (OWASP A07:2021 \u2014 Identification and Authentication Failures)."
30872
+ });
30873
+ }
30874
+ return issues;
30875
+ }
30876
+ });
30877
+ }
30878
+ });
30879
+
30771
30880
  // src/rules/kotlin/object-singleton-misuse.ts
30772
30881
  var OBJECT_DECL_REGEX, kotlinObjectSingletonMisuseRule;
30773
30882
  var init_object_singleton_misuse = __esm({
@@ -30825,13 +30934,58 @@ var init_object_singleton_misuse = __esm({
30825
30934
  }
30826
30935
  });
30827
30936
 
30937
+ // src/rules/kotlin/println-as-log.ts
30938
+ var PRINTLN_REGEX, REAL_LOGGING_IMPORT_REGEX, kotlinPrintlnAsLogRule;
30939
+ var init_println_as_log = __esm({
30940
+ "src/rules/kotlin/println-as-log.ts"() {
30941
+ "use strict";
30942
+ init_rule();
30943
+ PRINTLN_REGEX = /\bprintln\s*\(/g;
30944
+ REAL_LOGGING_IMPORT_REGEX = /\bimport\s+(?:android\.util\.Log|org\.slf4j\.|io\.github\.oshai\.kotlinlogging|kotlin\.logging|co\.touchlab\.kermit|com\.github\.ajalt\.timber|org\.apache\.logging\.log4j)/;
30945
+ kotlinPrintlnAsLogRule = createRule({
30946
+ id: "kotlin/println-as-log",
30947
+ category: "logic",
30948
+ severity: "low",
30949
+ aiSpecific: false,
30950
+ description: "println() used for logging \u2014 use slf4j, kermit, or android.util.Log",
30951
+ create(_context) {
30952
+ return {};
30953
+ },
30954
+ analyze(_context, facts) {
30955
+ const issues = [];
30956
+ const source = facts.v2?._source;
30957
+ if (!source) return issues;
30958
+ if (!/\.kts?$/i.test(facts.filePath)) return issues;
30959
+ if (/\/test\//i.test(facts.filePath) || /\.test\.kts?$/i.test(facts.filePath)) return issues;
30960
+ if (REAL_LOGGING_IMPORT_REGEX.test(source)) return issues;
30961
+ let m;
30962
+ PRINTLN_REGEX.lastIndex = 0;
30963
+ while ((m = PRINTLN_REGEX.exec(source)) !== null) {
30964
+ const line = source.slice(0, m.index).split("\n").length;
30965
+ issues.push({
30966
+ ruleId: "kotlin/println-as-log",
30967
+ category: "logic",
30968
+ severity: "low",
30969
+ aiSpecific: false,
30970
+ message: `println() as logger at line ${line}`,
30971
+ line,
30972
+ column: 1,
30973
+ advice: "Use a real logging library: slf4j (JVM), android.util.Log (Android), Timber (Android), kermit (multiplatform), or kotlin-logging. println() has no log level, no timestamp, no correlation ID, and cannot be filtered. Reference: kotlin/println-as-log v0.29."
30974
+ });
30975
+ }
30976
+ return issues;
30977
+ }
30978
+ });
30979
+ }
30980
+ });
30981
+
30828
30982
  // src/rules/kotlin/println-debug.ts
30829
- var PRINTLN_REGEX, DEFAULT_THRESHOLD, kotlinPrintlnDebugRule;
30983
+ var PRINTLN_REGEX2, DEFAULT_THRESHOLD, kotlinPrintlnDebugRule;
30830
30984
  var init_println_debug = __esm({
30831
30985
  "src/rules/kotlin/println-debug.ts"() {
30832
30986
  "use strict";
30833
30987
  init_rule();
30834
- PRINTLN_REGEX = /^\s*println\s*\(/gm;
30988
+ PRINTLN_REGEX2 = /^\s*println\s*\(/gm;
30835
30989
  DEFAULT_THRESHOLD = 1;
30836
30990
  kotlinPrintlnDebugRule = createRule({
30837
30991
  id: "kotlin/println-debug",
@@ -30849,8 +31003,8 @@ var init_println_debug = __esm({
30849
31003
  if (!/\.kts?$/i.test(facts.filePath)) return issues;
30850
31004
  const matches = [];
30851
31005
  let m;
30852
- PRINTLN_REGEX.lastIndex = 0;
30853
- while ((m = PRINTLN_REGEX.exec(source)) !== null) {
31006
+ PRINTLN_REGEX2.lastIndex = 0;
31007
+ while ((m = PRINTLN_REGEX2.exec(source)) !== null) {
30854
31008
  matches.push(m.index);
30855
31009
  }
30856
31010
  if (matches.length <= context.threshold) return issues;
@@ -30875,6 +31029,95 @@ var init_println_debug = __esm({
30875
31029
  }
30876
31030
  });
30877
31031
 
31032
+ // src/rules/kotlin/runblocking-misuse.ts
31033
+ var RUN_BLOCKING_REGEX, kotlinRunBlockingMisuseRule;
31034
+ var init_runblocking_misuse = __esm({
31035
+ "src/rules/kotlin/runblocking-misuse.ts"() {
31036
+ "use strict";
31037
+ init_rule();
31038
+ RUN_BLOCKING_REGEX = /\brunBlocking\s*[({]/g;
31039
+ kotlinRunBlockingMisuseRule = createRule({
31040
+ id: "kotlin/runblocking-misuse",
31041
+ category: "perf",
31042
+ severity: "medium",
31043
+ aiSpecific: false,
31044
+ description: "runBlocking { ... } \u2014 blocks the calling thread; use coroutineScope {} or call suspend fun directly",
31045
+ create(_context) {
31046
+ return {};
31047
+ },
31048
+ analyze(_context, facts) {
31049
+ const issues = [];
31050
+ const source = facts.v2?._source;
31051
+ if (!source) return issues;
31052
+ if (!/\.kts?$/i.test(facts.filePath)) return issues;
31053
+ if (/\bfun\s+main\s*\(/.test(source)) return issues;
31054
+ let m;
31055
+ RUN_BLOCKING_REGEX.lastIndex = 0;
31056
+ while ((m = RUN_BLOCKING_REGEX.exec(source)) !== null) {
31057
+ const line = source.slice(0, m.index).split("\n").length;
31058
+ issues.push({
31059
+ ruleId: "kotlin/runblocking-misuse",
31060
+ category: "perf",
31061
+ severity: "medium",
31062
+ aiSpecific: false,
31063
+ message: `runBlocking { ... } at line ${line}`,
31064
+ line,
31065
+ column: 1,
31066
+ advice: 'runBlocking blocks the calling thread, defeating the purpose of coroutines. Use coroutineScope { } for structured concurrency, or call the suspend function directly. The Kotlin coroutines docs: runBlocking "should rarely (if ever) be used outside of main()". Reference: kotlin/runblocking-misuse v0.29.'
31067
+ });
31068
+ }
31069
+ return issues;
31070
+ }
31071
+ });
31072
+ }
31073
+ });
31074
+
31075
+ // src/rules/kotlin/sql-string-concat.ts
31076
+ var SQL_KEYWORD_REGEX, UNSAFE_REGEX, SAFE_REGEX, kotlinSqlStringConcatRule;
31077
+ var init_sql_string_concat = __esm({
31078
+ "src/rules/kotlin/sql-string-concat.ts"() {
31079
+ "use strict";
31080
+ init_rule();
31081
+ SQL_KEYWORD_REGEX = /\b(?:SELECT|INSERT\s+INTO|UPDATE|DELETE\s+FROM|CREATE\s+TABLE|DROP\s+TABLE|ALTER\s+TABLE)\b/i;
31082
+ UNSAFE_REGEX = /(?:\+|\$\{)/;
31083
+ SAFE_REGEX = /(?:PreparedStatement|setParameter|setString|setInt|setLong|bind|:name|:\\?\\?|\?\\s*,)/;
31084
+ kotlinSqlStringConcatRule = createRule({
31085
+ id: "kotlin/sql-string-concat",
31086
+ category: "security",
31087
+ severity: "high",
31088
+ aiSpecific: false,
31089
+ description: "SQL query built via string concat / template \u2014 use PreparedStatement or setParameter()",
31090
+ create(_context) {
31091
+ return {};
31092
+ },
31093
+ analyze(_context, facts) {
31094
+ const issues = [];
31095
+ const source = facts.v2?._source;
31096
+ if (!source) return issues;
31097
+ if (!/\.kts?$/i.test(facts.filePath)) return issues;
31098
+ const lines = source.split("\n");
31099
+ for (let i = 0; i < lines.length; i++) {
31100
+ const line = lines[i];
31101
+ if (!SQL_KEYWORD_REGEX.test(line)) continue;
31102
+ if (!UNSAFE_REGEX.test(line)) continue;
31103
+ if (SAFE_REGEX.test(line)) continue;
31104
+ issues.push({
31105
+ ruleId: "kotlin/sql-string-concat",
31106
+ category: "security",
31107
+ severity: "high",
31108
+ aiSpecific: false,
31109
+ message: `SQL query built via string concat/template at line ${i + 1}`,
31110
+ line: i + 1,
31111
+ column: 1,
31112
+ advice: 'Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concatenation or template interpolation into a SQL query is the canonical SQL-injection pattern \u2014 even "trusted" inputs (signed JWT, internal config) can be influenced by an attacker. Reference: kotlin/sql-string-concat v0.29 (OWASP A03:2021).'
31113
+ });
31114
+ }
31115
+ return issues;
31116
+ }
31117
+ });
31118
+ }
31119
+ });
31120
+
30878
31121
  // src/rules/kotlin/string-concat-loop.ts
30879
31122
  var STRING_CONCAT_REGEX, kotlinStringConcatLoopRule;
30880
31123
  var init_string_concat_loop = __esm({
@@ -40459,7 +40702,7 @@ var init_fatal_error_thrown = __esm({
40459
40702
 
40460
40703
  // src/rules/swift/force-unwrap.ts
40461
40704
  var AS_FORCE_REGEX, ACCESS_FORCE_REGEX, TRY_FORCE_REGEX, swiftForceUnwrapRule;
40462
- var init_force_unwrap = __esm({
40705
+ var init_force_unwrap2 = __esm({
40463
40706
  "src/rules/swift/force-unwrap.ts"() {
40464
40707
  "use strict";
40465
40708
  init_rule();
@@ -46320,8 +46563,13 @@ var init_builtins = __esm({
46320
46563
  init_struct_tag_inconsistency();
46321
46564
  init_coroutine_global_scope();
46322
46565
  init_data_class_defaults_overuse();
46566
+ init_force_unwrap();
46567
+ init_hardcoded_credential();
46323
46568
  init_object_singleton_misuse();
46569
+ init_println_as_log();
46324
46570
  init_println_debug();
46571
+ init_runblocking_misuse();
46572
+ init_sql_string_concat();
46325
46573
  init_string_concat_loop();
46326
46574
  init_gap_monopoly();
46327
46575
  init_math_element_uniformity();
@@ -46362,7 +46610,7 @@ var init_builtins = __esm({
46362
46610
  init_target_blank_no_noopener();
46363
46611
  init_unsafe_html_render();
46364
46612
  init_fatal_error_thrown();
46365
- init_force_unwrap();
46613
+ init_force_unwrap2();
46366
46614
  init_implicitly_unwrapped_optional();
46367
46615
  init_print_debug();
46368
46616
  init_strong_self_capture();
@@ -46449,8 +46697,13 @@ var init_builtins = __esm({
46449
46697
  goStructTagInconsistencyRule,
46450
46698
  kotlinCoroutineGlobalScopeRule,
46451
46699
  kotlinDataClassDefaultsOveruseRule,
46700
+ kotlinForceUnwrapRule,
46701
+ kotlinHardcodedCredentialRule,
46452
46702
  kotlinObjectSingletonMisuseRule,
46703
+ kotlinPrintlnAsLogRule,
46453
46704
  kotlinPrintlnDebugRule,
46705
+ kotlinRunBlockingMisuseRule,
46706
+ kotlinSqlStringConcatRule,
46454
46707
  kotlinStringConcatLoopRule,
46455
46708
  gapMonopolyRule,
46456
46709
  mathElementUniformityRule,
@@ -50974,6 +51227,86 @@ var init_signal_strength = __esm({
50974
51227
  _v9Precision: 0.125,
50975
51228
  defaultOff: true
50976
51229
  },
51230
+ "kotlin/sql-string-concat": {
51231
+ recall: 469e-5,
51232
+ fpRate: 63e-4,
51233
+ ratio: 0.75,
51234
+ precision: 0.0556,
51235
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51236
+ verdict: "DORMANT",
51237
+ _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.75 (DORMANT). 18 fires total \u2014 modern Kotlin mostly uses ORMs (Room/Exposed) so SQL string concat is rare in both arms. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: rule is loadable but invisible by default until v0.30 re-calibration with a larger pos arm.",
51238
+ aiSpecific: false,
51239
+ _v9Verdict: "DORMANT",
51240
+ _v9Lift: 0.75,
51241
+ _v9Recall: 469e-5,
51242
+ _v9FpRate: 63e-4,
51243
+ _v9Precision: 0.0556,
51244
+ defaultOff: true
51245
+ },
51246
+ "kotlin/hardcoded-credential": {
51247
+ recall: 0,
51248
+ fpRate: 0,
51249
+ ratio: 0,
51250
+ precision: 0,
51251
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51252
+ verdict: "DORMANT",
51253
+ _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). 0 fires. The 16-char value threshold + letters+digit heuristic is too strict for the corpus; real-world secrets are in env vars / config files, not source. INSUFFICIENT_DATA: needs different corpus (CI configs, .env samples). defaultOff: loadable but invisible by default.",
51254
+ aiSpecific: false,
51255
+ _v9Verdict: "DORMANT",
51256
+ _v9Lift: 0,
51257
+ _v9Recall: 0,
51258
+ _v9FpRate: 0,
51259
+ _v9Precision: 0,
51260
+ defaultOff: true
51261
+ },
51262
+ "kotlin/runblocking-misuse": {
51263
+ recall: 0.10798,
51264
+ fpRate: 0.21534,
51265
+ ratio: 0.5,
51266
+ precision: 0.0381,
51267
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51268
+ verdict: "DORMANT",
51269
+ _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.50 \u2014 fires 2x more on pre-2022 (neg) than post-2024 (pos). Era-confounded: pre-2022 Kotlin coroutines used runBlocking more; modern Kotlin uses coroutineScope. Same direction as kotlin/coroutine-global-scope (0.09). defaultOff: loadable but invisible by default until v0.30 re-calibration.",
51270
+ aiSpecific: false,
51271
+ _v9Verdict: "DORMANT",
51272
+ _v9Lift: 0.5,
51273
+ _v9Recall: 0.10798,
51274
+ _v9FpRate: 0.21534,
51275
+ _v9Precision: 0.0381,
51276
+ defaultOff: true
51277
+ },
51278
+ "kotlin/println-as-log": {
51279
+ recall: 0.08451,
51280
+ fpRate: 0.04596,
51281
+ ratio: 1.84,
51282
+ precision: 0.1268,
51283
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51284
+ verdict: "OK",
51285
+ _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=1.84 (\u22651.5) \u2014 first rule in this entire session with a positive direction! Fires 1.84x more on post-2024 AI/demos than pre-2022 production. Precision=12.7% (below 50% USEFUL threshold); verdict=OK. The signal is real: post-2024 Kotlin code (especially AI-generated examples) uses println for output; pre-2022 production code uses slf4j/kermit. INSUFFICIENT_DATA: pos arm only 213 files. defaultOff: still set to true (verdict is OK but precision is below 50% \u2014 the guardrail expects OK/USEFUL rules to be defaultOff:false only when calibrated with a meaningful pos arm).",
51286
+ aiSpecific: false,
51287
+ _v9Verdict: "OK",
51288
+ _v9Lift: 1.84,
51289
+ _v9Recall: 0.08451,
51290
+ _v9FpRate: 0.04596,
51291
+ _v9Precision: 0.1268,
51292
+ defaultOff: true
51293
+ },
51294
+ "kotlin/force-unwrap": {
51295
+ recall: 0.11737,
51296
+ fpRate: 0.33284,
51297
+ ratio: 0.35,
51298
+ precision: 0.0271,
51299
+ lastCalibratedAt: "2026-07-03T00:00:00Z",
51300
+ verdict: "DORMANT",
51301
+ _calibrationNote: "v0.29: v9 Kotlin calibration (2698 neg, 213 pos). ratio=0.35 \u2014 fires 3x more on pre-2022 (neg) than post-2024 (pos). Era-confounded: pre-2022 Kotlin code uses !! freely; modern Kotlin relies on ?./?: and Result<T> wrappers. Stronger era signal than runblocking-misuse. defaultOff: loadable but invisible by default.",
51302
+ aiSpecific: false,
51303
+ _v9Verdict: "DORMANT",
51304
+ _v9Lift: 0.35,
51305
+ _v9Recall: 0.11737,
51306
+ _v9FpRate: 0.33284,
51307
+ _v9Precision: 0.0271,
51308
+ defaultOff: true
51309
+ },
50977
51310
  "swift/force-unwrap": {
50978
51311
  recall: 0,
50979
51312
  fpRate: 0,
@@ -59186,6 +59519,12 @@ var RULE_HINTS = {
59186
59519
  "kotlin/println-debug": "Replace with `Timber.d(...)` or `android.util.Log`. `println` writes to stdout with no level, no redaction, can't be silenced in release builds. (v0.24.0 \u2014 DORMANT.)",
59187
59520
  "kotlin/object-singleton-misuse": "Replace with a class injected via DI, a Repository, or `MutableStateFlow`. The `object` keyword gives a thread-safe singleton handle, NOT thread-safe `var` fields. (v0.24.0 \u2014 DORMANT.)",
59188
59521
  "kotlin/string-concat-loop": "Wrap the loop in `buildString { append(...) }` or hoist a `StringBuilder`. Kotlin can't optimize `s = s + x` in a loop \u2014 O(n\xB2). (v0.24.0 \u2014 DORMANT.)",
59522
+ // v0.29.0 — non-AI Kotlin rules (DORMANT until larger pos arm)
59523
+ "kotlin/sql-string-concat": "Use a PreparedStatement (JDBC), setParameter() (Exposed), or an ORM (Room, jOOQ). String concat or template interpolation into a SQL query is the canonical SQL-injection pattern. OWASP A03:2021. (v0.29.0 \u2014 DORMANT.)",
59524
+ "kotlin/hardcoded-credential": "Move the credential to an env var, a .env file (gitignored), or a secrets manager (Vault, AWS Secrets Manager). Hardcoded creds are the #1 secret-leak vector. OWASP A07:2021. (v0.29.0 \u2014 DORMANT.)",
59525
+ "kotlin/runblocking-misuse": "Use coroutineScope { } for structured concurrency, or call the suspend function directly. runBlocking blocks the calling thread and is rarely correct outside main(). (v0.29.0 \u2014 DORMANT.)",
59526
+ "kotlin/println-as-log": "Use slf4j (JVM), android.util.Log (Android), Timber, kermit, or kotlin-logging. println has no log level, no timestamp, no correlation ID. (v0.29.0 \u2014 OK; first positive-signal rule in v9 history, ratio 1.84.)",
59527
+ "kotlin/force-unwrap": "Use ?. (safe call) with ?: (Elvis) for a default, or a proper when/if check. !! throws NullPointerException at runtime and bypasses Kotlin's type system. (v0.29.0 \u2014 DORMANT, era-confounded.)",
59189
59528
  // v0.24.0 — Swift rules (DORMANT until v9 Swift corpus calibration)
59190
59529
  "swift/force-unwrap": "Replace with the safe form: `as?` + guard/if let, `try?`, or `guard let x = optional else { return }`. `!` crashes unconditionally in release. (v0.24.0 \u2014 DORMANT.)",
59191
59530
  "swift/print-debug": "Replace with `Logger(subsystem:..., category:...).info(...)` (os.log). `print` writes to stdout with no level and no redaction. (v0.24.0 \u2014 DORMANT.)",