Strimoid/Strimoid

View on GitHub

Showing 32 of 559 total issues

Function getUrlAttribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUrlAttribute(): ?string
    {
        $url = null;
        $params = null;

Severity: Minor
Found in app/Models/Notification.php - About 55 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 index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function index(Request $request)
    {
        $folderName = request('folder');
        $groupName = $request->has('group') ? shadow(request('group')) : 'all';

Severity: Minor
Found in app/Api/Controllers/EntryController.php - About 45 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 __invoke has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __invoke(DocumentParsedEvent $e): void
    {
        $walker = $e->getDocument()->walker();

        while ($event = $walker->next()) {
Severity: Minor
Found in app/Markdown/Processor/ImageLinkProcessor.php - About 35 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

Avoid too many return statements within this method.
Open

            return 'g/' . $matches[1];
Severity: Major
Found in app/utils.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return '@' . $matches[1];
    Severity: Major
    Found in app/utils.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return !in_array($value, $names);
      Severity: Major
      Found in app/Providers/ValidatorServiceProvider.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return 'u/' . $matches[1];
        Severity: Major
        Found in app/utils.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $body;
          Severity: Major
          Found in app/utils.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return '[g/' . str_replace('_', '\_', $urlname) . '](/g/' . $urlname . ')';
            Severity: Major
            Found in app/utils.php - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return
              Severity: Major
              Found in resources/assets/js/lara.js - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return '[@' . str_replace('_', '\_', (string) $target->name) . '](/u/' . $target->name . ')';
                Severity: Major
                Found in app/utils.php - About 30 mins to fix

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

                      protected function processData($data): ?string
                      {
                          if (array_key_exists('html', $data)) {
                              return $data['html'];
                          }
                  Severity: Minor
                  Found in app/Helpers/OEmbed.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