Client
has 32 functions (exceeds 20 allowed). Consider refactoring.
class Client
{
use ConfigTrait;
use LogTrait;
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring.
string $name,
$isBot,
array $channels,
array $users,
array $patterns,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring.
LoggerInterface $logger,
LoopInterface $eventLoop,
Client $slackClient,
MessageFactory $messageFactory,
PluginManager $pluginManager,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring.
RealTimeClient $realTimeClient,
Users $users,
Bots $bots,
Channels $channels,
array $config = [],
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring.
string $pluginId,
bool $isBot = null,
array $channels,
array $users,
LoggerInterface $logger = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring.
Client $slackClient,
array $data,
string $formattedText,
User $user = null,
Channel $channel)
Avoid too many return
statements within this method.
return $this->matchPatterns($message);
Function methodMatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
protected function methodMatch(Message $message)
{
foreach ($this->getMethodMatchers() as $methodMatcher) {
if ($matches = $methodMatcher->matches($message)) {
Function updatePrefixes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
protected function updatePrefixes($authedUsername)
{
$updatedPriorityMap = [];
foreach ($this->getPriorityMap() as $priority => $prefixMap) {
$updatedPrefixMap = [];
Function dispatchToPrefixes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
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'");