From ddade5b41bf1c57fcfa583cc3f1e4e9424a50842 Mon Sep 17 00:00:00 2001 From: Art Shendrik Date: Fri, 28 Jun 2024 17:27:36 +0100 Subject: [PATCH] test: add detekt baseline Signed-off-by: Art Shendrik --- fluxo-io-rad/detekt-baseline.xml | 11 +++++++++++ .../kotlin/fluxo/io/rad/StreamFactoryRad.kt | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 fluxo-io-rad/detekt-baseline.xml diff --git a/fluxo-io-rad/detekt-baseline.xml b/fluxo-io-rad/detekt-baseline.xml new file mode 100644 index 0000000..de56dd6 --- /dev/null +++ b/fluxo-io-rad/detekt-baseline.xml @@ -0,0 +1,11 @@ + + + + + ForbiddenComment:AsyncFileChannelRad.kt$// TODO: Avoid runBlocking usage, block without coroutine suspension (use Semaphore?) + ForbiddenComment:RandomAccessDataInputStream.kt$RandomAccessDataInputStream$// TODO: Can it cause Int overflow? + ForbiddenComment:RandomAccessFileRad.kt$// TODO: Try to avoiding the excessive `filePointer` usages. + ForbiddenComment:ReflectionUtils.kt$// TODO: Complex search as for dynamic methods ? + ForbiddenComment:StreamFactoryRad.kt$// FIXME: Use own BufferedInputStream heir to gain better random access performance? + + diff --git a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/StreamFactoryRad.kt b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/StreamFactoryRad.kt index 54f5311..df9c490 100644 --- a/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/StreamFactoryRad.kt +++ b/fluxo-io-rad/src/commonJvmMain/kotlin/fluxo/io/rad/StreamFactoryRad.kt @@ -199,7 +199,7 @@ private constructor(access: StreamFactoryAccess, offset: Long, size: Long) : if (skipped > 0L) { toSkip -= skipped idles = 0 - } else if (++idles >= 3) { + } else if (++idles >= @Suppress("MagicNumber") 3) { throw EOFException("Can't skip enough bytes ($length). 3 idle skips") } }