Showing 5 of 5 total issues
File guild_sounds.py
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import random
import time
from typing import Optional
File admin.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import io
import random
import subprocess
import sys
import textwrap
File fun.py
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import asyncio
import os
import pickle
import random
import time
Consider simplifying this complex logical expression. Open
Open
if self.user_joined_channel(before, after) and not member.voice.afk:
await self.play_join_sound(member, old_vc)
elif old_vc and self.old_voice_channel_has_no_people(old_vc):
await self.disconnect_from_voice(old_vc)
elif old_vc and self.user_left_channel(before, after) and before.channel == old_vc.channel:
Function mixed_lang_to_katakana
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def mixed_lang_to_katakana(text: List[str]) -> List[str]:
out = []
for word in text:
match = jpattern.match(word)
if match:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"