Showing 759 of 1,838 total issues
Function _refreshItems
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_refreshItems: function (event) {
this.items = [];
this.containers = [this];
var items = this.items;
Function _hideDatepicker
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_hideDatepicker: function (input) {
var inst = this._curInst;
if (!inst || (input && inst != $.data(input, PROP_NAME)))
return;
if (this._datepickerShowing) {
Method smallworld_tolink
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function smallworld_tolink($text, $uid)
{
$helper = Helper::getInstance();
$ext = mb_substr($text, -4, 4);
$ext2 = mb_substr($text, -5, 5);
Method array_to_json
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function array_to_json($array)
{
if (!is_array($array)) {
return false;
}
Function smallworld_includeScripts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function smallworld_includeScripts()
{
/** @var \XoopsModules\Smallworld\Helper $helper */
$helper = Helper::getInstance();
$page = basename($_SERVER['PHP_SELF'], '.php');
- 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 smallworld_sociallinks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function smallworld_sociallinks($num, $name)
{
/** @var \XoopsModules\Smallworld\Helper $helper */
$helper = Helper::getInstance();
switch ($num) {
- 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 smallworld_getAvatarLink
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function smallworld_getAvatarLink($userid, $image)
{
$depMsg = __FUNCTION__ . " is deprecated use SwUserHandler::getAvatarLink() instead.";
if (isset($GLOBALS['xoopsLogger'])) {
$GLOBALS['xoopsLogger']->addDeprecated($depMsg);
- 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 friendcheck
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function friendcheck($user, $userId)
{
$respons = [0 => '']; // init response
if ($user == $userId) {
$respons[0] = 2;
- 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 school_add
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$class,
$name,
$name2,
$rel,
array $options,
Method job
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$class,
$name,
$name2,
$rel,
$textmore,
Function delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function delete($print_response = true)
{
$userid = $GLOBALS['xoopsUser']->getVar('uid');
$swDB = new SwDatabase();
$file_name = $this->get_file_name_param();
- 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 insertUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function insertUpdate($uid, $update, $priv = 0)
{
$uid = (int)$uid;
$priv = (int)$priv;
$update = smallworld_sanitize(htmlentities($update, ENT_QUOTES, 'UTF-8'));
- 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 xoops_module_update_smallworld
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function xoops_module_update_smallworld(\XoopsModule $module)
{
$tables = new \Xmf\Database\Tables();
$cTable = 'config';
- 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 rrmdir
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function rrmdir($src)
{
// Only continue if user is a 'global' Admin
if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
return false;
- 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 left
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
Function _attachHandlers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_attachHandlers: function(inst) {
var stepMonths = this._get(inst, "stepMonths"),
id = "#" + inst.id.replace( /\\\\/g, "\\" );
inst.dpDiv.find("[data-handler]").map(function () {
var handler = {
Function SmallworldGetMoreMsg
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SmallworldGetMoreMsg() {
xoops_smallworld('.smallworld_msg_counter:last').show();
xoops_smallworld('.smallworld_msg_counter').on('click', function (e) {
e.preventDefault();
xoops_smallworld('#smallworld_moremsg_ajax').show();
Function offsetString
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
offsetString = function(offset) {
try {
return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
offset, $.datepicker._getFormatConfig(inst));
}
Function ajaxForm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.ajaxForm = function (options) {
return this.ajaxFormUnbind().bind('submit.form-plugin', function (e) {
e.preventDefault();
$(this).ajaxSubmit(options);
}).bind('click.form-plugin', function (e) {
Function option
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
option: function( key, value ) {
var options = key,
parts,
curOption,
i;