Showing 759 of 1,838 total issues
Avoid deeply nested control flow statements. Open
if ( (event.result = ret) === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
if ( rscriptType.test( node.type || "" ) &&
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
if ( node.src ) {
// Optional AJAX dependency, but won't run scripts if not present
Function md5
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
String.prototype.md5 = function () {
var a = function (a, b) {
var c = (a & 65535) + (b & 65535);
var d = (a >> 16) + (b >> 16) + (c >> 16);
return d << 16 | c & 65535
- 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 historyInit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
historyInit: function (callback, src) {
xoops_smallworld.historyCallback = callback;
if (src) xoops_smallworld.historyIframeSrc = src;
var current_hash = location.hash.replace(/\?.*$/, '');
- 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 deeply nested control flow statements. Open
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
Avoid deeply nested control flow statements. Open
} else if (xoops_smallworld.historyBackStack[xoops_smallworld.historyBackStack.length - 1] == undefined && !xoops_smallworld.isFirst) {
// back button has been pushed to beginning and URL already pointed to hash (e.g. a bookmark)
// document.URL doesn't change in Safari
if (location.hash) {
var current_hash = location.hash;
Function easeOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutBack: function (x, t, b, c, d, s) {
Avoid deeply nested control flow statements. Open
if (_part.toLowerCase().indexOf(_request.term.toLowerCase()) != -1) {
_place = xoops_smallworld.trim(_part);
return false; // break
}
Function easeInBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInBack: function (x, t, b, c, d, s) {
Avoid deeply nested control flow statements. Open
switch (col) {
case 0:
calender += ' ui-datepicker-group-first';
cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left');
break;
Function easeInOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutBack: function (x, t, b, c, d, s) {
Avoid deeply nested control flow statements. Open
if (_place_parts[1] != '') {
var _place2 = _place_parts[1].toLowerCase();
var placeresult = xoops_smallworld.trim(_place1);
}
Avoid deeply nested control flow statements. Open
if (_place_parts[1] == undefined) {
var _place2 = '???';
var placeresult = xoops_smallworld.trim(_place1);
}
Avoid deeply nested control flow statements. Open
if (lookAhead("'"))
output += "'";
else
literal = true;
Function create_thumbnail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function create_thumbnail($file_name)
{
$file_path = $this->upload_dir . $file_name;
$thumbnail_path = $this->thumbnails_dir . $file_name;
list($img_width, $img_height) = @getimagesize($file_path);
- 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 sendMails
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function sendMails($fromUserId, $toUserId, $event, $link, array $data)
{
$date = date('m-d-Y H:i:s', time());
$mail = new \XoopsMultiMailer();
$wall = new WallUpdates();
- 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 smallworld_search
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function smallworld_search($queryarray, $andor, $limit, $offset, $userid, $sortby = 'created DESC')
Function usersettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function usersettings($userid)
{
$form = "<div style='display:none'><div class='smallworld_usersetings'>";
$form .= '<fieldset><legend>' . _SMALLWORLD_SHOWIFPUBLICORPRIVATE . '</legend>';
$form .= "<form id='perset'>";
- 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 download
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function download()
{
if (!$this->options['download_via_php']) {
$this->header('HTTP/1.1 403 Forbidden');
- 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"