Showing 759 of 1,838 total issues
Function formToWizard
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
xoops_smallworld.fn.formToWizard = function (options) {
options = xoops_smallworld.extend({
submitButton: ""
}, options);
Function bounce
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var effectBounce = $.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
// defaults:
Function resize
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resize: function() {
var outerDimensions,
that = $(this).resizable( "instance" ),
o = that.options,
cs = that.size,
Function _mouseStart
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_mouseStart: function (event, overrideHandle, noActivation) {
var o = this.options, self = this;
this.currentContainer = this;
Method truncateHtml
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
{
if ($considerHtml) {
// if the plain text is shorter than the maximum length, return the whole text
if (mb_strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Method fetchURL
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fetchURL($url, $methods = ['fopen', 'curl', 'socket'])
{
/**
* December 21st 2010, Mathew Tinsley (tinsley@tinsology.net)
* http://tinsology.net
Function _showDatepicker
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
input = $("input", input.parentNode)[0];
}
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
Function fail
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fail: function (e, data) {
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
template,
deferred;
Function _generateMonthYearHeader
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function (inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
var changeMonth = this._get(inst, 'changeMonth');
var changeYear = this._get(inst, 'changeYear');
var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
Method smallworld_search
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function smallworld_search($queryarray, $andor, $limit, $offset, $userid, $sortby = 'created DESC')
{
$moduleDirName = basename(dirname(__DIR__));
if (file_exists(XOOPS_ROOT_PATH . '/modules/smallworld/language/' . $GLOBALS['xoopsConfig']['language'] . '/main.php')) {
Function deleteDirectory
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function deleteDirectory($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 create_scaled_image
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function create_scaled_image($file_name, $version, $options)
{
$file_path = $this->get_upload_path($file_name);
if (!empty($version)) {
$version_dir = $this->get_upload_path(null, $version);
- 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 keydown
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
keydown: function( event ) {
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );
switch ( event.keyCode ) {
Function submit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
submit: function () {
var self = this, settings = this._settings;
if (this._input.value === '') {
// there is no file
Function init
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init = jQuery.fn.init = function( selector, context ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, callback ) {
// Flatten any nested arrays
args = concat.apply( [], args );
Function send
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
var i,
xhr = options.xhr(),
id = ++xhrId;
Function drag
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drag: function( event, ui, inst ) {
var ts, bs, ls, rs, l, r, t, b, i, first,
o = inst.options,
d = o.snapTolerance,
Function cb
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cb() {
if (cbInvoked)
return;
var ok = true;