diff --git a/config/spotbugs/excludeFilter.xml b/config/spotbugs/excludeFilter.xml index 49bdd81..21512f0 100644 --- a/config/spotbugs/excludeFilter.xml +++ b/config/spotbugs/excludeFilter.xml @@ -1,8 +1,8 @@ + xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/4.0.0/spotbugs/etc/findbugsfilter.xsd"> @@ -22,6 +22,7 @@ + diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 2f5da4b..51a20bd 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -2,21 +2,24 @@ - ComplexMethod:Links.kt$Links$commandResponse + ComplexCondition:UrlMgr.kt$UrlMgr$Ignore.isNotIgnored(sender) && (cmds.size == 1 || !cmds[1].contains(bot.nick) || !cmds[1].endsWith(" (${Ignore.IGNORE_CMD}")) + ComplexMethod:Posting.kt$Posting$commandResponse ComplexMethod:UrlMgr.kt$UrlMgr$commandResponse ComplexMethod:View.kt$View$commandResponse - LongMethod:Links.kt$Links$commandResponse + LongMethod:Posting.kt$Posting$commandResponse LongMethod:UrlMgr.kt$UrlMgr$commandResponse LongMethod:View.kt$View$commandResponse LongParameterList:AbstractCommand.kt$AbstractCommand$( bot: Mobibot, sender: String, login: String, args: String, isOp: Boolean, isPrivate: Boolean ) LoopWithTooManyJumpStatements:View.kt$View$while (i < max) { entry = getEntry(i) if (lcArgs.isNotEmpty()) { if (entry.link.toLowerCase().contains(lcArgs) || entry.title.toLowerCase().contains(lcArgs) || entry.nick.toLowerCase().contains(lcArgs)) { if (sent > maxEntries) { bot.send( sender, "To view more, try: " + Utils.bold("${bot.nick}: $command ${i + 1} $lcArgs"), isPrivate ) break } bot.send(sender, EntriesUtils.buildLink(i, entry, true), isPrivate) sent++ } } else { if (sent > maxEntries) { bot.send( sender, "To view more, try: " + Utils.bold("${bot.nick}: $command ${i + 1}"), isPrivate ) break } bot.send(sender, EntriesUtils.buildLink(i, entry, true), isPrivate) sent++ } i++ } - MagicNumber:Comments.kt$Comments$3 + MagicNumber:Comment.kt$Comment$3 MagicNumber:Cycle.kt$Cycle$10 MagicNumber:Recap.kt$Recap.Companion$10 + MagicNumber:UrlMgr.kt$UrlMgr$1000L + MagicNumber:UrlMgr.kt$UrlMgr$60L MagicNumber:View.kt$View$8 - NestedBlockDepth:Comments.kt$Comments$commandResponse + NestedBlockDepth:Comment.kt$Comment$commandResponse NestedBlockDepth:Ignore.kt$Ignore$commandResponse - NestedBlockDepth:Links.kt$Links$commandResponse + NestedBlockDepth:Posting.kt$Posting$commandResponse NestedBlockDepth:UrlMgr.kt$UrlMgr$commandResponse NestedBlockDepth:View.kt$View$commandResponse diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt index b67fc18..db3ab27 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/Ignore.kt @@ -45,7 +45,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() { } } - override val command = IGNORE + override val command = IGNORE_CMD override val help = listOf( Utils.bold("To check your ignore status:"), Utils.helpIndent("%s: $command"), @@ -57,7 +57,7 @@ class Ignore(defaultIgnore: String) : AbstractCommand() { override val isVisible = true companion object { - const val IGNORE = "ignore" + const val IGNORE_CMD = "ignore" private val ignored = HashSet() @JvmStatic diff --git a/src/main/java/net/thauvin/erik/mobibot/commands/links/UrlMgr.kt b/src/main/java/net/thauvin/erik/mobibot/commands/links/UrlMgr.kt index c1a3b37..bbd8c7a 100644 --- a/src/main/java/net/thauvin/erik/mobibot/commands/links/UrlMgr.kt +++ b/src/main/java/net/thauvin/erik/mobibot/commands/links/UrlMgr.kt @@ -131,7 +131,7 @@ class UrlMgr(defaultTags: String, keywords: String) : AbstractCommand() { if (Ignore.isNotIgnored(sender) && (cmds.size == 1 || !cmds[1].contains(bot.nick) - || !cmds[1].endsWith(" (${Ignore.IGNORE}"))) { + || !cmds[1].endsWith(" (${Ignore.IGNORE_CMD}"))) { val link = cmds[0].trim() var isBackup = false val dupIndex: Int = findDupEntry(link)