Method languageList
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
Function languageList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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
The function languageList() has 105 lines of code. Current threshold is set to 100. Avoid really long methods. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- Exclude checks
The function languageList() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 47 and the first side effect is on line 31. Open
<?php
- Exclude checks
There must be one USE keyword per declaration Open
use XoopsModules\Xlanguage\{Helper,
- Exclude checks
Line exceeds 120 characters; contains 181 characters Open
echo "<td class='$class' ><img src='" . XOOPS_URL . '/modules/xlanguage/assets/images/' . $lang_image . "' alt='" . $lang['base']->getVar('lang_desc') . "'></td>\n";
- Exclude checks
Line exceeds 120 characters; contains 191 characters Open
xoops_confirm(['op' => 'del', 'type' => Request::getString('type', 0, 'GET'), 'lang_id' => Request::getInt('lang_id', 0, 'GET'), 'ok' => 1], 'main.php', _AM_XLANGUAGE_DELETE_CFM);
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
echo "<td class='$class' ><img src='" . XOOPS_URL . '/modules/xlanguage/assets/images/' . $lang_image . "' alt='" . $ext->getVar('lang_desc') . "'></td>\n";
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$lang_base = $isOrphan ? "<span style='color:#ff0000'>" . $ext->getVar('lang_base') . '</span>' : $ext->getVar('lang_base');
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
if (is_readable(XOOPS_ROOT_PATH . '/modules/xlanguage/assets/images/' . $lang['base']->getVar('lang_image'))) {
- Exclude checks
Line exceeds 120 characters; contains 210 characters Open
echo '<b>' . $configfile_status . '</b>: ' . \XLANGUAGE_CONFIG_FILE . " (<a href='main.php?op=createconfig' title='" . _AM_XLANGUAGE_CREATECONFIG . "'>" . _AM_XLANGUAGE_CREATECONFIG . "</a>)<br><br>\n";
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>"
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$configfile_status = (@is_readable(\XLANGUAGE_CONFIG_FILE)) ? _AM_XLANGUAGE_CONFIGOK : _AM_XLANGUAGE_CONFIGNOTOK;
- Exclude checks
The variable $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_name is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_list is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_list is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_list is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_list is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_base is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_name is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_list is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_image is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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 $lang_base is not named in camelCase. Open
function languageList(LanguageHandler $languageHandler)
{
// global $languageHandler, $xoopsModule;
global $pathIcon16;
- 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();
}
}