Showing 284 of 284 total issues
Remove error control operator '@' on line 122. Open
public function run()
{
$explode = explode(" ", $this->message->content);
unset($explode[0]);
$name = implode(" ", $explode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 263. Open
public function run()
{
// Reap the threads!
$this->websocket->loop->addPeriodicTimer(600, function () {
$this->log->addInfo('Restarting the threading pool, to clear out old threads..');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 141. Open
public function run()
{
// Most EVE players on Discord use their ingame name, so lets support @highlights
$explode = explode(" ", $this->message->content);
unset($explode[0]);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '116', column '27'). Open
$this->pool = new \Pool(count($this->onMessage), \Worker::class);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '161', column '31'). Open
$this->pool = new \Pool(count($this->onMessage), \Worker::class);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 117. Open
public function run()
{
$explode = explode(" ", $this->message->content);
unset($explode[0]);
$name = implode(" ", $explode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 121. Open
public function run()
{
$explode = explode(" ", $this->message->content);
unset($explode[0]);
$name = implode(" ", $explode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 383. Open
public function run()
{
// Reap the threads!
$this->websocket->loop->addPeriodicTimer(600, function () {
$this->log->addInfo('Restarting the threading pool, to clear out old threads..');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Remove error control operator '@' on line 111. Open
public function run()
{
$explode = explode(" ", $this->message->content);
unset($explode[0]);
$name = implode(" ", $explode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '117', column '29'). Open
$this->timers = new \Pool(count($this->onTimer), \Worker::class);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 142. Open
public function run()
{
// Most EVE players on Discord use their ingame name, so lets support @highlights
$explode = explode(" ", $this->message->content);
unset($explode[0]);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '91', column '45'). Open
$data = json_decode(json_encode(new \SimpleXMLElement($this->curl->get("http://api.wolframalpha.com/v2/query?appid={$appID}&input={$query}"))), true);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 116. Open
public function run()
{
$explode = explode(" ", $this->message->content);
unset($explode[0]);
$name = implode(" ", $explode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Function set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function set($userID, $name, $lastStatus, $game, $lastSeen, $lastSpoke, $lastWritten)
{
try {
if (isset($lastStatus)) {
$this->db->execute("INSERT INTO users (discordID, nickName, lastStatus) VALUES (:discordID, :nickName, :lastStatus) ON DUPLICATE KEY UPDATE lastStatus = :lastStatus", [":discordID" => $userID, ":nickName" => $name, ":lastStatus" => $lastStatus]);
- Read upRead up
- Create a ticketCreate a ticket
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
The method execute() contains an exit expression. Open
die();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ExitExpression
Since: 0.2
An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.
Example
class Foo {
public function bar($param) {
if ($param === 42) {
exit(23);
}
}
}
Source https://phpmd.org/rules/design.html#exitexpression
Avoid unused parameters such as '$output'. Open
protected function execute(InputInterface $input, OutputInterface $output)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The method __construct has 12 parameters. Consider reducing the number of parameters to less than 10. Open
public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
{
$this->message = $message;
$this->discord = $discord;
$this->channelConfig = $channelConfig;
- Create a ticketCreate a ticket
- Exclude checks
The method __construct has 10 parameters. Consider reducing the number of parameters to less than 10. Open
public function __construct($message, $discord, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users)
{
$this->message = $message;
$this->discord = $discord;
$this->log = $log;
- Create a ticketCreate a ticket
- Exclude checks
The method __construct has 12 parameters. Consider reducing the number of parameters to less than 10. Open
public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
{
$this->message = $message;
$this->discord = $discord;
$this->channelConfig = $channelConfig;
- Create a ticketCreate a ticket
- Exclude checks
The method __construct has 12 parameters. Consider reducing the number of parameters to less than 10. Open
public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
{
$this->message = $message;
$this->discord = $discord;
$this->channelConfig = $channelConfig;
- Create a ticketCreate a ticket
- Exclude checks