barbushin/php-imap

View on GitHub

Showing 27 of 41 total issues

Function possiblyGetEmailAndNameFromRecipient has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function possiblyGetEmailAndNameFromRecipient(object $recipient): ?array
    {
        if (isset($recipient->mailbox, $recipient->host)) {
            /** @var string */
            $recipientMailbox = $recipient->mailbox;
Severity: Minor
Found in src/PhpImap/Mailbox.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 __get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __get(string $name): string
    {
        $type = false;
        if ('textPlain' == $name) {
            $type = DataPartInfo::TEXT_PLAIN;
Severity: Minor
Found in src/PhpImap/IncomingMail.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

Method open has 6 arguments (exceeds 5 allowed). Consider refactoring.
Open

        string $mailbox,
        string $username,
        string $password,
        int $options = 0,
        int $n_retries = 0,
Severity: Minor
Found in src/PhpImap/Imap.php - About 35 mins to fix

    Method sort has 6 arguments (exceeds 5 allowed). Consider refactoring.
    Open

            $imap_stream,
            int $criteria,
            bool $reverse,
            int $options,
            string $search_criteria = null,
    Severity: Minor
    Found in src/PhpImap/Imap.php - About 35 mins to fix

      Function sort has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function sort(
              $imap_stream,
              int $criteria,
              bool $reverse,
              int $options,
      Severity: Minor
      Found in src/PhpImap/Imap.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

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

          public static function search(
              $imap_stream,
              string $criteria,
              int $options = SE_FREE,
              string $charset = null,
      Severity: Minor
      Found in src/PhpImap/Imap.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 EnsureRange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function EnsureRange(
              $msg_number,
              string $method,
              int $argument,
              bool $allow_sequence = false
      Severity: Minor
      Found in src/PhpImap/Imap.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