kj415j45/kjBot

View on GitHub
module/osu/mp/tools.php

Summary

Maintainability
A
0 mins
Test Coverage

Method drawMatchEvent has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

function drawMatchEvent($event, $users){
    $game = $event->game;
    $beatmap = $game->beatmap;
    $scores = $game->scores;
    $here = __DIR__.'/';
Severity: Major
Found in module/osu/mp/tools.php - About 2 hrs to fix

    Method drawPlayerMatchScore has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

    function drawPlayerMatchScore($score, $user, $mode){
        $here = __DIR__.'/';
        $outside = $here.'../';
        $exo2_italic = $outside.'Exo2-Italic.ttf';
        $exo2_bold = $outside.'Exo2-Bold.ttf';
    Severity: Major
    Found in module/osu/mp/tools.php - About 2 hrs to fix

      Function drawMatchEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Wontfix

      function drawMatchEvent($event, $users){
          $game = $event->game;
          $beatmap = $game->beatmap;
          $scores = $game->scores;
          $here = __DIR__.'/';
      Severity: Minor
      Found in module/osu/mp/tools.php - About 1 hr to fix

      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"

      Further reading

      Avoid too many return statements within this method.
      Wontfix

                          else return -1;
      Severity: Major
      Found in module/osu/mp/tools.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Wontfix

                    return '';
        Severity: Major
        Found in module/osu/mp/tools.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Wontfix

                      return sendImg(getCache($Event['message_id']));
          Severity: Major
          Found in module/osu/mp/tools.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Wontfix

                return $eventResult;
            Severity: Major
            Found in module/osu/mp/tools.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Wontfix

                          return $time." {$users[$event->user_id]->username} 离开了房间";
              Severity: Major
              Found in module/osu/mp/tools.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Wontfix

                                    return $scoreB->score - $scoreA->score;
                Severity: Major
                Found in module/osu/mp/tools.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Wontfix

                              return $time.' 房间被关闭';
                  Severity: Major
                  Found in module/osu/mp/tools.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Wontfix

                                        if($redScore > $blueScore)return 1;
                    Severity: Major
                    Found in module/osu/mp/tools.php - About 30 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status