XoopsModules25x/xoopspoll

View on GitHub
class/Common/SysUtility.php

Summary

Maintainability
D
1 day
Test Coverage

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

tableExists accesses the super-global variable $GLOBALS.
Open

    public static function tableExists(string $tablename): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
        $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fieldExists accesses the super-global variable $GLOBALS.
Open

    public static function fieldExists(string $fieldname, string $table): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__METHOD__ . " is deprecated, use Xmf\Database\Tables instead - instantiated from {$trace[0]['file']} line {$trace[0]['line']},");

Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

tableExists accesses the super-global variable $GLOBALS.
Open

    public static function tableExists(string $tablename): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
        $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fieldExists accesses the super-global variable $GLOBALS.
Open

    public static function fieldExists(string $fieldname, string $table): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__METHOD__ . " is deprecated, use Xmf\Database\Tables instead - instantiated from {$trace[0]['file']} line {$trace[0]['line']},");

Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

tableExists accesses the super-global variable $GLOBALS.
Open

    public static function tableExists(string $tablename): bool
    {
        $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
        \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
        $GLOBALS['xoopsLogger']->addDeprecated(
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

enumerate accesses the super-global variable $GLOBALS.
Open

    public static function enumerate(string $tableName, string $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);

        //    $result = $GLOBALS['xoopsDB']->query("SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord(string $tableName, string $idField, int $id): mixed
    {
        $newId = false;
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

    public static function truncateHtml(
        string $text,
        ?int $length = 100,
        ?string $ending = '...',
        ?bool $exact = false,
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

The class SysUtility has 11 public methods. Consider refactoring SysUtility to keep number of public methods under 10.
Open

class SysUtility
{
    use VersionChecks;    //checkVerXoops, checkVerPhp Traits
    use ServerStats;    // getServerStats Trait
    use FilesManagement;    // Files Management Trait
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

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

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

class SysUtility
{
    use VersionChecks;    //checkVerXoops, checkVerPhp Traits
    use ServerStats;    // getServerStats Trait
    use FilesManagement;    // Files Management Trait
Severity: Minor
Found in class/Common/SysUtility.php by phpmd

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

    public static function truncateHtml(
        string $text,
        ?int $length = 100,
        ?string $ending = '...',
        ?bool $exact = false,
Severity: Major
Found in class/Common/SysUtility.php - About 2 hrs to fix

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

            string $text,
            ?int $length = 100,
            ?string $ending = '...',
            ?bool $exact = false,
            ?bool $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(?\Xmf\Module\Helper $helper = null, ?array $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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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

              ?bool $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 '378', column '27').
      Open

                      throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder));
      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

              ?bool $exact = false,
      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 '337', 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 '339', 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

      Missing class import via use statement (line '342', 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

      Remove error control operator '@' on line 377.
      Open

          public static function prepareFolder(string $folder): void
          {
              try {
                  if (!@\mkdir($folder) && !\is_dir($folder)) {
                      throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder));
      Severity: Minor
      Found in class/Common/SysUtility.php by phpmd

      ErrorControlOperator

      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

      Example

      function foo($filePath) {
          $file = @fopen($filPath); // hides exceptions
          $key = @$array[$notExistingKey]; // assigns null to $key
      }

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

      Avoid using static access to class '\MyTextSanitizer' in method 'metaKeywords'.
      Open

              $myts    = \MyTextSanitizer::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

      Avoid using static access to class '\XoopsModules\Xoopspoll\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

      Avoid using static access to class '\Xmf\Request' in method 'selectSorting'.
      Open

              $selectViewForm = '<form name="form_switch" id="form_switch" action="' . Request::getString('REQUEST_URI', '', 'SERVER') . '" method="post"><span style="font-weight: bold;">' . $text . '</span>';
      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 selectSorting uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $sel1 = 'asc.png';
                  $sel2 = 'desc.png';
              }
      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 metaDescription uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {    // Compatibility for old Xoops versions
                  $xoopsTpl->assign('xoops_metaDescription', \strip_tags($content));
              }
      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 using static access to class '\XoopsModules\Xoopspoll\Helper' in method 'selectSorting'.
      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

      Avoid using static access to class '\Xmf\Request' in method 'selectSorting'.
      Open

              $selectViewForm .= '<a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=desc"><img src="' . $pathModIcon16 . '/' . $sel2 . '" title="DESC" alt="DESC"></a>';
      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

      Avoid using static access to class '\MyTextSanitizer' in method 'metaDescription'.
      Open

              $myts    = \MyTextSanitizer::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 metaKeywords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {    // Compatibility for old Xoops versions
                  $xoopsTpl->assign('xoops_metaKeywords', \strip_tags($content));
              }
      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 using static access to class '\XoopsLogger' in method 'enumerate'.
      Open

                  $logger = \XoopsLogger::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 \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

      Avoid using static access to class '\Xmf\Request' in method 'selectSorting'.
      Open

              $selectViewForm .= '  <a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=asc"><img src="' . $pathModIcon16 . '/' . $sel1 . '" title="ASC" alt="ASC"></a>';
      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 {
                                      // 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 '$moduleDirName'.
      Open

              $moduleDirName  = \basename(\dirname(__DIR__));
      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 '$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

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

              $newId = false;
      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

      TODO found
      Open

           * @TODO: Refactor to consider HTML5 & void (self-closing) elements
      Severity: Minor
      Found in class/Common/SysUtility.php by fixme

      TODO found
      Open

           * @TODO need to exit more gracefully on error. Should throw/trigger error and then return false
      Severity: Minor
      Found in class/Common/SysUtility.php by fixme

      TODO found
      Open

           * @TODO: Consider using https://github.com/jlgrall/truncateHTML/blob/master/truncateHTML.php
      Severity: Minor
      Found in class/Common/SysUtility.php by fixme

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

          public static function metaKeywords(string $content): void
          {
              global $xoopsTpl, $xoTheme;
              $myts    = \MyTextSanitizer::getInstance();
              $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
      Severity: Minor
      Found in class/Common/SysUtility.php and 1 other location - About 55 mins to fix
      class/Common/SysUtility.php on lines 125..135

      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 98.

      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

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

          public static function metaDescription(string $content): void
          {
              global $xoopsTpl, $xoTheme;
              $myts    = \MyTextSanitizer::getInstance();
              $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
      Severity: Minor
      Found in class/Common/SysUtility.php and 1 other location - About 55 mins to fix
      class/Common/SysUtility.php on lines 110..120

      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 98.

      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

      The parameter $form_sort is not named in camelCase.
      Open

          public static function selectSorting(string $text, string $form_sort): string
          {
              global $start, $order, $sort;
      
              $selectViewForm = '';
      Severity: Minor
      Found in class/Common/SysUtility.php by phpmd

      CamelCaseParameterName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name parameters.

      Example

      class ClassName {
          public function doSomething($user_name) {
          }
      }

      Source

      Avoid variables with short names like $id. Configured minimum length is 3.
      Open

          public static function cloneRecord(string $tableName, string $idField, int $id): mixed
      Severity: Minor
      Found in class/Common/SysUtility.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      There must be one USE keyword per declaration
      Open

      use XoopsModules\Xoopspoll\{
      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 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

      Line exceeds 120 characters; contains 153 characters
      Open

              \trigger_error(__METHOD__ . " is deprecated, use Xmf\Database\Tables instead - instantiated from {$trace[0]['file']} line {$trace[0]['line']},");
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 203 characters
      Open

              $selectViewForm = '<form name="form_switch" id="form_switch" action="' . Request::getString('REQUEST_URI', '', 'SERVER') . '" method="post"><span style="font-weight: bold;">' . $text . '</span>';
      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 131 characters
      Open

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

      Line exceeds 120 characters; contains 142 characters
      Open

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

      Line exceeds 120 characters; contains 164 characters
      Open

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

      Line exceeds 120 characters; contains 212 characters
      Open

                  \basename(\dirname(__DIR__, 2)) . ' Module: ' . __FUNCTION__ . ' function is deprecated, please use Xmf\Database\Tables method(s) instead.' . " Called from {$trace[0]['file']}line {$trace[0]['line']}"
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 147 characters
      Open

              $sql    = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 227 characters
      Open

              $selectViewForm .= '  <a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=asc"><img src="' . $pathModIcon16 . '/' . $sel1 . '" title="ASC" alt="ASC"></a>';
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 228 characters
      Open

              $selectViewForm .= '<a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=desc"><img src="' . $pathModIcon16 . '/' . $sel2 . '" title="DESC" alt="DESC"></a>';
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      Line exceeds 120 characters; contains 137 characters
      Open

              $sql    = "INSERT INTO $table (" . \implode(', ', \array_keys($tempTable)) . ") VALUES ('" . \implode("', '", $tempTable) . "')";
      Severity: Minor
      Found in class/Common/SysUtility.php by phpcodesniffer

      The variable $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect(array $cats): string
          {
              $cat_sql = '';
              if (\is_array($cats) && !empty($cats)) {
                  $cat_sql = '(' . \current($cats);
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect(array $cats): string
          {
              $cat_sql = '';
              if (\is_array($cats) && !empty($cats)) {
                  $cat_sql = '(' . \current($cats);
      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 $form_sort is not named in camelCase.
      Open

          public static function selectSorting(string $text, string $form_sort): string
          {
              global $start, $order, $sort;
      
              $selectViewForm = '';
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect(array $cats): string
          {
              $cat_sql = '';
              if (\is_array($cats) && !empty($cats)) {
                  $cat_sql = '(' . \current($cats);
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect(array $cats): string
          {
              $cat_sql = '';
              if (\is_array($cats) && !empty($cats)) {
                  $cat_sql = '(' . \current($cats);
      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 $form_sort is not named in camelCase.
      Open

          public static function selectSorting(string $text, string $form_sort): string
          {
              global $start, $order, $sort;
      
              $selectViewForm = '';
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect(array $cats): string
          {
              $cat_sql = '';
              if (\is_array($cats) && !empty($cats)) {
                  $cat_sql = '(' . \current($cats);
      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 $form_sort is not named in camelCase.
      Open

          public static function selectSorting(string $text, string $form_sort): string
          {
              global $start, $order, $sort;
      
              $selectViewForm = '';
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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(
              string $text,
              ?int $length = 100,
              ?string $ending = '...',
              ?bool $exact = false,
      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