Showing 113 of 1,244 total issues
Avoid deeply nested control flow statements. Open
Open
if (el.options[i].value != '') {
el.value = el.options[i].value;
break; // loop exit
}
Function validate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function validate(elName, elType, prevent, disablecat, elMsg) {
Method addProxySettings
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function addProxySettings($server, $port = 3128, $wrapper = 'http', $username = null, $password = null)
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function update($type = 'log', $period = 0, $value = null, $increment = false, $link = '')
Method delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function delete($type = 'log', $period = 0, $limitDel = 0, $criteria = null, $asObject = false)
Function updateCache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function updateCache()
{
$lockfile = $this->cacheDir . 'cache.lock';
$lockRes = fopen($lockfile, 'w+');
- 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 ToggleBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function ToggleBlock(blockid, icon, src_expand, src_collapse, alt_expand, alt_collapse, class_expand, class_collapse) {
var Img_tag = 'IMG';
var el = document.getElementById(blockid);
if (el.className == class_expand) {
el.className = class_collapse;
- 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
Avoid too many return
statements within this method. Open
Open
return '';
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return $newFile;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $newFile;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return 0;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $object->getVar($this->keyName);
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $mergeFile;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $sets;