warlof/slackbot

View on GitHub

Showing 26 of 220 total issues

Avoid too many return statements within this method.
Open

                return $this->postTitleRelation($channelId, $corporationId, $titleId);
Severity: Major
Found in src/Http/Controllers/SlackbotJsonController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                        return response()->json(null, 400);
    Severity: Major
    Found in src/Http/Controllers/Services/EventController.php - About 30 mins to fix

      Function callback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function callback(Request $request)
          {
              // get back pending OAuth credentials validation from session
              $oauthCredentials = session()->get('warlof.slackbot.credentials');
      
      
      Severity: Minor
      Found in src/Http/Controllers/Services/OAuthController.php - About 25 mins 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

      Function checkCacheDirectory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function checkCacheDirectory() : bool
          {
              if (!is_dir($this->cache_path) && !@mkdir($this->cache_path, 0775, true))
                  throw new CachePathException('Unable to create cache directory ' . $this->cache_path);
      
      
      Severity: Minor
      Found in src/Repositories/Slack/Cache/FileCache.php - About 25 mins 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

      Function __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct(array $data = null) {
      
              if (!is_null($data)) {
      
                  foreach ($data as $key => $value) {
      Severity: Minor
      Found in src/Repositories/Slack/Containers/Traits/ConstructsContainers.php - About 25 mins 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

      Function handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle() {
      
              logger()->debug('Slack Receptionist - Starting job...');
      
              // resetting cache before queuing jobs
      Severity: Minor
      Found in src/Jobs/ConversationDispatcher.php - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language