YetiForceCompany/YetiForceCRM

View on GitHub
modules/OSSMail/models/Record.php

Summary

Maintainability
F
6 days
Test Coverage

File Record.php has 575 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * OSSMail record model file.
 *
 * @package Model
Severity: Major
Found in modules/OSSMail/models/Record.php - About 1 day to fix

    Function initMailPart has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    Open

        protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
        {
            if ($partNum) {
                \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
    Severity: Minor
    Found in modules/OSSMail/models/Record.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

    Function imapConnect has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
        {
            \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
            if (!$config) {
                $config = self::loadRoundcubeConfig();
    Severity: Minor
    Found in modules/OSSMail/models/Record.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

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

        protected static function unfoldFlowed(string $text, bool $delSp = false): string
        {
            $text = preg_split('/\r?\n/', $text);
            $last = -1;
            $qLevel = 0;
    Severity: Minor
    Found in modules/OSSMail/models/Record.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 imapConnect has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
        {
            \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
            if (!$config) {
                $config = self::loadRoundcubeConfig();
    Severity: Major
    Found in modules/OSSMail/models/Record.php - About 3 hrs to fix

      Method initMailPart has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
          {
              if ($partNum) {
                  \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                  $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
      Severity: Major
      Found in modules/OSSMail/models/Record.php - About 3 hrs to fix

        The class OSSMail_Record_Model has an overall complexity of 167 which is very high. The configured complexity threshold is 50.
        Open

        class OSSMail_Record_Model extends Vtiger_Record_Model
        {
            /** @var int Mailbox Status: Active */
            const MAIL_BOX_STATUS_ACTIVE = 0;
        
        
        Severity: Minor
        Found in modules/OSSMail/models/Record.php by phpmd

        Function updateMailBoxCounter has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function updateMailBoxCounter(array $users): array
            {
                if (empty($users)) {
                    return [];
                }
        Severity: Minor
        Found in modules/OSSMail/models/Record.php - About 3 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 getMail has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
            {
                if (!$msgno) {
                    \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                    $msgno = imap_msgno($mbox, $id);
        Severity: Minor
        Found in modules/OSSMail/models/Record.php - About 2 hrs to fix

          Method unfoldFlowed has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected static function unfoldFlowed(string $text, bool $delSp = false): string
              {
                  $text = preg_split('/\r?\n/', $text);
                  $last = -1;
                  $qLevel = 0;
          Severity: Minor
          Found in modules/OSSMail/models/Record.php - About 1 hr to fix

            Method updateMailBoxCounter has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function updateMailBoxCounter(array $users): array
                {
                    if (empty($users)) {
                        return [];
                    }
            Severity: Minor
            Found in modules/OSSMail/models/Record.php - About 1 hr to fix

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

                  public static function getMailsFromIMAP(?int $user = null)
                  {
                      $accounts = self::getAccountsList(false, true);
                      $mails = [];
                      $mailLimit = 5;
              Severity: Minor
              Found in modules/OSSMail/models/Record.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

              Method imapConnect has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
              Severity: Major
              Found in modules/OSSMail/models/Record.php - About 50 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                    if (isset($text[$last]) && $line && !$qLevel
                                        && '-- ' !== $text[$last]
                                        && isset($text[$last][\strlen($text[$last]) - 1]) && ' ' === $text[$last][\strlen($text[$last]) - 1]
                                    ) {
                                        if ($delSp) {
                Severity: Major
                Found in modules/OSSMail/models/Record.php - About 40 mins to fix

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

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
                      {
                          if (!$msgno) {
                              \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                              $msgno = imap_msgno($mbox, $id);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.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 getFullName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getFullName($text)
                      {
                          $return = '';
                          foreach ($text as $row) {
                              if ('' != $return) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.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

                  The method imapConnect() has an NPath complexity of 1898208. The configured NPath complexity threshold is 200.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                      {
                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                          if (!$config) {
                              $config = self::loadRoundcubeConfig();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  NPathComplexity

                  Since: 0.1

                  The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                  Example

                  class Foo {
                      function bar() {
                          // lots of complicated code
                      }
                  }

                  Source https://phpmd.org/rules/codesize.html#npathcomplexity

                  The method imapConnect() has 101 lines of code. Current threshold is set to 100. Avoid really long methods.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                      {
                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                          if (!$config) {
                              $config = self::loadRoundcubeConfig();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  The method initMailPart() has an NPath complexity of 2484000. The configured NPath complexity threshold is 200.
                  Open

                      protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
                      {
                          if ($partNum) {
                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  NPathComplexity

                  Since: 0.1

                  The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                  Example

                  class Foo {
                      function bar() {
                          // lots of complicated code
                      }
                  }

                  Source https://phpmd.org/rules/codesize.html#npathcomplexity

                  The method unfoldFlowed() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
                  Open

                      protected static function unfoldFlowed(string $text, bool $delSp = false): string
                      {
                          $text = preg_split('/\r?\n/', $text);
                          $last = -1;
                          $qLevel = 0;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CyclomaticComplexity

                  Since: 0.1

                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                  Example

                  // Cyclomatic Complexity = 11
                  class Foo {
                  1   public function example() {
                  2       if ($a == $b) {
                  3           if ($a1 == $b1) {
                                  fiddle();
                  4           } elseif ($a2 == $b2) {
                                  fiddle();
                              } else {
                                  fiddle();
                              }
                  5       } elseif ($c == $d) {
                  6           while ($c == $d) {
                                  fiddle();
                              }
                  7        } elseif ($e == $f) {
                  8           for ($n = 0; $n < $h; $n++) {
                                  fiddle();
                              }
                          } else {
                              switch ($z) {
                  9               case 1:
                                      fiddle();
                                      break;
                  10              case 2:
                                      fiddle();
                                      break;
                  11              case 3:
                                      fiddle();
                                      break;
                                  default:
                                      fiddle();
                                      break;
                              }
                          }
                      }
                  }

                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                  The method imapConnect() has a Cyclomatic Complexity of 32. The configured cyclomatic complexity threshold is 10.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                      {
                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                          if (!$config) {
                              $config = self::loadRoundcubeConfig();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CyclomaticComplexity

                  Since: 0.1

                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                  Example

                  // Cyclomatic Complexity = 11
                  class Foo {
                  1   public function example() {
                  2       if ($a == $b) {
                  3           if ($a1 == $b1) {
                                  fiddle();
                  4           } elseif ($a2 == $b2) {
                                  fiddle();
                              } else {
                                  fiddle();
                              }
                  5       } elseif ($c == $d) {
                  6           while ($c == $d) {
                                  fiddle();
                              }
                  7        } elseif ($e == $f) {
                  8           for ($n = 0; $n < $h; $n++) {
                                  fiddle();
                              }
                          } else {
                              switch ($z) {
                  9               case 1:
                                      fiddle();
                                      break;
                  10              case 2:
                                      fiddle();
                                      break;
                  11              case 3:
                                      fiddle();
                                      break;
                                  default:
                                      fiddle();
                                      break;
                              }
                          }
                      }
                  }

                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                  The method initMailPart() has a Cyclomatic Complexity of 45. The configured cyclomatic complexity threshold is 10.
                  Open

                      protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
                      {
                          if ($partNum) {
                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CyclomaticComplexity

                  Since: 0.1

                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                  Example

                  // Cyclomatic Complexity = 11
                  class Foo {
                  1   public function example() {
                  2       if ($a == $b) {
                  3           if ($a1 == $b1) {
                                  fiddle();
                  4           } elseif ($a2 == $b2) {
                                  fiddle();
                              } else {
                                  fiddle();
                              }
                  5       } elseif ($c == $d) {
                  6           while ($c == $d) {
                                  fiddle();
                              }
                  7        } elseif ($e == $f) {
                  8           for ($n = 0; $n < $h; $n++) {
                                  fiddle();
                              }
                          } else {
                              switch ($z) {
                  9               case 1:
                                      fiddle();
                                      break;
                  10              case 2:
                                      fiddle();
                                      break;
                  11              case 3:
                                      fiddle();
                                      break;
                                  default:
                                      fiddle();
                                      break;
                              }
                          }
                      }
                  }

                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                  Refactor this function to reduce its Cognitive Complexity from 77 to the 15 allowed.
                  Open

                      protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Refactor this function to reduce its Cognitive Complexity from 37 to the 15 allowed.
                  Open

                      protected static function unfoldFlowed(string $text, bool $delSp = false): string
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
                  Open

                      public static function updateMailBoxCounter(array $users): array
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Refactor this function to reduce its Cognitive Complexity from 54 to the 15 allowed.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                  See

                  Avoid using undefined variables such as '$config' which will lead to PHP notices.
                  Open

                          return $configMail + $config;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  UndefinedVariable

                  Since: 2.8.0

                  Detects when a variable is used that has not been defined before.

                  Example

                  class Foo
                  {
                      private function bar()
                      {
                          // $message is undefined
                          echo $message;
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                  The class OSSMail_Record_Model has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
                  Open

                  class OSSMail_Record_Model extends Vtiger_Record_Model
                  {
                      /** @var int Mailbox Status: Active */
                      const MAIL_BOX_STATUS_ACTIVE = 0;
                  
                  
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  The method getAccountsList has a boolean flag argument $onlyMy, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  The method getMail has a boolean flag argument $fullMode, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Missing class import via use statement (line '319', column '15').
                  Open

                          $mail = new OSSMail_Mail_Model();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  The method getAccountsList has a boolean flag argument $password, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Missing class import via use statement (line '782', column '19').
                  Open

                              $result = (new \App\Db\Query())
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '107', column '15').
                  Open

                                  throw new \App\Exceptions\AppException('Unable to find a Roundcube version');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  The method getAccountsList has a boolean flag argument $user, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  The method unfoldFlowed has a boolean flag argument $delSp, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      protected static function unfoldFlowed(string $text, bool $delSp = false): string
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Missing class import via use statement (line '65', column '17').
                  Open

                          $query = (new \App\Db\Query())->from('roundcube_users');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '372', column '16').
                  Open

                          $user = (new \App\Db\Query())->from('roundcube_users')->where(['user_id' => $userid, 'crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]])->one();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  The method getAccountsList has a boolean flag argument $onlyActive, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  The method imapConnect has a boolean flag argument $dieOnError, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Missing class import via use statement (line '237', column '15').
                  Open

                                  throw new \App\Exceptions\AppException('IMAP_ERROR' . ': ' . imap_last_error());
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Missing class import via use statement (line '260', column '15').
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  The method getMail has a boolean flag argument $msgno, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                                      \App\Log::beginProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method imapConnect uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              if ($account) {
                                  $status = self::MAIL_BOX_STATUS_ACTIVE == $account['crm_status'] ? self::MAIL_BOX_STATUS_INVALID_ACCESS : self::MAIL_BOX_STATUS_BLOCKED_TEMP;
                                  [$date] = explode('||', $account['crm_error'] ?: '');
                                  if (empty($date) || false === strtotime($date)) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Utils' in method 'getFolders'.
                  Open

                                  $name = \App\Utils::convertCharacterEncoding($name, 'UTF7-IMAP', 'UTF-8');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                              \App\Log::trace('Exit OSSMail_Record_Model::imapConnect() method ...');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('reply_toaddress', \App\Purifier::purify($mail->getEmail('reply_to')));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method unfoldFlowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                      } else {
                                          $text[$idx] = $line;
                                          $last = $idx;
                                      }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                                      \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'updateMailBoxCounter'.
                  Open

                                              \App\Log::endProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Config' in method 'loadRoundcubeConfig'.
                  Open

                          $configMail = \App\Config::module('OSSMail');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                          \App\Log::trace('imap_open(({' . static::$imapConnectMailbox . ", $user , '****'. $options, $maxRetries, " . var_export($params, true) . ') method ...');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'updateMailBoxCounter'.
                  Open

                                          \App\Log::error($th->__toString());
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method getBodyAttach uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              foreach ($struct->parts as $partNum => $partStructure) {
                                  $mail = self::initMailPart($mbox, $mail, $partStructure, $partNum + 1);
                              }
                          }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'initMailPart'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $mail = self::initMailPart($mbox, $mail, $subPartStructure, $partNum . '.' . ($subPartNum + 1));
                                  }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method unfoldFlowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  if ('-- ' == $line) {
                                      $last = $idx;
                                  } else {
                                      if (isset($line[0]) && ' ' === $line[0]) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                                      \App\Log::endProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                              \App\Log::error('Error OSSMail_Record_Model::imapConnect(' . static::$imapConnectMailbox . '): ' . imap_last_error());
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class 'Settings_Mail_Config_Model' in method 'updateMailBoxCounter'.
                  Open

                          $config = Settings_Mail_Config_Model::getConfig('mailIcon');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\TextUtils' in method 'getMail'.
                  Open

                          $mail->set('firstLetterBg', strtoupper(\App\TextUtils::textTruncate(trim(strip_tags(App\Purifier::purify($mail->getEmail('from')))), 1, false)));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('subject', isset($header->subject) ? \App\TextUtils::textTruncate(\App\Purifier::purify(self::decodeText($header->subject)), 65535, false) : '');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method imapConnect uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $sslMode = '';
                          }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'initMailPart'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'initMailPart'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'updateMailBoxCounter'.
                  Open

                                              \App\Log::beginProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method unfoldFlowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $last = $idx;
                                  }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\User' in method 'getAccountsList'.
                  Open

                              $userModel = \App\User::getCurrentUserModel();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      $params[$paramName] = $param->value;
                                  }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'getMailsFromIMAP'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method loadRoundcubeConfig uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  throw new \App\Exceptions\AppException('Unable to find a Roundcube version');
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('message_id', $messageId ? \App\Purifier::purifyByType($messageId, 'MailId') : '');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method decodeText uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $text .= iconv($charset, 'UTF-8', $row->text);
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid assigning values to variables in if clauses and the like (line '619', column '8').
                  Open

                      protected static function unfoldFlowed(string $text, bool $delSp = false): string
                      {
                          $text = preg_split('/\r?\n/', $text);
                          $last = -1;
                          $qLevel = 0;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

                  Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                  Avoid using static access to class '\App\Log' in method 'getMailsFromIMAP'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('to_email', \App\Purifier::purify($mail->getEmail('to')));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'initMailPart'.
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              \App\Log::beginProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                              $data = $orgData = imap_body($mbox, $mail['id'], FT_UID | FT_PEEK);
                              \App\Log::endProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                          }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid assigning values to variables in if clauses and the like (line '263', column '9').
                  Open

                      public static function updateMailBoxCounter(array $users): array
                      {
                          if (empty($users)) {
                              return [];
                          }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

                  Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('from_email', \App\Purifier::purify($mail->getEmail('from')));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getBodyAttach'.
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getBodyAttach'.
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $fileName = !empty($params['filename']) ? $params['filename'] : $params['name'];
                                  $fileName = self::decodeText($fileName);
                                  $fileName = self::decodeRFC2231($fileName);
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class 'App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('firstLetterBg', strtoupper(\App\TextUtils::textTruncate(trim(strip_tags(App\Purifier::purify($mail->getEmail('from')))), 1, false)));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\TextUtils' in method 'getMail'.
                  Open

                          $mail->set('subject', isset($header->subject) ? \App\TextUtils::textTruncate(\App\Purifier::purify(self::decodeText($header->subject)), 65535, false) : '');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                                  \App\Log::endProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('bcc_email', \App\Purifier::purify($mail->getEmail('bcc')));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method getFullName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $return .= self::decodeText($row->personal) . ' - ' . $row->mailbox . '@' . $row->host;
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method unfoldFlowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                  } else {
                                      if (isset($line[0]) && ' ' === $line[0]) {
                                          $line = substr($line, 1);
                                      }
                                      if (isset($text[$last]) && $line && !$qLevel
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid assigning values to variables in if clauses and the like (line '154', column '8').
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                      {
                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                          if (!$config) {
                              $config = self::loadRoundcubeConfig();
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  IfStatementAssignment

                  Since: 2.7.0

                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($foo = 'bar') { // possible typo
                              // ...
                          }
                          if ($baz = 0) { // always false
                              // ...
                          }
                      }
                  }

                  Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                  The method updateMailBoxCounter uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $counter[$user] = $all[$user]['num'] ?? 0;
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                                  \App\Log::beginProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class 'App\Config' in method 'getSiteUrl'.
                  Open

                          $site_URL = App\Config::main('site_URL');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method getMailsFromIMAP uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $account = reset($accounts);
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'imapConnect'.
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\TextUtils' in method 'imapConnect'.
                  Open

                                          'crm_error' => \App\TextUtils::textTruncate($date . '||' . imap_last_error(), 250),
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method updateMailBoxCounter uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                                      } else {
                                          $dbCommand->update('u_#__mail_quantities', ['date' => date('Y-m-d H:i:s')], ['userid' => $user])->execute();
                                      }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Purifier' in method 'getMail'.
                  Open

                          $mail->set('cc_email', \App\Purifier::purify($mail->getEmail('cc')));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class 'OSSMailScanner_Record_Model' in method 'imapConnect'.
                  Open

                  }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\App\Log' in method 'getMail'.
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $encodedData = iconv($params['charset'], 'UTF-8', $data);
                              }
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method initMailPart uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  if (!isset($mail['textHtml'])) {
                                      $mail['textHtml'] = '';
                                  }
                                  if ($data && '<' !== $data[0] && '<' === $orgData[0]) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Define a constant instead of duplicating this literal "filename" 6 times.
                  Open

                          $attachmentId = $partStructure->ifid ? trim($partStructure->id, ' <>') : (isset($params['filename']) || isset($params['name']) ? random_int(0, PHP_INT_MAX) . random_int(0, PHP_INT_MAX) : null);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "Y-m-d H:i:s" 6 times.
                  Open

                                      $date = date('Y-m-d H:i:s');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "mail_host" 4 times.
                  Open

                                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "attachments" 9 times.
                  Open

                              $mail->set('attachments', $structure['attachment']);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "charset" 5 times.
                  Open

                          if (!empty($params['charset']) && 'utf-8' !== strtolower($params['charset'])) {
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "u_#__mail_quantities" 4 times.
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "user_id" 8 times.
                  Open

                              $query->andWhere(['user_id' => $user]);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "Mail|IMAP" 24 times.
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "textPlain" 8 times.
                  Open

                          $body = (!empty($mail['textPlain'])) ? $mail['textPlain'] : $body;
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "isHtml" 3 times.
                  Open

                              $mail->set('isHtml', $structure['isHtml']);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "crm_error" 3 times.
                  Open

                                      ->update('roundcube_users', ['crm_error' => null, 'crm_status' => self::MAIL_BOX_STATUS_ACTIVE], ['user_id' => $account['user_id']])
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "UTF-8" 4 times.
                  Open

                                  $text .= iconv($charset, 'UTF-8', $row->text);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "actions" 3 times.
                  Open

                              $row['actions'] = empty($row['actions']) ? [] : explode(',', $row['actions']);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "utf-8" 3 times.
                  Open

                                  $text .= mb_convert_encoding($row->text, 'utf-8', $charset);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "userid" 5 times.
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "crm_status" 5 times.
                  Open

                              $query->where(['crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]]);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "attachment" 4 times.
                  Open

                              $mail->set('attachments', $structure['attachment']);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "textHtml" 6 times.
                  Open

                          $body = (!empty($mail['textHtml'])) ? $mail['textHtml'] : $body;
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "INBOX" 4 times.
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "password" 4 times.
                  Open

                              $query->andWhere(['<>', 'password', '']);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "username" 3 times.
                  Open

                                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "scheme" 3 times.
                  Open

                              $sslMode = (isset($parseHost['scheme']) && \in_array($parseHost['scheme'], ['ssl', 'imaps', 'tls'])) ? $parseHost['scheme'] : null;
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "roundcube_users" 6 times.
                  Open

                          $query = (new \App\Db\Query())->from('roundcube_users');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by sonar-php

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Avoid unused local variables such as '$hostDomain'.
                  Open

                              foreach ($hosts as $configHost => $hostDomain) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

                  Detects when a local variable is declared and/or assigned, but not used.

                  Example

                  class Foo {
                      public function doSomething()
                      {
                          $i = 5; // Unused
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                  Avoid unused parameters such as '$msgno'.
                  Open

                      public static function getBodyAttach($mbox, $id, $msgno)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  UnusedFormalParameter

                  Since: 0.2

                  Avoid passing parameters to methods or constructors and then not using those parameters.

                  Example

                  class Foo
                  {
                      private function bar($howdy)
                      {
                          // $howdy is not used
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                  Avoid unused local variables such as '$config'.
                  Open

                          return $configMail + $config;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  UnusedLocalVariable

                  Since: 0.2

                  Detects when a local variable is declared and/or assigned, but not used.

                  Example

                  class Foo {
                      public function doSomething()
                      {
                          $i = 5; // Unused
                      }
                  }

                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Default value for int $msgno can't be false
                  Open

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db\Query::from
                  Open

                          $user = (new \App\Db\Query())->from('roundcube_users')->where(['user_id' => $userid, 'crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]])->one();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method trace from undeclared class \App\Log
                  Open

                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \FT_PEEK
                  Open

                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                                              \App\Log::beginProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \FT_UID
                  Open

                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 1 (mbox) is \IMAP\Connection|false but \OSSMail_Record_Model::getMail() takes resource defined at /code/modules/OSSMail/models/Record.php:297
                  Open

                                  $mail = self::getMail($imap, false, $i);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method error from undeclared class \App\Log
                  Open

                                      \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \FT_PEEK
                  Open

                              $data = $orgData = imap_body($mbox, $mail['id'], FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
                  Open

                              $imap = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', true, [], $account);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 2 (id) is false but \OSSMail_Record_Model::getMail() takes int defined at /code/modules/OSSMail/models/Record.php:297
                  Open

                                  $mail = self::getMail($imap, false, $i);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db\Query::from
                  Open

                              $result = (new \App\Db\Query())
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Variable $config is undeclared
                  Open

                          return $configMail + $config;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                                      \App\Log::beginProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Invalid offset "crm_status" of array type array{}
                  Open

                                  $status = self::MAIL_BOX_STATUS_ACTIVE == $account['crm_status'] ? self::MAIL_BOX_STATUS_INVALID_ACCESS : self::MAIL_BOX_STATUS_BLOCKED_TEMP;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 2 (sequence) is int but \imap_fetch_overview() takes string
                  Open

                              $msgs = imap_fetch_overview($mbox, $msgno);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                                  \App\Log::beginProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \FT_UID
                  Open

                          $struct = imap_fetchstructure($mbox, $id, FT_UID);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 3 (section) is int but \imap_fetchbody() takes string
                  Open

                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 1 (stream_id) is \IMAP\Connection but \imap_list() takes resource
                  Open

                              $list = imap_list($mbox, $ref, '*');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
                  Open

                              $userModel = \App\User::getCurrentUserModel();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method trace from undeclared class \App\Log
                  Open

                          \App\Log::trace('imap_open(({' . static::$imapConnectMailbox . ", $user , '****'. $options, $maxRetries, " . var_export($params, true) . ') method ...');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                                      \App\Log::endProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Invalid offset "crm_error" of array type array{}
                  Open

                                  [$date] = explode('||', $account['crm_error'] ?: '');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \RCUBE_INSTALL_PATH
                  Open

                          if (!\defined('RCMAIL_VERSION') && file_exists(RCUBE_INSTALL_PATH . '/program/include/iniset.php')) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \SA_UNSEEN
                  Open

                                              $info = imap_status($mbox, static::$imapConnectMailbox, SA_UNSEEN);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Invalid offset "user_id" of array type array{}
                  Open

                                      ->update('roundcube_users', ['crm_error' => null, 'crm_status' => self::MAIL_BOX_STATUS_ACTIVE], ['user_id' => $account['user_id']])
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db::createCommand
                  Open

                                  \App\Db::getInstance()->createCommand()
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                                  \App\Log::endProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \RCUBE_INSTALL_PATH
                  Open

                              $iniset = file_get_contents(RCUBE_INSTALL_PATH . '/program/include/iniset.php');
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Returning type float|int but loadRoundcubeConfig() is declared to return array
                  Open

                          return $configMail + $config;
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db::createCommand
                  Open

                                  \App\Db::getInstance()->createCommand()
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method trace from undeclared class \App\Log
                  Open

                              \App\Log::trace('Exit OSSMail_Record_Model::imapConnect() method ...');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db\Query::from
                  Open

                          $query = (new \App\Db\Query())->from('roundcube_users');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Return type of imapConnect() is undeclared type \IMAP\Connection
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method getConfig from undeclared class \OSSMailScanner_Record_Model
                  Open

                                  if (self::MAIL_BOX_STATUS_BLOCKED_TEMP === $status && strtotime('-' . (OSSMailScanner_Record_Model::getConfig('blocked')['permanentTime'] ?? '2 day')) > strtotime($date)) {
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db::createCommand
                  Open

                          $dbCommand = \App\Db::getInstance()->createCommand();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db::createCommand
                  Open

                          return \App\Db::getInstance()->createCommand()->update('roundcube_users', $data, ['user_id' => $userId])->execute();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  string passed to foreach instead of array
                  Open

                          foreach ($text as $row) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 4 (partNum) is string but \OSSMail_Record_Model::initMailPart() takes int defined at /code/modules/OSSMail/models/Record.php:466
                  Open

                                      $mail = self::initMailPart($mbox, $mail, $subPartStructure, $partNum . '.' . ($subPartNum + 1));
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to undeclared method \App\Db\Query::from
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
                  Open

                                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                                              \App\Log::endProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \IMAP_OPENTIMEOUT
                  Open

                          imap_timeout(IMAP_OPENTIMEOUT, 5);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Invalid offset "user_id" of array type array{}
                  Open

                                      ], ['user_id' => $account['user_id']])
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 1 (stream_id) is \IMAP\Connection but \imap_status() takes resource
                  Open

                                              $info = imap_status($mbox, static::$imapConnectMailbox, SA_UNSEEN);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method error from undeclared class \App\Log
                  Open

                                          \App\Log::error($th->__toString());
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method beginProfile from undeclared class \App\Log
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Reference to undeclared constant \FT_UID
                  Open

                              $data = $orgData = imap_body($mbox, $mail['id'], FT_UID | FT_PEEK);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method error from undeclared class \App\Log
                  Open

                              \App\Log::error('Error OSSMail_Record_Model::imapConnect(' . static::$imapConnectMailbox . '): ' . imap_last_error());
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method endProfile from undeclared class \App\Log
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
                  Open

                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);
                  Severity: Critical
                  Found in modules/OSSMail/models/Record.php by phan

                  Argument 1 (stream_id) is \IMAP\Connection|false but \imap_num_msg() takes resource
                  Open

                              $numMessages = imap_num_msg($imap);
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phan

                  Each class must be in a namespace of at least one level (a top-level vendor name)
                  Open

                  class OSSMail_Record_Model extends Vtiger_Record_Model

                  Avoid variables with short names like $id. Configured minimum length is 3.
                  Open

                      public static function getBodyAttach($mbox, $id, $msgno)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#shortvariable

                  Avoid variables with short names like $id. Configured minimum length is 3.
                  Open

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#shortvariable

                  Avoid variables with short names like $q. Configured minimum length is 3.
                  Open

                              if ($q = strspn($line, '>')) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#shortvariable

                  The class OSSMail_Record_Model is not named in CamelCase.
                  Open

                  class OSSMail_Record_Model extends Vtiger_Record_Model
                  {
                      /** @var int Mailbox Status: Active */
                      const MAIL_BOX_STATUS_ACTIVE = 0;
                  
                  
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseClassName

                  Since: 0.2

                  It is considered best practice to use the CamelCase notation to name classes.

                  Example

                  class class_name {
                  }

                  Source

                  Avoid variables with short names like $m. Configured minimum length is 3.
                  Open

                              if (!preg_match($uu_regexp_end, $input, $m, PREG_OFFSET_CAPTURE, $startpos)) {
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#shortvariable

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var int Mailbox Status: Blocked temporarily */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var int Mailbox Status: Blocked permanently */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_BLOCKED_PERM = 4;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_BLOCKED_TEMP = 2;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var int Mailbox Status: Active */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_INVALID_ACCESS = 1;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var int Mailbox Status: Invalid access data */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var int Mailbox Status: Disabled */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /** @var string[] Mailbox status labels */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_ACTIVE = 0;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_DISABLED = 3;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      const MAIL_BOX_STATUS_LABELS = [

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::MAIL_BOX_STATUS_BLOCKED_TEMP => 'LBL_ACCOUNT_IS_BLOCKED_TEMP',

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Get status label.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $query = (new \App\Db\Query())->from('roundcube_users');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $query->innerJoin('roundcube_users_autologin', 'roundcube_users_autologin.rcuser_id = roundcube_users.user_id');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $host

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return self::MAIL_BOX_STATUS_LABELS[$status];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($onlyActive) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($user) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!\defined('RCMAIL_VERSION') && file_exists(RCUBE_INSTALL_PATH . '/program/include/iniset.php')) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($imapHost = $config['imap_host'] ?? '') {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          imap_timeout(IMAP_OPENTIMEOUT, 5);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($onlyMy) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $iniset = file_get_contents(RCUBE_INSTALL_PATH . '/program/include/iniset.php');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool   $dieOnError

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool     $onlyMy

                  Line exceeds 120 characters; contains 124 characters
                  Open

                              $query->innerJoin('roundcube_users_autologin', 'roundcube_users_autologin.rcuser_id = roundcube_users.user_id');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($password) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @var array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $hosts = \is_string($imapHost) ? [$imapHost => $imapHost] : $imapHost;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (!empty($parseHost['port'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int $status

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $query->where(['crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $crmUsers[] = $userModel->getId();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $row['actions'] = empty($row['actions']) ? [] : explode(',', $row['actions']);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function loadRoundcubeConfig()

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $configMail + $config;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @var string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $sslMode = (isset($parseHost['scheme']) && \in_array($parseHost['scheme'], ['ssl', 'imaps', 'tls'])) ? $parseHost['scheme'] : null;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Line exceeds 120 characters; contains 128 characters
                  Open

                      public static function getAccountsList($user = false, bool $onlyMy = false, bool $password = false, bool $onlyActive = true)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $users[$row['user_id']] = $row;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \define('RCMAIL_VERSION', $rcubeVersion);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * $imapConnectMailbox.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $hosts = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $validateCert = '/novalidate-cert';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool     $password

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $dataReader->close();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $configMail = \App\Config::module('OSSMail');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              // read rcube version from iniset

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (preg_match('/define\(.RCMAIL_VERSION.,\s*.([0-9.]+[a-z-]*)?/', $iniset, $matches)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Imap connection cache.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static $imapConnectCache = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $config = self::loadRoundcubeConfig();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $cacheName = $user . $host . $folder;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $sslMode = 'tls';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Returns Roundcube configuration.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \define('RCUBE_VERSION', $rcubeVersion);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return imap connection resource.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param array  $account

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              return self::$imapConnectCache[$cacheName];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::MAIL_BOX_STATUS_INVALID_ACCESS => 'LBL_ACCOUNT_INVALID_ACCESS',

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $users = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $userModel = \App\User::getCurrentUserModel();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $query->andWhere(['roundcube_users_autologin.crmuser_id' => $crmUsers]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param array  $config

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $port = 993;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      ];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return IMAP\Connection|false

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      break;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Line exceeds 120 characters; contains 143 characters
                  Open

                              $sslMode = (isset($parseHost['scheme']) && \in_array($parseHost['scheme'], ['ssl', 'imaps', 'tls'])) ? $parseHost['scheme'] : null;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $validateCert = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!$config['validate_cert'] && $config['imap_open_add_connection_type']) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::MAIL_BOX_STATUS_DISABLED => 'LBL_ACCOUNT_IS_DISABLED',

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::MAIL_BOX_STATUS_BLOCKED_PERM => 'LBL_ACCOUNT_IS_BLOCKED_PERM',

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $crmUsers = $userModel->getGroups();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $dataReader = $query->createCommand()->query();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $users;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static $imapConnectMailbox = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $password

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $parseHost = parse_url($host);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return accounts array.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool     $onlyActive

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $query->andWhere(['<>', 'password', '']);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $rcubeVersion = str_replace('-git', '.999', $matches[1]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!$config) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (empty($parseHost['host'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getStatusLabel(int $status): string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $query->andWhere(['user_id' => $user]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($hosts as $configHost => $hostDomain) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (isset($parsedConfigHost['host']) && $parsedConfigHost['host'] === $host) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $parseHost = $parsedConfigHost;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $sslMode = '/' . $sslMode;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Line exceeds 120 characters; contains 142 characters
                  Open

                      public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  throw new \App\Exceptions\AppException('Unable to find a Roundcube version');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $user

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (isset(self::$imapConnectCache[$cacheName])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $port = 143;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $sslMode = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int|bool $user

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          while ($row = $dataReader->read()) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          include 'public_html/modules/OSSMail/roundcube/config/defaults.inc.php';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $folder     Character encoding UTF7-IMAP

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $parsedConfigHost = parse_url($configHost);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!empty($parseHost['host'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $host = $parseHost['host'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $port = $parseHost['port'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } elseif ($sslMode && 'tls' !== $sslMode) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($config['imap_open_add_connection_type'] && $sslMode) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  try {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          'failed_login' => date('Y-m-d H:i:s'),

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  throw new \App\Exceptions\AppException('IMAP_ERROR' . ': ' . imap_last_error());

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $interval = $config['timeCheckingMail'] ?? 30;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          if ($mbox) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param resource $mbox

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int      $msgno

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('from_email', \App\Purifier::purify($mail->getEmail('from')));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              register_shutdown_function(function () use ($mbox, $user) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \App\Db::getInstance()->createCommand()

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      try {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!$id) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (isset($config['imap_params'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($mbox) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \App\Db::getInstance()->createCommand()

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::trace('Exit OSSMail_Record_Model::imapConnect() method ...');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (empty($all[$user]['date']) || $date > strtotime($all[$user]['date'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $messageId = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail = new OSSMail_Mail_Model();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('Msgno', $header->Msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ->update('roundcube_users', ['crm_error' => null, 'crm_status' => self::MAIL_BOX_STATUS_ACTIVE], ['user_id' => $account['user_id']])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($account) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Update mailbox mesages info for users.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param array $users

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('message_id', $messageId ? \App\Purifier::purifyByType($messageId, 'MailId') : '');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $params = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_open|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::$imapConnectCache[$cacheName] = $mbox;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      throw $e;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($dieOnError) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (empty($users)) {

                  Line exceeds 120 characters; contains 188 characters
                  Open

                                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Line exceeds 120 characters; contains 157 characters
                  Open

                                  $status = self::MAIL_BOX_STATUS_ACTIVE == $account['crm_status'] ? self::MAIL_BOX_STATUS_INVALID_ACCESS : self::MAIL_BOX_STATUS_BLOCKED_TEMP;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  [$date] = explode('||', $account['crm_error'] ?: '');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (self::MAIL_BOX_STATUS_BLOCKED_TEMP === $status && strtotime('-' . (OSSMailScanner_Record_Model::getConfig('blocked')['permanentTime'] ?? '2 day')) > strtotime($date)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $dbCommand = \App\Db::getInstance()->createCommand();

                  Line exceeds 120 characters; contains 122 characters
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $dbCommand->insert('u_#__mail_quantities', ['userid' => $user, 'num' => 0, 'date' => date('Y-m-d H:i:s')])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool     $fullMode

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              return false;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('reply_toaddress', \App\Purifier::purify($mail->getEmail('reply_to')));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $maxRetries = $options = 0;

                  Line exceeds 120 characters; contains 152 characters
                  Open

                                      ->update('roundcube_users', ['crm_error' => null, 'crm_status' => self::MAIL_BOX_STATUS_ACTIVE], ['user_id' => $account['user_id']])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      imap_close($mbox);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $mbox;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if ($account = self::getMailAccountDetail($user)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int      $id

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($account) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $config = Settings_Mail_Config_Model::getConfig('mailIcon');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              $info = imap_status($mbox, static::$imapConnectMailbox, SA_UNSEEN);

                  Line exceeds 120 characters; contains 162 characters
                  Open

                                              $dbCommand->update('u_#__mail_quantities', ['num' => $counter[$user], 'date' => date('Y-m-d H:i:s')], ['userid' => $user])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      } catch (\Throwable $th) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $counter;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $maxRetries = $config['imap_max_retries'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function updateMailBoxCounter(array $users): array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      if (empty($all[$user])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $counter[$user] = $all[$user]['num'] ?? 0;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!$msgno) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('cc_email', \App\Purifier::purify($mail->getEmail('cc')));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (isset($config['imap_max_retries'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          'crm_status' => $status,

                  Line exceeds 120 characters; contains 132 characters
                  Open

                                          $dbCommand->update('u_#__mail_quantities', ['date' => date('Y-m-d H:i:s')], ['userid' => $user])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $id = imap_uid($mbox, $msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $date = strtotime("-{$interval} seconds");

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $counter = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!$msgno) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (property_exists($header, 'message_id')) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $messageId = $header->message_id;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              });

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (empty($date) || false === strtotime($date)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $date = date('Y-m-d H:i:s');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          'crm_error' => \App\TextUtils::textTruncate($date . '||' . imap_last_error(), 250),

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              \App\Log::endProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              $counter[$user] = $info->unseen ?? 0;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('header', $header);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      \App\Log::beginProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $status = self::MAIL_BOX_STATUS_ACTIVE == $account['crm_status'] ? self::MAIL_BOX_STATUS_INVALID_ACCESS : self::MAIL_BOX_STATUS_BLOCKED_TEMP;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $status = self::MAIL_BOX_STATUS_BLOCKED_PERM;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ], ['user_id' => $account['user_id']])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              $dbCommand->update('u_#__mail_quantities', ['num' => $counter[$user], 'date' => date('Y-m-d H:i:s')], ['userid' => $user])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getMail($mbox, $id, $msgno = false, bool $fullMode = true)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('to_email', \App\Purifier::purify($mail->getEmail('to')));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          static::$imapConnectMailbox = "{{$host}:{$port}/imap{$sslMode}{$validateCert}}{$folder}";

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      \App\Log::endProfile('OSSMail_Record_Model|imap_close|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  } catch (\Throwable $e) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $all = (new \App\Db\Query())->from('u_#__mail_quantities')->where(['userid' => $users])->indexBy('userid')->all();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $dbCommand->update('u_#__mail_quantities', ['date' => date('Y-m-d H:i:s')], ['userid' => $user])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          \App\Log::error($th->__toString());

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return bool|\OSSMail_Mail_Model

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mbox = imap_open(static::$imapConnectMailbox, $user, $password, $options, $maxRetries, $params);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());

                  Line exceeds 120 characters; contains 188 characters
                  Open

                                  if (self::MAIL_BOX_STATUS_BLOCKED_TEMP === $status && strtotime('-' . (OSSMailScanner_Record_Model::getConfig('blocked')['permanentTime'] ?? '2 day')) > strtotime($date)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ->update('roundcube_users', [

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ->execute();

                  Line exceeds 120 characters; contains 130 characters
                  Open

                              \App\Log::error('Error OSSMail_Record_Model::imapConnect(' . static::$imapConnectMailbox . '): ' . imap_last_error());

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('id', $id);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('bcc_email', \App\Purifier::purify($mail->getEmail('bcc')));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $mail;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getBodyAttach($mbox, $id, $msgno)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int      $partNum

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } elseif (3 == $partStructure->encoding) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $params = $config['imap_params'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::trace('imap_open(({' . static::$imapConnectMailbox . ", $user , '****'. $options, $maxRetries, " . var_export($params, true) . ') method ...');

                  Line exceeds 120 characters; contains 161 characters
                  Open

                          \App\Log::trace('imap_open(({' . static::$imapConnectMailbox . ", $user , '****'. $options, $maxRetries, " . var_export($params, true) . ') method ...');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::error('Error OSSMail_Record_Model::imapConnect(' . static::$imapConnectMailbox . '): ' . imap_last_error());

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              return [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          foreach ($users as $user) {

                  Line exceeds 120 characters; contains 142 characters
                  Open

                                          $dbCommand->insert('u_#__mail_quantities', ['userid' => $user, 'num' => 0, 'date' => date('Y-m-d H:i:s')])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              \App\Log::beginProfile(__METHOD__ . '|imap_status|' . $user, 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $msgno = imap_msgno($mbox, $id);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_uid', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_headerinfo', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $header = imap_headerinfo($mbox, $msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return user account detal.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          self::$usersCache[$userid] = $user;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $struct = imap_fetchstructure($mbox, $id, FT_UID);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $body = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $attachment = (isset($mail['attachments'])) ? $mail['attachments'] : [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = imap_base64($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              return self::$usersCache[$userid];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (\function_exists('mb_convert_encoding') && \in_array($charset, mb_list_encodings())) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param resource $mbox

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              'body' => $body,

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          ];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetch_overview', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $clean .= imap_fetchheader($mbox, $msg->msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $return .= $row->mailbox . '@' . $row->host;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail = ['id' => $id];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = $orgData = imap_body($mbox, $mail['id'], FT_UID | FT_PEEK);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $text;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          foreach ($text as $row) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $return;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return body and attachments.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              'attachment' => $attachment,

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param object   $partStructure

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $clean = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $user;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $text .= iconv($charset, 'UTF-8', $row->text);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail = self::initMailPart($mbox, $mail, $struct, 0);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Init mail part.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($partNum) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              'isHtml' => !empty($mail['textHtml']),

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static function initMailPart($mbox, $mail, $partStructure, $partNum)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } elseif (2 == $partStructure->encoding) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail->set('clean', $clean);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ('' != $return) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param array    $mail

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } elseif (4 == $partStructure->encoding) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail->set('body', $structure['body']);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Line exceeds 120 characters; contains 187 characters
                  Open

                          $user = (new \App\Db\Query())->from('roundcube_users')->where(['user_id' => $userid, 'crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]])->one();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function decodeText($text)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $data = imap_mime_header_decode($text);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return full name.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getFullName($text)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ('' == $row->personal) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::endProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($struct->parts as $partNum => $partStructure) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('subject', isset($header->subject) ? \App\TextUtils::textTruncate(\App\Purifier::purify(self::decodeText($header->subject)), 65535, false) : '');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('date', date('Y-m-d H:i:s', $header->udate));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \App\Log::endProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');

                  Line exceeds 120 characters; contains 164 characters
                  Open

                          $mail->set('subject', isset($header->subject) ? \App\TextUtils::textTruncate(\App\Purifier::purify(self::decodeText($header->subject)), 65535, false) : '');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $structure = self::getBodyAttach($mbox, $id, $msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail->set('isHtml', $structure['isHtml']);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $text

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int $userid

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          foreach ($data as &$row) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (empty($struct->parts)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $body = (!empty($mail['textHtml'])) ? $mail['textHtml'] : $body;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Line exceeds 120 characters; contains 153 characters
                  Open

                          $mail->set('firstLetterBg', strtoupper(\App\TextUtils::textTruncate(trim(strip_tags(App\Purifier::purify($mail->getEmail('from')))), 1, false)));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($fullMode) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($msgs as $msg) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  \App\Log::beginProfile(__METHOD__ . '|imap_fetchheader', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static $usersCache = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $user = (new \App\Db\Query())->from('roundcube_users')->where(['user_id' => $userid, 'crm_status' => [self::MAIL_BOX_STATUS_INVALID_ACCESS, self::MAIL_BOX_STATUS_ACTIVE]])->one();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Convert text encoding.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $text = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $charset = ('default' == $row->charset) ? 'ASCII' : $row->charset;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $return = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $return .= self::decodeText($row->personal) . ' - ' . $row->mailbox . '@' . $row->host;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_body', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail->set('attachments', $structure['attachment']);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Users cache.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @var array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (isset(self::$usersCache[$userid])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $return .= ',';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int      $msgno

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          \App\Log::beginProfile(__METHOD__ . '|imap_fetchstructure', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mail = self::initMailPart($mbox, $mail, $partStructure, $partNum + 1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $body = (!empty($mail['textPlain'])) ? $mail['textPlain'] : $body;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (1 == $partStructure->encoding) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getMailAccountDetail($userid)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $text .= mb_convert_encoding($row->text, 'utf-8', $charset);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $text

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int      $id

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return [

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param resource $mbox

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = imap_utf8($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = imap_binary($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mail->set('firstLetterBg', strtoupper(\App\TextUtils::textTruncate(trim(strip_tags(App\Purifier::purify($mail->getEmail('from')))), 1, false)));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $msgs = imap_fetch_overview($mbox, $msgno);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!empty($params['charset']) && 'utf-8' !== strtolower($params['charset'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $encodedData = mb_convert_encoding($data, 'UTF-8', $params['charset']);

                  Line exceeds 120 characters; contains 201 characters
                  Open

                          $attachmentId = $partStructure->ifid ? trim($partStructure->id, ' <>') : (isset($params['filename']) || isset($params['name']) ? random_int(0, PHP_INT_MAX) . random_int(0, PHP_INT_MAX) : null);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (preg_match('/^([a-zA-Z0-9]{76} )+[a-zA-Z0-9]{76}$/', $data) && base64_decode($data, true)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mail['textPlain'] = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          while (preg_match($uu_regexp_begin, $input, $matches, PREG_OFFSET_CAPTURE)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($q = strspn($line, '>')) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $params[strtolower($param->attribute)] = $param->value;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($partStructure->dparameters as $param) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $data = $encodedData;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (isset($params['format']) && 'flowed' === $params['format']) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (!isset($mail['textHtml'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $filebody = str_replace("\r\n", "\n", $filebody);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  'filename' => trim($matches[1][0]),

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      unset($text[$idx]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = imap_qprint($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $params[$paramName] .= $param->value;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $fileName = !empty($params['filename']) ? $params['filename'] : $params['name'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } elseif (2 == $partStructure->type && $data) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $line = substr($line, $q);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      if ($delSp) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $params[$paramName] = $param->value;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail['attachments'][$attachmentId]['attachment'] = $data;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $input

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static function unfoldFlowed(string $text, bool $delSp = false): string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if ('-- ' == $line) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $params = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $fileName = self::decodeText($fileName);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mail['textPlain'] .= $uuDecode['text'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $data = $orgData;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $qLevel = 0;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  ) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (isset($uuDecode['attachments'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (!isset($mail['textPlain'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail['textPlain'] .= trim($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $attachments = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              ];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!empty($partStructure->dparameters)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (isset($params[$paramName])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $mail['textPlain'] = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $mail;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $startpos = $matches[0][1];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              // extract attachment body

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $input = substr_replace($input, '', $startpos, $endpos + $end_len - $startpos);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $encodedData = iconv($params['charset'], 'UTF-8', $data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $mail['attachments'] = $uuDecode['attachments'];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!empty($partStructure->parts)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Parse format=flowed message body.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $text

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      && isset($text[$last]) && ' ' == $text[$last][\strlen($text[$last]) - 1]

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($encodedData) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $fileName = self::decodeRFC2231($fileName);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (!isset($mail['textPlain'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($partStructure->parameters as $param) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if ($data && '<' !== $data[0] && '<' === $orgData[0]) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static function uuDecode($input)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $attachments[] = [

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          foreach ($text as $idx => $line) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $last = $idx;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (!empty($partStructure->parameters)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $mail['attachments'][$attachmentId]['filename'] = $fileName;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          } elseif (0 == $partStructure->type && $data) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mail['textHtml'] .= $data;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $end_len = \strlen($m[0][0]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              // remove attachment body from the message body

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param bool   $delSp

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $text = preg_split('/\r?\n/', $text);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $last = -1;

                  Line exceeds 120 characters; contains 129 characters
                  Open

                                  $paramName = strtolower(preg_match('~^(.*?)\*~', $param->attribute, $matches) ? $matches[1] : $param->attribute);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $attachmentId = $partStructure->ifid ? trim($partStructure->id, ' <>') : (isset($params['filename']) || isset($params['name']) ? random_int(0, PHP_INT_MAX) . random_int(0, PHP_INT_MAX) : null);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($attachmentId) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (empty($params['filename']) && empty($params['name'])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $begin_len = \strlen($matches[0][0]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (2 == $partStructure->type && 'RFC822' == $partStructure->subtype) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  'attachment' => convert_uudecode($filebody),

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (!preg_match($uu_regexp_end, $input, $m, PREG_OFFSET_CAPTURE, $startpos)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $endpos = $m[0][1];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $line = substr($line, 1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      && !preg_match('/^>+ {0,1}$/', $text[$last])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $paramName = strtolower(preg_match('~^(.*?)\*~', $param->attribute, $matches) ? $matches[1] : $param->attribute);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (\function_exists('mb_convert_encoding') && \in_array($params['charset'], mb_list_encodings())) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $data = base64_decode($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $uuDecode = self::uuDecode($data);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $uuDecode['text'] = self::unfoldFlowed($uuDecode['text'], isset($params['delsp']) && 'yes' === strtolower($params['delsp']));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              // add attachments to the structure

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return ['attachments' => $attachments, 'text' => $input];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if (isset($line[0]) && ' ' === $line[0]) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $text[$last] = substr($text[$last], 0, -1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $text[$last] .= $line;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $fileName = $attachmentId . '.' . strtolower($partStructure->subtype);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $mail['textHtml'] = '';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($partStructure->parts as $subPartNum => $subPartStructure) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $mail = self::initMailPart($mbox, $mail, $subPartStructure, $partNum);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Decode string.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  break;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $filebody = substr($input, $startpos + $begin_len, $endpos - $startpos - $begin_len - 1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ('plain' == strtolower($partStructure->subtype)) {

                  Line exceeds 120 characters; contains 145 characters
                  Open

                                      $uuDecode['text'] = self::unfoldFlowed($uuDecode['text'], isset($params['delsp']) && 'yes' === strtolower($params['delsp']));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $mail = self::initMailPart($mbox, $mail, $subPartStructure, $partNum . '.' . ($subPartNum + 1));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  if ($q == $qLevel

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $text[$last] .= $line;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              foreach ($list as $mailboxname) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $site_URL;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($accounts) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::endProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mailLimit = $numMessages;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          && '-- ' !== $text[$last]

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          && isset($text[$last][\strlen($text[$last]) - 1]) && ' ' === $text[$last][\strlen($text[$last]) - 1]

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return bool

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $data = $matches[2];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Line exceeds 120 characters; contains 175 characters
                  Open

                              $imap = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', true, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Get mail account detail by hash ID.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      if (isset($line[0]) && ' ' === $line[0]) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return false;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if (self::isUrlEncoded($data)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $folders;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getSiteUrl()

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return bool|array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          unset($text[$idx]);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $site_URL = App\Config::main('site_URL');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mail = self::getMail($imap, false, $i);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $account = reset($account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $name = \App\Utils::convertCharacterEncoding($name, 'UTF7-IMAP', 'UTF-8');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return site URL.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ('/' != substr($site_URL, -1)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($user && isset($accounts[$user])) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $mails[] = $mail;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $hash

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      if (isset($text[$last]) && $line && !$qLevel

                  Line exceeds 120 characters; contains 124 characters
                  Open

                                          && isset($text[$last][\strlen($text[$last]) - 1]) && ' ' === $text[$last][\strlen($text[$last]) - 1]

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          if ($delSp) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $string = str_replace('%20', '+', $string);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $decoded != $string && urlencode($decoded) == $string;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $string;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return array

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Fetch mails from IMAP.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int $user

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mailLimit = 5;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $account = reset($accounts);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $imap = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', true, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              for ($i = $numMessages; $i > ($numMessages - $mailLimit); --$i) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getAccountByHash($hash)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (preg_match('/^[_a-zA-Z0-9.,]+$/', $hash)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return bool

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Update user data for account.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      ) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $decoded = urldecode($string);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @return string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int|null $user

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return $mails;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $result = (new \App\Db\Query())

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  ->from('roundcube_users')

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  return $result;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $last = $idx;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return implode("\r\n", $text);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      protected static function decodeRFC2231($string, $charset = 'utf-8')

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $folders = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $site_URL = $site_URL . '/';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  ->one();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($result) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          return \App\Db::getInstance()->createCommand()->update('roundcube_users', $data, ['user_id' => $userId])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                      $last = $idx;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $line = substr($line, 1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * decode RFC2231 formatted string.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $folders = false;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if ($mbox) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $ref = '{' . $account['mail_host'] . '}';

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $name = str_replace($ref, '', $mailboxname);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getMailsFromIMAP(?int $user = null)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              } else {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Check if url is encoded.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $string

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function getFolders($user)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $list = imap_list($mbox, $ref, '*');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $accounts = self::getAccountsList(false, true);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $qLevel = $q;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $numMessages = imap_num_msg($imap);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              if ($numMessages < $mailLimit) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param string $charset

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       *

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          if (preg_match("/^(.*?)'.*?'(.*?)$/", $string, $matches)) {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * Return user folders.

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $folders[$name] = $name;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $mails = [];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $account = $accounts[$user];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              \App\Log::beginProfile(__METHOD__ . '|imap_num_msg', 'Mail|IMAP');

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  ->where(['like', 'preferences', "%:\"$hash\";%", false])

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              $encoding = $matches[1];

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param int   $userId

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                  $string = iconv(strtoupper($encoding), $charset, urldecode($data));

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Line exceeds 120 characters; contains 124 characters
                  Open

                          return \App\Db::getInstance()->createCommand()->update('roundcube_users', $data, ['user_id' => $userId])->execute();

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                              $text[$last] = substr($text[$last], 0, -1);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                                          $text[$idx] = $line;

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function isUrlEncoded($string)

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                          $account = self::getAccountsList($user);

                  Line exceeds 120 characters; contains 172 characters
                  Open

                          $mbox = self::imapConnect($account['username'], \App\Encryption::getInstance()->decrypt($account['password']), $account['mail_host'], 'INBOX', false, [], $account);

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      /**

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                              }

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       */

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      public static function setAccountUserData(int $userId, array $data): bool

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                      {

                  Spaces must be used to indent lines; tabs are not allowed
                  Open

                       * @param array $data

                  Class name "OSSMail_Record_Model" is not in camel caps format
                  Open

                  class OSSMail_Record_Model extends Vtiger_Record_Model

                  The variable $begin_len is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $site_URL is not named in camelCase.
                  Open

                      public static function getSiteUrl()
                      {
                          $site_URL = App\Config::main('site_URL');
                          if ('/' != substr($site_URL, -1)) {
                              $site_URL = $site_URL . '/';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $site_URL is not named in camelCase.
                  Open

                      public static function getSiteUrl()
                      {
                          $site_URL = App\Config::main('site_URL');
                          if ('/' != substr($site_URL, -1)) {
                              $site_URL = $site_URL . '/';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $begin_len is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $uu_regexp_begin is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $uu_regexp_begin is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $site_URL is not named in camelCase.
                  Open

                      public static function getSiteUrl()
                      {
                          $site_URL = App\Config::main('site_URL');
                          if ('/' != substr($site_URL, -1)) {
                              $site_URL = $site_URL . '/';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $uu_regexp_end is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $end_len is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $site_URL is not named in camelCase.
                  Open

                      public static function getSiteUrl()
                      {
                          $site_URL = App\Config::main('site_URL');
                          if ('/' != substr($site_URL, -1)) {
                              $site_URL = $site_URL . '/';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $uu_regexp_end is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $end_len is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $begin_len is not named in camelCase.
                  Open

                      protected static function uuDecode($input)
                      {
                          $attachments = [];
                          $uu_regexp_begin = '/begin [0-7]{3,4} ([^\r\n]+)\r?\n/s';
                          $uu_regexp_end = '/`\r?\nend((\r?\n)|($))/s';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $site_URL is not named in camelCase.
                  Open

                      public static function getSiteUrl()
                      {
                          $site_URL = App\Config::main('site_URL');
                          if ('/' != substr($site_URL, -1)) {
                              $site_URL = $site_URL . '/';
                  Severity: Minor
                  Found in modules/OSSMail/models/Record.php by phpmd

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  There are no issues that match your filters.

                  Category
                  Status