XoopsModules25x/xfguestbook

View on GitHub
class/Common/SysUtility.php

Summary

Maintainability
C
1 day
Test Coverage

Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Severity: Minor
Found in class/Common/SysUtility.php - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method truncateHtml has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Severity: Major
Found in class/Common/SysUtility.php - About 2 hrs to fix

    Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    Severity: Minor
    Found in class/Common/SysUtility.php - About 35 mins to fix

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

          public static function getEditor($helper = null, $options = null)
          {
              /** @var Helper $helper */
              if (null === $options) {
                  $options           = [];
      Severity: Minor
      Found in class/Common/SysUtility.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

      The method truncateHtml() has an NPath complexity of 1116. The configured NPath complexity threshold is 200.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 truncateHtml() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 truncateHtml has a boolean flag argument $considerHtml, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
      Severity: Minor
      Found in class/Common/SysUtility.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 '178', column '35').
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorAdmin'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.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 '183', column '31').
      Open

                  $descEditor = new \XoopsFormDhtmlTextArea(\ucfirst($options['name']), $options['name'], $options['value'], '100%', '100%');
      Severity: Minor
      Found in class/Common/SysUtility.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 '180', column '35').
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorUser'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.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 truncateHtml has a boolean flag argument $exact, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
      Severity: Minor
      Found in class/Common/SysUtility.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 'XoopsModules\Xfguestbook\Common\Helper' in method 'getEditor'.
      Open

                  $helper = Helper::getInstance();
      Severity: Minor
      Found in class/Common/SysUtility.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 truncateHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  if (mb_strlen($text) <= $length) {
                      return $text;
                  }
                  $truncate = mb_substr($text, 0, $length - mb_strlen($ending));
      Severity: Minor
      Found in class/Common/SysUtility.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 getEditor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $descEditor = new \XoopsFormDhtmlTextArea(\ucfirst($options['name']), $options['name'], $options['value'], '100%', '100%');
              }
      Severity: Minor
      Found in class/Common/SysUtility.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 getEditor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorUser'), $options, $nohtml = false, $onfailure = 'textarea');
                  }
      Severity: Minor
      Found in class/Common/SysUtility.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 truncateHtml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                                  } else {
                                      // no more characters left
                                      break;
                                  }
      Severity: Minor
      Found in class/Common/SysUtility.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 unused local variables such as '$nohtml'.
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorAdmin'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.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 local variables such as '$onfailure'.
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorAdmin'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.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

      Line exceeds 120 characters; contains 165 characters
      Open

                          if (\preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 165 characters
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorUser'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 143 characters
      Open

                          if (\preg_match_all('/&[0-9a-z]{2,8};|&#\d{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, \PREG_OFFSET_CAPTURE)) {
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 166 characters
      Open

                      $descEditor = new \XoopsFormEditor(\ucfirst($options['name']), $helper->getConfig('editorAdmin'), $options, $nohtml = false, $onfailure = 'textarea');
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 132 characters
      Open

                      $content_length = mb_strlen(\preg_replace('/&[0-9a-z]{2,8};|&#\d{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 135 characters
      Open

                  $descEditor = new \XoopsFormDhtmlTextArea(\ucfirst($options['name']), $options['name'], $options['value'], '100%', '100%');
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      The variable $total_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $entities_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $open_tags is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $total_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $open_tags is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $entities_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $entities_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $content_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $tag_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $total_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $tag_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $open_tags is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $total_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $tag_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $open_tags is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $content_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $total_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $content_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $entities_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $open_tags is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $line_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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 $tag_matchings is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      Severity: Minor
      Found in class/Common/SysUtility.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