sovereignbot/citadel

View on GitHub

Showing 50 of 284 total issues

Function run has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $channels = $this->db->query("SELECT * FROM killmailPosting");

        foreach ($channels as $channel) {
Severity: Minor
Found in src/Plugins/onTimer/kills.php - About 1 day to fix

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 run has 174 lines of code (exceeds 25 allowed). Consider refactoring.
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..');
Severity: Major
Found in src/Sovereign.php - About 6 hrs to fix

Function run has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $guildID = $this->message->full_channel->guild->id;
        $input = explode(" ", $this->message->content);
        unset($input[0]);
Severity: Minor
Found in src/Plugins/onMessage/config.php - About 5 hrs to fix

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 run has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $guildID = $this->message->full_channel->guild->id;
        $input = explode(" ", $this->message->content);
        unset($input[0]);
Severity: Major
Found in src/Plugins/onMessage/config.php - About 3 hrs to fix

Method run has 74 lines of code (exceeds 25 allowed). Consider refactoring.
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]);
Severity: Major
Found in src/Plugins/onMessage/char.php - About 2 hrs to fix

Function run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $explode = explode(" ", $this->message->content);
        $prefix = $this->channelConfig->prefix;
        $system = isset($explode[0]) ? $explode[0] == "{$prefix}pc" ? "global" : str_replace($prefix, "", $explode[0]) : "global";
Severity: Minor
Found in src/Plugins/onMessage/pc.php - About 2 hrs to fix

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 run has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $pornConfig = @$this->channelConfig->porn;

        // This is one of those plugins that need to be allowed before it works
Severity: Major
Found in src/Plugins/onMessage/porn.php - About 2 hrs to fix

Method run has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $explode = explode(" ", $this->message->content);
        $prefix = $this->channelConfig->prefix;
        $system = isset($explode[0]) ? $explode[0] == "{$prefix}pc" ? "global" : str_replace($prefix, "", $explode[0]) : "global";
Severity: Major
Found in src/Plugins/onMessage/pc.php - About 2 hrs to fix

Function run has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $pornConfig = @$this->channelConfig->porn;

        // This is one of those plugins that need to be allowed before it works
Severity: Minor
Found in src/Plugins/onMessage/porn.php - About 2 hrs to fix

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 run has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $channels = $this->db->query("SELECT * FROM killmailPosting");

        foreach ($channels as $channel) {
Severity: Major
Found in src/Plugins/onTimer/kills.php - About 2 hrs to fix

Method run has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        $explode = explode(" ", $this->message->content);
        unset($explode[0]);
        $name = implode(" ", $explode);
Severity: Major
Found in src/Plugins/onMessage/corp.php - About 2 hrs to fix

File Sovereign.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace Sovereign;


use Discord\Cache\Cache;
Severity: Minor
Found in src/Sovereign.php - About 2 hrs to fix

Function run has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $explode = explode(" ", $this->message->content);
        $cmd = isset($explode[1]) ? $explode[1] : null;
        $plugins = (object)array_merge((array)$this->onMessagePlugins, (array)$this->onVoicePlugins);
Severity: Minor
Found in src/Plugins/onMessage/help.php - About 1 hr to fix

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 boot has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function boot()
    {
        $app = $this->getContainer()->get('app');

        // onMessage plugins
Severity: Minor
Found in src/Service/SystemPluginServiceProvider.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/coinflip.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/pc.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/wolf.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/guilds.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/memory.php - About 1 hr to fix

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

    public function __construct($message, $discord, $channelConfig, $log, $config, $db, $curl, $settings, $permissions, $serverConfig, $users, $extras)
Severity: Major
Found in src/Plugins/onMessage/about.php - About 1 hr to fix
Severity
Category
Status
Source
Language