refactor(detekt): extract magic-number constants, wrap long lines, drop legit suppressions
Mechanical detekt cleanup across apps/core/infrastructure (behavior-preserving): - MagicNumber 62->10: named constants + removed 'legit' MagicNumber suppressions (Tier level from ordinal, ReplayInferenceProvider CHARS_PER_TOKEN, ConfigLoader DEFAULT_* consts, capability scores, HTTP ranges, column widths, etc.) - MaxLineLength cut to ~0 in production modules (line wraps, no logic change) - Dropped one dead parameter (ConfigLoader.parseArray lineNum) Structural findings (ReturnCount/LongMethod/Complexity/LargeClass) left for a deliberate decomposition pass. Full build + detekt gate green.
This commit is contained in:
+3
-1
@@ -17,6 +17,7 @@ import kotlinx.serialization.json.Json
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
private const val DEFAULT_REQUEST_TIMEOUT_MS = 60_000L
|
||||
private const val ERROR_BODY_PREVIEW_LENGTH = 200
|
||||
|
||||
private fun defaultHttpClient(): HttpClient = HttpClient(CIO) {
|
||||
install(ContentNegotiation) {
|
||||
@@ -125,9 +126,10 @@ class LlamaCppEmbedder(
|
||||
return nestedResult
|
||||
}
|
||||
|
||||
val preview = responseBody.take(ERROR_BODY_PREVIEW_LENGTH)
|
||||
throw IllegalStateException(
|
||||
"Unexpected embedding response shape from $url. " +
|
||||
"Response body (first 200 chars): ${responseBody.take(200)}"
|
||||
"Response body (first $ERROR_BODY_PREVIEW_LENGTH chars): $preview"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -260,7 +260,8 @@ class LlamaCppInferenceProvider(
|
||||
when {
|
||||
line.startsWith("id = ") -> id = line.removePrefix("id = ").trim()
|
||||
line.startsWith("function.name = ") -> name = line.removePrefix("function.name = ").trim()
|
||||
line.startsWith("function.arguments = ") -> arguments = line.removePrefix("function.arguments = ").trim()
|
||||
line.startsWith("function.arguments = ") ->
|
||||
arguments = line.removePrefix("function.arguments = ").trim()
|
||||
}
|
||||
}
|
||||
return if (name != null && arguments != null) {
|
||||
|
||||
Reference in New Issue
Block a user