Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code quality #204

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>TooManyFunctions:A1cConverter.kt$A1cConverter$A1cConverter</ID>
<ID>ComplexCondition:NightscoutMigrator.kt$NightscoutMigrator$url == null &amp;&amp; token == null &amp;&amp; display.isEmpty() &amp;&amp; public.isEmpty()</ID>
<ID>TooManyFunctions:NightscoutDAO.kt$NightscoutDAO</ID>
<ID>NestedBlockDepth:Diacast.kt$Diacast$@Throws(NoSuchEpisodeException::class, IOException::class, FeedException::class) fun getEpisode(episode: Int): SyndEntry</ID>
<ID>LongMethod:Main.kt$Main$@Throws(LoginException::class) @JvmStatic fun main(args: Array&lt;String&gt;)</ID>
<ID>LongMethod:AboutCommand.kt$AboutCommand$override fun execute(event: CommandEvent)</ID>
<ID>ComplexMethod:NightscoutApplicationCommand.kt$NightscoutApplicationCommand$override fun execute(event: SlashCommandInteractionEvent)</ID>
<ID>TooManyFunctions:NightscoutApplicationCommand.kt$NightscoutApplicationCommand : ApplicationCommand</ID>
<ID>TooManyFunctions:NightscoutCommand.kt$NightscoutCommand : DiscordCommand</ID>
<ID>LongMethod:QuoteImportCommand.kt$QuoteImportCommand$private fun parse(event: CommandEvent, args: String = event.args, message: Message = event.message)</ID>
<ID>NestedBlockDepth:BgGraph.kt$BgGraph$fun addEntries(nightscout: NightscoutDTO)</ID>
<ID>TooManyFunctions:NightscoutDTO.kt$NightscoutDTO$Builder</ID>
<ID>ComplexCondition:Nightscout.kt$Nightscout$newestBg != null &amp;&amp; newestBg.delta == null || // Set delta if the original is zero and the pebble endpoint is providing non-zero delta newestBg?.delta?.original == 0.0 &amp;&amp; bgDelta.toDouble() != 0.0</ID>
<ID>TooGenericExceptionThrown:Awyisser.kt$Awyisser$throw Exception("Could not find awyiss image link")</ID>
<ID>SwallowedException:Diacast.kt$Diacast$e: FileNotFoundException</ID>
<ID>SwallowedException:NightscoutAdminDeleteCommand.kt$NightscoutAdminDeleteCommand$ex: NullPointerException</ID>
<ID>SwallowedException:HelpListener.kt$HelpListener$ex: IllegalStateException</ID>
<ID>SwallowedException:NightscoutDTO.kt$NightscoutDTO$e: NoNightscoutDataException</ID>
<ID>MemberNameEqualsClassName:Main.kt$Main$@Throws(LoginException::class) @JvmStatic fun main(args: Array&lt;String&gt;)</ID>
<ID>ReturnCount:QuoteImportCommand.kt$QuoteImportCommand$override fun execute(event: CommandEvent)</ID>
<ID>LoopWithTooManyJumpStatements:HelpListener.kt$HelpListener$for (command in commands) { if (command.isHidden) { continue } val requiredPermissions = command.userPermissions if (requiredPermissions.isEmpty()) { allowedCommands.add(command) continue } var userPermissions: EnumSet&lt;Permission&gt; = Permission.getPermissions(Permission.ALL_PERMISSIONS) if (event.member != null) { userPermissions = event.member.permissions } var userIsAllowedToUseCommand = true for (requiredPermission in requiredPermissions) { if (!userPermissions.contains(requiredPermission)) { userIsAllowedToUseCommand = false } } if (userIsAllowedToUseCommand) { allowedCommands.add(command) } }</ID>
<ID>ReturnCount:UsernameEnforcementListener.kt$UsernameEnforcementListener$private fun enforceRules(username: String, rules: NameRuleDTO, event: GenericGuildMemberEvent)</ID>
<ID>UnusedPrivateMember:PatternsTest.kt$PatternsTest.Companion$@JvmStatic private fun inlineBgProvider()</ID>
<ID>UnusedPrivateMember:PatternsTest.kt$PatternsTest.Companion$@JvmStatic private fun unitBgProvider()</ID>
</CurrentIssues>
</SmellBaseline>
Loading