Showing 41 of 41 total issues
Function onMessage
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public function onMessage(Event $event)
{
$data = $event->getData();
$mode = $this->parseMessageMode(@$data['targetmode']);
if (@$data['invokername'] == $this->name || @$data['invokeruid'] == 'serveradmin') {
- Read upRead up
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
File TeamSpeak3Bot.php
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: Admin
* Date: 25/07/2016
TeamSpeak3Bot
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class TeamSpeak3Bot
{
/**
* @var string
*/
Function isTriggered
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function isTriggered()
{
if (!isset($this->info['text'])) {
$this->sendUsage();
- Read upRead up
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
Method isTriggered
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isTriggered()
{
if (!isset($this->info['text'])) {
$this->sendUsage();
Method isTriggered
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isTriggered()
{
if (!isset($this->info['text'])) {
$this->sendOutput($this->CONFIG['usage']);
Function loadPlugin
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function loadPlugin($configFile)
{
$config = $this->parseConfigFile($configFile);
$config['configFile'] = $configFile;
- Read upRead up
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
Method isTriggered
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isTriggered()
{
if($this->CONFIG['enabled'] === false) {
return;
}
Function onEvent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function onEvent(Event $event)
{
$data = $event->getData();
if (@$data['client_type'] == 1) {
return;
- Read upRead up
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
Function notify
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function notify()
{
foreach ($this->teamSpeak3Bot->node->clientList() as $client) {
if ($client["client_type"] == 1) {
continue;
- Read upRead up
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
Method loadPlugin
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadPlugin($configFile)
{
$config = $this->parseConfigFile($configFile);
$config['configFile'] = $configFile;
Method onMessage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onMessage(Event $event)
{
$data = $event->getData();
$mode = $this->parseMessageMode(@$data['targetmode']);
if (@$data['invokername'] == $this->name || @$data['invokeruid'] == 'serveradmin') {
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config, $teamSpeak3Bot)
{
$this->time = Carbon::now();
$this->nextRunTime = Carbon::now();
$this->teamSpeak3Bot = $teamSpeak3Bot;
Function isTriggered
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isTriggered()
{
if (!isset($this->info['text'])) {
$this->sendOutput($this->CONFIG['usage']);
- Read upRead up
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
Function isTriggered
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isTriggered()
{
if (!isset($this->info['text'])) {
$this->sendOutput($this->CONFIG['usage']);
- Read upRead up
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
Function isTriggered
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isTriggered()
{
if($this->CONFIG['enabled'] === false) {
return;
}
- Read upRead up
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
Method isTriggered
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isTriggered()
{
if (empty($this->CONFIG['email'])) {
$this->sendOutput("[%s] No email entry in configuration, API requires an email for registration.", __CLASS__);
return;
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($config, $teamSpeak3Bot)
{
$this->time = Carbon::now();
$this->nextRunTime = Carbon::now();
$this->teamSpeak3Bot = $teamSpeak3Bot;
- Read upRead up
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
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($username, $password, $host = '127.0.0.1', $port = 10011, $name = 'Nimda', $serverPort = 9987, $timeout = 10)
{
$this->carbon = new Carbon;
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && posix_getuid() === 0 && !Self::$config['ignoreWarnings']) {
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($config, $teamSpeak3Bot)
{
$this->teamSpeak3Bot = $teamSpeak3Bot;
foreach ($config as $name => $value) {