Loco-CTO / Rystal-V6-Experiments

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
9 days ago2 months old
PointSystem.give has a cyclomatic complexity of 18 with "high" risk
109        description=lang[default_language]["points_give_description"],
110    )
111    @auth_guard.check_permissions("point/give")
112    async def give(113        self,
114        interaction: nextcord.Interaction,
115        recipient: nextcord.Member = nextcord.SlashOption(
AuthGuard.check_permissions has a cyclomatic complexity of 21 with "high" risk
132        self.db.execute(statement, tuple(self.command_id_list))
133        self.command_id_list.clear()
134
135    def check_permissions(self, command_id):136        """
137        Decorator to check permissions for a command.
138
Spinner.is_winning has a cyclomatic complexity of 36 with "very-high" risk
 64        return [random.choice(self.options) for _ in range(4)]
 65
 66    @staticmethod
 67    def is_winning(columns: List[str]) -> tuple[Any, bool, bool]: 68        """
 69        Determines if the given columns result in a win.
 70
Spinner.is_winning has a cyclomatic complexity of 19 with "high" risk
 65        return [random.choice(self.options) for _ in range(3)]
 66
 67    @staticmethod
 68    def is_winning(columns: List[str]) -> tuple[Any, bool, bool]: 69        """
 70        Determines if the given columns result in a win.
 71
create_top_songs_poster has a cyclomatic complexity of 16 with "high" risk
 29from PIL import Image, ImageDraw, ImageFont
 30
 31
 32def create_top_songs_poster( 33    songs: List[dict],
 34    title: str,
 35    description: str,