nopolabs/yabot

View on GitHub

Showing 10 of 286 total issues

Client has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class Client
{
use ConfigTrait;
use LogTrait;
 
 
Severity: Minor
Found in src/Slack/Client.php - About 4 hrs to fix

    Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    string $name,
    $isBot,
    array $channels,
    array $users,
    array $patterns,
    Severity: Major
    Found in src/Plugin/MethodMatcher.php - About 50 mins to fix

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      LoggerInterface $logger,
      LoopInterface $eventLoop,
      Client $slackClient,
      MessageFactory $messageFactory,
      PluginManager $pluginManager,
      Severity: Minor
      Found in src/Yabot.php - About 45 mins to fix

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        RealTimeClient $realTimeClient,
        Users $users,
        Bots $bots,
        Channels $channels,
        array $config = [],
        Severity: Minor
        Found in src/Slack/Client.php - About 45 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          string $pluginId,
          bool $isBot = null,
          array $channels,
          array $users,
          LoggerInterface $logger = null)
          Severity: Minor
          Found in src/Plugin/PluginMatcher.php - About 35 mins to fix

            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            Client $slackClient,
            array $data,
            string $formattedText,
            User $user = null,
            Channel $channel)
            Severity: Minor
            Found in src/Message/Message.php - About 35 mins to fix

              Avoid too many return statements within this method.
              Open

              return $this->matchPatterns($message);
              Severity: Major
              Found in src/Helpers/MatcherTrait.php - About 30 mins to fix

                Function methodMatch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                protected function methodMatch(Message $message)
                {
                foreach ($this->getMethodMatchers() as $methodMatcher) {
                /** @var MethodMatcher $methodMatcher */
                if ($matches = $methodMatcher->matches($message)) {
                Severity: Minor
                Found in src/Plugin/PluginTrait.php - About 25 mins to fix

                Function updatePrefixes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                protected function updatePrefixes($authedUsername)
                {
                $updatedPriorityMap = [];
                foreach ($this->getPriorityMap() as $priority => $prefixMap) {
                $updatedPrefixMap = [];
                Severity: Minor
                Found in src/Plugin/PluginManager.php - About 25 mins to fix

                Function dispatchToPrefixes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                protected function dispatchToPrefixes(array $prefixMap, Message $message, string $text)
                {
                foreach ($prefixMap as $prefix => $plugins) {
                if ($matches = $this->matchesPrefix($prefix, $text)) {
                $this->debug("Dispatching prefix '$prefix'");
                Severity: Minor
                Found in src/Plugin/PluginManager.php - About 25 mins to fix
                Severity
                Category
                Status
                Source
                Language