Showing 701 of 9,653 total issues
Function addBindings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addBindings() {
function clickHandler(e) {
// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
// See: http://jacklmoore.com/notes/click-events/
if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
Method get_admin_slide
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function get_admin_slide()
{
// get some slide settings
$imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
$thumb = $imageHelper->get_image_url();
Method objectToArray
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function objectToArray($objects, $externalKeys = [], $format = 's')
{
static $cached;
$ret = [];
Function PclTarHandlerDirCheck
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function PclTarHandlerDirCheck($p_dir)
{
$v_result = 1;
TrFctStart(__FILE__, __LINE__, 'PclTarHandlerDirCheck', (string)$p_dir);
- 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 init
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fancybox.init = function() {
if ($("#fancybox-wrap").length) {
return;
}
Function addImage
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addImage: function(listItem, thumbExists, insert, position) {
var $li = ( typeof listItem === "string" ) ? $(listItem) : listItem;
var $aThumb = $li.find('a.thumb');
var slideUrl = $aThumb.attr('href');
var title = $aThumb.attr('title');
Function historyCheck
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
historyCheck: function(){
// if ((jQuery.browser.msie) && (jQuery.browser.version < 8)) {
if (jQuery.browser.msie) {
// On IE, check for location.hash of iframe
var ihistory = jQuery("#jQuery_history")[0];
Function mfpFastClick
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.mfpFastClick = function(callback) {
return $(this).each(function() {
var elem = $(this),
Function show
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show: function() {
var title = this.getTitle();
if (title && this.enabled) {
var $tip = this.tip();
Method PclTarHandleExtractByIndexList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PclTarHandleExtractByIndexList(
$p_tarname,
$p_index_string,
&$p_list_detail,
$p_path,
Function load
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load : function( source, selector, config ) {
var self = this;
// empty the data array
Function build
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.build = function($this,o,mode,current,incfactor){
$this.find('img').wrap('<div style="display:none"/>').show();
switch(o.size){
case 'small' :
$this.addClass('smallGallery');
Method form
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function form($instance)
{
$selected_slider = 0;
$title = '';
$sliders = false;
Method cat
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function &cat($args)
{
$ret = null;
$files = [];
if (!is_array($args)) {
Function _slide
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _slide = function(params, complete, fade, door) {
var easing = this.getOptions('easing'),
distance = this.getStageWidth(),
from = { left: distance * ( params.rewind ? -1 : 1 ) },
Function _slide
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _slide = function(params, complete, fade, door) {
var easing = this.getOptions('easing'),
distance = this.getStageWidth(),
from = { left: distance * ( params.rewind ? -1 : 1 ) },
Function buildPager
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildPager: function(pager) {
var gallery = this;
var numPages = this.getNumPages();
var page = this.getCurrentPage();
var startIndex = page * this.numThumbs;
Method toString
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toString()
{
$modes = [];
$levels = [
E_USER_NOTICE => 'notice',
Method _createImage
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _createImage($width = -1, $height = -1, $trueColor = null)
{
if (-1 == $width) {
$width = $this->new_x;
}
Method mkDir
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function mkDir($args)
{
$opts = self::_parseArgs($args, 'pm:');
if (PEAR::isError($opts)) {
return self::raiseError($opts);