mambax7/extgallery

View on GitHub
class/Utility.php

Summary

Maintainability
F
3 days
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)
    {
        $open_tags = [];
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
Severity: Minor
Found in class/Utility.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)
    {
        $open_tags = [];
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
Severity: Major
Found in class/Utility.php - About 2 hrs to fix

    Function getModuleOption has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getModuleOption($option)
        {
            global $xoopsModule;
            /** @var \XoopsModules\Extgallery\Helper $helper */
            $helper = \XoopsModules\Extgallery\Helper::getInstance();
    Severity: Minor
    Found in class/Utility.php - About 1 hr 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 getModuleOption has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getModuleOption($option)
        {
            global $xoopsModule;
            /** @var \XoopsModules\Extgallery\Helper $helper */
            $helper = \XoopsModules\Extgallery\Helper::getInstance();
    Severity: Minor
    Found in class/Utility.php - About 1 hr to fix

      Method getWysiwygForm has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
      Severity: Major
      Found in class/Utility.php - About 1 hr 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/Utility.php - About 35 mins to fix

          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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 getModuleOption() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
          Open

              public static function getModuleOption($option)
              {
                  global $xoopsModule;
                  /** @var \XoopsModules\Extgallery\Helper $helper */
                  $helper = \XoopsModules\Extgallery\Helper::getInstance();
          Severity: Minor
          Found in class/Utility.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 Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
          Open

              public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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

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

                  if (isset($xoopsModuleConfig)
          Severity: Minor
          Found in class/Utility.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

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

                      if (isset($xoopsModuleConfig[$option])) {
          Severity: Minor
          Found in class/Utility.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

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

                          $retval = $xoopsModuleConfig[$option];
          Severity: Minor
          Found in class/Utility.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 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/Utility.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 '81', column '23').
          Open

                  $editor = new \XoopsFormEditor($caption, $name, $editor_configs);
          Severity: Minor
          Found in class/Utility.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/Utility.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\Extgallery\Helper' in method 'getModuleOption'.
          Open

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

                  } else {
                      /** @var \XoopsModuleHandler $moduleHandler */
                      $moduleHandler = \xoops_getHandler('module');
                      $module        = $moduleHandler->getByDirname('extgallery');
          
          
          Severity: Minor
          Found in class/Utility.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/Utility.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 parameters such as '$supplemental'.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
          Severity: Minor
          Found in class/Utility.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 '$helper'.
          Open

                  $helper = \XoopsModules\Extgallery\Helper::getInstance();
          Severity: Minor
          Found in class/Utility.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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      foreach ($lines as $line_matchings) {
                          // if there is any html-tag in this line, handle it and add it (uncounted) to the output
                          if (!empty($line_matchings[1])) {
                              // if it's an "empty element" with or without xhtml-conform closing slash
                              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: Major
          Found in class/Utility.php and 1 other location - About 1 day to fix
          class/Common/SysUtility.php on lines 76..127

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 372.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Line exceeds 120 characters; contains 135 characters
          Open

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

          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/Utility.php by phpcodesniffer

          Line exceeds 120 characters; contains 146 characters
          Open

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

          The variable $open_tags is not named in camelCase.
          Open

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

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 $editor_option is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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 $editor_configs is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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 $editor_option is not named in camelCase.
          Open

              public static function getWysiwygForm($caption, $name, $value, $rows, $cols, $width, $height, $supplemental)
              {
                  $editor_option            = mb_strtolower(static::getModuleOption('form_options'));
                  $editor                   = false;
                  $editor_configs           = [];
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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)
              {
                  $open_tags = [];
                  if ($considerHtml) {
                      // if the plain text is shorter than the maximum length, return the whole text
          Severity: Minor
          Found in class/Utility.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