Showing 285 of 286 total issues
Client
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Client
{
use ConfigTrait;
use LogTrait;
The class Client has 15 public methods. Consider refactoring Client to keep number of public methods under 10. Open
Open
class Client
{
use ConfigTrait;
use LogTrait;
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $name,
$isBot,
array $channels,
array $users,
array $patterns,
Avoid variables with short names like $id. Configured minimum length is 3. Open
Open
public function byId($id)
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
LoggerInterface $logger,
LoopInterface $eventLoop,
Client $slackClient,
MessageFactory $messageFactory,
PluginManager $pluginManager,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
RealTimeClient $realTimeClient,
Users $users,
Bots $bots,
Channels $channels,
array $config = [],
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $pluginId,
bool $isBot = null,
array $channels,
array $users,
LoggerInterface $logger = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Client $slackClient,
array $data,
string $formattedText,
User $user = null,
Channel $channel)
Expected 1 space after FUNCTION keyword; 0 found Open
Open
$onRejected = $onRejected ?? function($reason) { $this->logRejection($reason); };
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Slack;
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Guzzle;
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Slack;
- Exclude checks
The closing parenthesis of a multi-line function declaration must be on a new line Open
Open
LoggerInterface $log = null)
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
Open
$params['patterns'] = array_map(function($pattern) use ($search, $replace) {
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Slack;
- Exclude checks
Each PHP statement must be on a line by itself Open
Open
$onRejected = $onRejected ?? function($reason) { $this->logRejection($reason); };
- Exclude checks
Blank line found at start of control structure Open
Open
if ($interval = $this->get('connection_monitor.interval')) {
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Plugin;
- Exclude checks
There must be one blank line after the namespace declaration Open
Open
namespace Nopolabs\Yabot\Helpers;
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
Open
{
- Exclude checks