Showing 759 of 1,838 total issues
Method insertUpdate
has 28 lines of code (exceeds 25 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'));
Method smallworld_remDir
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function smallworld_remDir($userid, $directory, $empty = false)
{
//@todo verify $userid should be int and then sanitize $userid accordingly before
// executing this routine
if (!empty($userid)) {
Function getFileStatus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getFileStatus($file_path, $original_file_path, $redirectFile)
{
global $pathIcon16;
if (empty($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 SmallworldDeleteDirectory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function SmallworldDeleteDirectory($userid)
{
$dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . '/' . $userid . '/';
if (is_dir($dirname)) {
$dir_handle = opendir($dirname);
- 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 Updates
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function Updates($last, $uid, $followers)
{
$uid = (int)$uid;
$query = '';
$hm = \XoopsModules\Smallworld\Helper::getInstance()->getConfig('msgtoshow');
- 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 SmallworldDeleteDirectory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function SmallworldDeleteDirectory($userid)
{
$dirname = XOOPS_ROOT_PATH . '/uploads/albums_smallworld' . '/' . (int)$userid . '/';
if (is_dir($dirname)) {
$dir_handle = opendir($dirname);
- 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 get_file_object
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function get_file_object($file_name)
{
if ($this->is_valid_file_object($file_name)) {
$file = new \stdClass();
$file->name = $file_name;
- 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 _setOption
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setOption: function( key, value ) {
if ( key === "active" ) {
// _activate() will handle invalid values and update this.options
this._activate( value );
return;
Function validate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate(context, index, opt) {
if (!context.is('form')) {
return true;
}
Function top
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
Function preloadRecursive
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
preloadRecursive: function (startIndex, currentIndex) {
// Check if startIndex has been relocated
if (startIndex != this.preloadStartIndex) {
var nextIndex = this.getNextIndex(this.preloadStartIndex);
return this.preloadRecursive(this.preloadStartIndex, nextIndex);
Function getDimensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
Function refresh
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
refresh: function() {
//See #8237 & #8828
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
if ( isDisabled !== this.options.disabled ) {
Function _updateVirtualBoundaries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateVirtualBoundaries: function(forceAspectRatio) {
var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
o = this.options;
b = {
Function left
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Function _setupHeightStyle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setupHeightStyle: function( heightStyle ) {
var maxHeight,
parent = this.element.parent();
if ( heightStyle === "fill" ) {
Function removeTag
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeTag: function (tag, animate) {
animate = typeof animate === 'undefined' ? this.options.animate : animate;
tag = $(tag);
Function setup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
Function validate_field
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate_field(id) {
var self = xoops_smallworld(id).attr("id");
var expression = 'function Validate(){' + options['expression'].replace(/VAL/g, 'xoops_smallworld(\'#' + self + '\').val()') + '} Validate()';
var validation_state = eval(expression);
if (!validation_state) {
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {