File page_dbsettings.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Installer database configuration page
*
* See the enclosed file license.txt for licensing information.
Method xoFormFieldCollation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
Method xoFormFieldCharset
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xoFormFieldCharset($name, $value, $label, $link, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (!$chars = getDbCharsets($link)) {
Function xoFormFieldCollation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
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 xoFormFieldCollation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
Avoid deeply nested control flow statements. Open
while ($row = fetch_assoc($result)) {
$character_sets[$row["Variable_name"]] = $row["Value"];
}
Method xoFormBlockCollation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function xoFormBlockCollation($name, $value, $label, $link, $charset, $help = '') {
Avoid deeply nested control flow statements. Open
while ($row = fetch_assoc($result)) {
$collations[$row["Variable_name"]] = $row["Value"];
}
Function getDbCharsets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getDbCharsets($link) {
static $charsets = array( );
if ($charsets) {
return $charsets;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function validateDbCharset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function validateDbCharset($link, &$charset, &$collation) {
$error = null;
if (empty ($charset)) {
$collation = "";
- Read upRead up
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 xoFormFieldCharset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function xoFormFieldCharset($name, $value, $label, $link, $help = '') {
Method xoFormField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function xoFormField($name, $value, $label, $maxlength, $help = '') {
The function xoFormFieldCollation() has an NPath complexity of 240. The configured NPath complexity threshold is 200. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 function xoFormFieldCollation() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Avoid assigning values to variables in if clauses and the like (line '133', column '6'). Open
function getDbCollations($link, $charset) {
static $collations = array( );
if ($result = exec_query("SHOW COLLATION WHERE Charset=" . quote_sql($charset), $link)) {
while ($row = fetch_assoc($result)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method fetch_assoc uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return mysql_fetch_assoc($result);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '325', column '7'). Open
function xoFormFieldCharset($name, $value, $label, $link, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (!$chars = getDbCharsets($link)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method validateDbCharset uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$collations = getDbCollations($link, $charset);
if (!isset ($collations [$collation])) {
$error = sprintf(ERR_INVALID_DBCOLLATION, $collation);
}
- Read upRead up
- Exclude checks
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 quote_sql uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return '\'' . mysql_real_escape_string($sql) . '\'';
}
- Read upRead up
- Exclude checks
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 exec_query uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return mysql_query($sql, $link);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid assigning values to variables in if clauses and the like (line '109', column '6'). Open
function getDbCharsets($link) {
static $charsets = array( );
if ($charsets) {
return $charsets;
}
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '182', column '27'). Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getDBVersion uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
{
echo 'error getting DB version';
}
- Read upRead up
- Exclude checks
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
syntax error, unexpected ')'
Open
echo xoFormBlockCollation('DB_COLLATION', $vars ['DB_COLLATION'], DB_COLLATION_LABEL, $link, $vars ['DB_CHARSET'], DB_COLLATION_HELP, );
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
switch ($vars['DB_TYPE']) {
case 'mysql':
$func_connect = empty($vars['DB_PCONNECT'])?"mysql_connect":"mysql_pconnect";
if (!($link = @$func_connect($vars['DB_HOST'], $vars['DB_USER'], $vars['DB_PASS'], true))) {
$error = ERR_NO_DBCONNECTION;
- Read upRead up
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 177.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
function xoFormField($name, $value, $label, $maxlength, $help = '') {
$label = htmlspecialchars($label);
$name = htmlspecialchars($name, ENT_QUOTES);
$value = htmlspecialchars($value, ENT_QUOTES);
$maxlength = (int) ($maxlength);
- Read upRead up
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 140.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
The parameter $database_name is not named in camelCase. Open
function sanitize_database($database_name) {
return preg_replace('/[^A-Za-z0-9_]+/', '', $database_name);
}
- Read upRead up
- Exclude checks
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 parameter $db_name is not named in camelCase. Open
function select_db($db_name, $link) {
//if ($link instanceof PDO) {
try {
$link->exec("use `" . $db_name . '`;');
return true;
- Read upRead up
- Exclude checks
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
Blank line found at end of control structure Open
- Exclude checks
Expected 1 space after comma in function call; 2 found Open
$block .= xoFormFieldCollation($name, $value, $label, $link, $charset, $help);
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
));
- Exclude checks
Space before opening parenthesis of function call prohibited Open
$field .= "<option value='{$collation_default}'" . (($value == $collation_default || empty ($value))?" 'selected'":"") . ">{$collation_default} (Default)</option>";
- Exclude checks
Space before opening parenthesis of function call prohibited Open
exit ();
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$link = new PDO('mysql:host=' . $vars['DB_HOST'],
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($charset) && empty ($collation)) {
- Exclude checks
Expected 1 space after closing brace; newline found Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if ($_SERVER ['REQUEST_METHOD'] == 'GET' && isset ($_GET ['charset']) && @$_GET ['action'] == 'updateCollation') {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if ($_SERVER ['REQUEST_METHOD'] == 'POST' && !empty ($vars ['DB_NAME'])) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$result = exec_query("CREATE DATABASE " . sanitize_database( $vars ['DB_NAME'] ), $link);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
unset ($chars ["utf8"]);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($charset) && empty ($collation)) {
- Exclude checks
Line indented incorrectly; expected 1 tabs, found 2 Open
try {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
$sql = "ALTER DATABASE " . sanitize_database( $vars ['DB_NAME']) . " DEFAULT CHARACTER SET " . quote_sql($vars ['DB_CHARSET']) . ($vars ['DB_COLLATION']?" COLLATE " . quote_sql($vars ['DB_COLLATION']):"");
- Exclude checks
Space before opening parenthesis of function call prohibited Open
$vars [$k] = defined("XOOPS_$k")? constant ("XOOPS_$k"):'';
- Exclude checks
Line indented incorrectly; expected at least 2 tabs, found 1 Open
echo 'error getting DB version';
- Exclude checks
No space found after comma in function call Open
echo xoFormFieldCollation('DB_COLLATION', $vars ['DB_COLLATION'], DB_COLLATION_LABEL, $link, $_GET ['charset'],DB_COLLATION_HELP);
- Exclude checks
Line indented incorrectly; expected 1 tabs, found 2 Open
} catch (PDOException $ex) {
- Exclude checks
Line indented incorrectly; expected 1 tabs, found 2 Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($charset)) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (@empty ($vars ['DB_NAME'])) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (isset ($chars ["utf8"])) {
- Exclude checks
Multi-line function call not indented correctly; expected 16 spaces but found 20 Open
$vars['DB_PASS'],
- Exclude checks
Space before opening parenthesis of function call prohibited Open
unset ($charsets ["utf8"]);
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (!isset ($charsets [$charset])) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
exit ();
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
$result = exec_query("CREATE DATABASE " . sanitize_database( $vars ['DB_NAME'] ), $link);
- Exclude checks
Expected 1 space after ELSE keyword; newline found Open
else
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($error)) {
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 20 Open
));
- Exclude checks
Multi-line function call not indented correctly; expected 16 spaces but found 20 Open
array(
- Exclude checks
Multi-line function call not indented correctly; expected 16 spaces but found 20 Open
$vars['DB_USER'],
- Exclude checks
Space before opening parenthesis of function call prohibited Open
exit ();
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (!isset ($collations [$collation])) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
exit ();
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (!empty ($error)) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (!isset ($vars ['DB_NAME']) || false !== @strpos($_SERVER ['HTTP_CACHE_CONTROL'], 'max-age=0')) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
if (empty ($error)) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
echo xoFormBlockCollation('DB_COLLATION', $vars ['DB_COLLATION'], DB_COLLATION_LABEL, $link, $vars ['DB_CHARSET'], DB_COLLATION_HELP, );
- Exclude checks
The variable $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 $ut8_available is not named in camelCase. Open
function getDbCharsets($link) {
static $charsets = array( );
if ($charsets) {
return $charsets;
}
- Read upRead up
- Exclude checks
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 $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 $db_name is not named in camelCase. Open
function select_db($db_name, $link) {
//if ($link instanceof PDO) {
try {
$link->exec("use `" . $db_name . '`;');
return true;
- Read upRead up
- Exclude checks
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 $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 $ut8_available is not named in camelCase. Open
function getDbCharsets($link) {
static $charsets = array( );
if ($charsets) {
return $charsets;
}
- Read upRead up
- Exclude checks
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 $ut8_available is not named in camelCase. Open
function getDbCharsets($link) {
static $charsets = array( );
if ($charsets) {
return $charsets;
}
- Read upRead up
- Exclude checks
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 $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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 $database_name is not named in camelCase. Open
function sanitize_database($database_name) {
return preg_replace('/[^A-Za-z0-9_]+/', '', $database_name);
}
- Read upRead up
- Exclude checks
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 $collation_default is not named in camelCase. Open
function xoFormFieldCollation($name, $value, $label, $link, $charset, $help = '') {
if (version_compare(getDBVersion($link), "4.1.0", "lt")) {
return "";
}
if (empty ($charset) || !$collations = getDbCollations($link, $charset)) {
- Read upRead up
- Exclude checks
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();
}
}