Showing 759 of 1,838 total issues
Method smallworld_time_stamp
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function smallworld_time_stamp($session_time)
{
$time_difference = time() - $session_time;
$seconds = $time_difference;
$minutes = round($time_difference / 60);
Function handle_file_upload
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
private function handle_file_upload($uploaded_file, $name, $size, $type, $error)
{
$file = new \stdClass();
$swDB = new SwDatabase();
$userid = ($GLOBALS['xoopsUser'] && ($GLOBALS['xoopsUser'] instanceof \XoopsUser)) ? $GLOBALS['xoopsUser']->uid() : 0;
- 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 createAlbum
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public function createAlbum($userId)
{
//@todo change $dir to XOOPS_UPLOAD_PATH . /smallworld/albums/[$userId]
$dir = XOOPS_UPLOAD_PATH . '/albums_smallworld';
if (!file_exists($dir . '/' . $userId . '/thumbnails') || !file_exists($dir . '/' . $userId . '/')) {
- 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 addImage
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addImage: function (listItem, thumbExists, insert, position) {
var xoops_smallworldli = (typeof listItem === "string") ? xoops_smallworld(listItem) : listItem;
var xoops_smallworldaThumb = xoops_smallworldli.find('a.thumb');
var slideUrl = xoops_smallworldaThumb.attr('href');
var title = xoops_smallworldaThumb.attr('title');
Function scale
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var effectScale = $.effects.effect.scale = function( o, done ) {
// Create element
var el = $( this ),
options = $.extend( true, {}, o ),
Function internalData
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function select
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
select = Sizzle.select = function( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( (selector = compiled.selector || selector) );
Function source
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
source: function (_request, _response) {
if (_request.term in this.options._cache) {
_response(this.options._cache[_request.term]);
} else {
var self = this;
Function _generatePosition
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generatePosition: function(event) {
var top, left,
o = this.options,
pageX = event.pageX,
Function bridge
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
Function _createWrapper
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWrapper: function() {
this.uiDialog = $("<div>")
.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
this.options.dialogClass )
.hide()
Function _toggle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
toHide = eventData.oldPanel;
Function fold
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var effectFold = $.effects.effect.fold = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
Function tokenize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
Function matcherFromTokens
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
Function historyCheck
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
historyCheck: function () {
// if ((xoops_smallworld.browser.msie) && (xoops_smallworld.browser.version < 8)) {
if (xoops_smallworld.browser.msie) {
// On IE, check for location.hash of iframe
var ihistory = xoops_smallworld("#xoops_smallworld_history")[0];
Function explode
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.effects.explode = function (o) {
return this.queue(function () {
var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
Method smallworld_userDefaultNull
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function smallworld_userDefaultNull()
{
global $xoopsDB;
$sql = "ALTER TABLE " . $xoopsDB->prefix('smallworld_user') . " CHANGE `id` `id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
CHANGE `userimage` `userimage` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
Method getDirectoryStatus
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getDirectoryStatus($path, $mode = 0777, $redirectFile = null)
{
global $pathIcon16;
if (empty($path)) {
Method smallworld_SetCoreScript
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function smallworld_SetCoreScript()
{
/** @var \XoopsModules\Smallworld\Helper $helper */
$helper = Helper::getInstance();