mambax7/cardealer

View on GitHub
class/Utility.php

Summary

Maintainability
D
1 day
Test Coverage

cloneRecord accesses the super-global variable $GLOBALS.
Open

    public static function cloneRecord($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        $sql    = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
        $result = $GLOBALS['xoopsDB']->query($sql);
Severity: Minor
Found in class/Utility.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($tableName, $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        $sql    = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
        $result = $GLOBALS['xoopsDB']->query($sql);
Severity: Minor
Found in class/Utility.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($tableName, $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        $sql    = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
        $result = $GLOBALS['xoopsDB']->query($sql);
Severity: Minor
Found in class/Utility.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($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $id_field, $id)
    {
        $new_id = false;
        $table  = $GLOBALS['xoopsDB']->prefix($tableName);
        // copy content of the record you wish to clone 
Severity: Minor
Found in class/Utility.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($tableName, $columnName)
    {
        $table = $GLOBALS['xoopsDB']->prefix($tableName);
        $sql    = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"';
        $result = $GLOBALS['xoopsDB']->query($sql);
Severity: Minor
Found in class/Utility.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 55 (exceeds 5 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
            if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
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 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 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

      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\Cardealer\Helper' in method 'selectSorting'.
      Open

              $helper = Cardealer\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

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

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

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

              $select_view .= '  <a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=asc" /><img src="' . $pathModIcon16 . '/' . $sel1 . '" title="ASC" alt="ASC"></a>';
      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 (strlen($text) <= $length) {
                      return $text;
                  } else {
                      $truncate = substr($text, 0, $length - 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

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

              $select_view = '<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/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 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/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

      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 {
                          $truncate     .= $line_matchings[2];
                          $total_length += $content_length;
                      }
      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 using static access to class '\MyTextSanitizer' in method 'metaKeywords'.
      Open

              $myts    = \MyTextSanitizer::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 {
                      $truncate = substr($text, 0, $length - 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 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/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 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/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 using static access to class '\MyTextSanitizer' in method 'metaDescription'.
      Open

              $myts    = \MyTextSanitizer::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 enumerate() contains an exit expression.
      Open

                  exit ($GLOBALS['xoopsDB']->error());
      Severity: Minor
      Found in class/Utility.php by phpmd

      ExitExpression

      Since: 0.2

      An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

      Example

      class Foo {
          public function bar($param)  {
              if ($param === 42) {
                  exit(23);
              }
          }
      }

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

      The method cloneRecord() contains an exit expression.
      Open

              $tempTable = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query("SELECT * FROM $table WHERE $id_field='$id' "), MYSQLI_ASSOC) or exit('Could not select record');
      Severity: Minor
      Found in class/Utility.php by phpmd

      ExitExpression

      Since: 0.2

      An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

      Example

      class Foo {
          public function bar($param)  {
              if ($param === 42) {
                  exit(23);
              }
          }
      }

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

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

              global $start, $order, $file_cat, $sort, $xoopsModule;
      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

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

              global $start, $order, $file_cat, $sort, $xoopsModule;
      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

      The method cloneRecord() contains an exit expression.
      Open

              $result = $GLOBALS['xoopsDB']->queryF("INSERT INTO $table (" . implode(', ', array_keys($tempTable)) . ") VALUES ('" . implode("', '", array_values($tempTable)) . "')") or exit ($GLOBALS['xoopsDB']->error());
      Severity: Minor
      Found in class/Utility.php by phpmd

      ExitExpression

      Since: 0.2

      An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

      Example

      class Foo {
          public function bar($param)  {
              if ($param === 42) {
                  exit(23);
              }
          }
      }

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

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

          public static function metaDescription($content)
          {
              global $xoopsTpl, $xoTheme;
              $myts    = \MyTextSanitizer::getInstance();
              $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
      Severity: Major
      Found in class/Utility.php and 1 other location - About 1 hr to fix
      class/Utility.php on lines 92..102

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

      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 metaKeywords($content)
          {
              global $xoopsTpl, $xoTheme;
              $myts    = \MyTextSanitizer::getInstance();
              $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content));
      Severity: Major
      Found in class/Utility.php and 1 other location - About 1 hr to fix
      class/Utility.php on lines 107..117

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

      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 $id_field is not named in camelCase.
      Open

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      Severity: Minor
      Found in class/Utility.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($tableName, $id_field, $id)
      Severity: Minor
      Found in class/Utility.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

      The parameter $form_sort is not named in camelCase.
      Open

          public static function selectSorting($text, $form_sort)
          {
              global $start, $order, $file_cat, $sort, $xoopsModule;
      
              $select_view   = '';
      Severity: Minor
      Found in class/Utility.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

      The closing brace for the class must go on the next line after the body
      Open

      }
      Severity: Minor
      Found in class/Utility.php by phpcodesniffer

      Line exceeds 120 characters; contains 200 characters
      Open

              $select_view = '<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/Utility.php by phpcodesniffer

      Line exceeds 120 characters; contains 224 characters
      Open

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

      Line exceeds 120 characters; contains 223 characters
      Open

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

      Line exceeds 120 characters; contains 177 characters
      Open

              $tempTable = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query("SELECT * FROM $table WHERE $id_field='$id' "), MYSQLI_ASSOC) or exit('Could not select record');
      Severity: Minor
      Found in class/Utility.php by phpcodesniffer

      Line exceeds 120 characters; contains 144 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

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

      Line exceeds 120 characters; contains 131 characters
      Open

                      $content_length = 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 216 characters
      Open

              $result = $GLOBALS['xoopsDB']->queryF("INSERT INTO $table (" . implode(', ', array_keys($tempTable)) . ") VALUES ('" . implode("', '", array_values($tempTable)) . "')") or exit ($GLOBALS['xoopsDB']->error());
      Severity: Minor
      Found in class/Utility.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', $line_matchings[1])) {
      Severity: Minor
      Found in class/Utility.php by phpcodesniffer

      Space before opening parenthesis of function call prohibited
      Open

              $result = $GLOBALS['xoopsDB']->queryF("INSERT INTO $table (" . implode(', ', array_keys($tempTable)) . ") VALUES ('" . implode("', '", array_values($tempTable)) . "')") or exit ($GLOBALS['xoopsDB']->error());
      Severity: Minor
      Found in class/Utility.php by phpcodesniffer

      Space before opening parenthesis of function call prohibited
      Open

                  exit ($GLOBALS['xoopsDB']->error());
      Severity: Minor
      Found in class/Utility.php by phpcodesniffer

      The variable $entities_length is not named in camelCase.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $select_view is not named in camelCase.
      Open

          public static function selectSorting($text, $form_sort)
          {
              global $start, $order, $file_cat, $sort, $xoopsModule;
      
              $select_view   = '';
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect($cats)
          {
              $cat_sql = '';
              if (is_array($cats)) {
                  $cat_sql = '(' . current($cats);
      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 $new_id is not named in camelCase.
      Open

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      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 $select_view is not named in camelCase.
      Open

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

          public static function selectSorting($text, $form_sort)
          {
              global $start, $order, $file_cat, $sort, $xoopsModule;
      
              $select_view   = '';
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $cat_sql is not named in camelCase.
      Open

          public static function blockAddCatSelect($cats)
          {
              $cat_sql = '';
              if (is_array($cats)) {
                  $cat_sql = '(' . current($cats);
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $file_cat is not named in camelCase.
      Open

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

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

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

          public static function blockAddCatSelect($cats)
          {
              $cat_sql = '';
              if (is_array($cats)) {
                  $cat_sql = '(' . current($cats);
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $new_id is not named in camelCase.
      Open

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $form_sort is not named in camelCase.
      Open

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

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

          public static function blockAddCatSelect($cats)
          {
              $cat_sql = '';
              if (is_array($cats)) {
                  $cat_sql = '(' . current($cats);
      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 $select_view is not named in camelCase.
      Open

          public static function selectSorting($text, $form_sort)
          {
              global $start, $order, $file_cat, $sort, $xoopsModule;
      
              $select_view   = '';
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $select_view is not named in camelCase.
      Open

          public static function selectSorting($text, $form_sort)
          {
              global $start, $order, $file_cat, $sort, $xoopsModule;
      
              $select_view   = '';
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $id_field is not named in camelCase.
      Open

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      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 $new_id is not named in camelCase.
      Open

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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 $form_sort is not named in camelCase.
      Open

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

          public static function cloneRecord($tableName, $id_field, $id)
          {
              $new_id = false;
              $table  = $GLOBALS['xoopsDB']->prefix($tableName);
              // copy content of the record you wish to clone 
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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)
          {
              if ($considerHtml) {
                  // if the plain text is shorter than the maximum length, return the whole text
                  if (strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
      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