Showing 1,798 of 3,223 total issues
Function _create
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
Function _create
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
File wp-fullscreen.js
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global ajaxurl, deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit, wp_fullscreen_settings, wpActiveEditor:true, wpLink */
/**
* PubSub
*
* A lightweight publish/subscribe implementation.
Function tb_show
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
try {
if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
jQuery("body","html").css({height: "100%", width: "100%"});
File jquery.ui.menu.js
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* jQuery UI Menu 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
File autosave.js
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global switchEditors, autosaveL10n, tinymce, ajaxurl, wpAjax, makeSlugeditClickable, wpCookies */
var autosave, autosavePeriodical, fullscreen, doPreview,
autosaveLast = '',
autosaveDelayPreview = false,
notSaved = true,
Function performCaretAction
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function performCaretAction(type, name, vars) {
var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug;
// Creates a caret container bogus element
function createCaretContainer(fill) {
Function parse
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.parse = function(html) {
var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name, isInternalElement, removeInternalElements,
shortEndedElements, fillAttrsMap, isShortEnded, validate, elementRule, isValidElement, attr, attribsValue, invalidPrefixRegExp,
validAttributesMap, validAttributePatterns, attributesRequired, attributesDefault, attributesForced, selfClosing,
tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0, decode = tinymce.html.Entities.decode, fixSelfClosing, isIE;
Function _nodeChanged
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_nodeChanged : function(ed, cm, n, co, ob) {
var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;
tinymce.each(t.stateControls, function(c) {
cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
File edit-comments.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global adminCommentsL10n, thousandsSeparator, list_args, QTags, ajaxurl, wpAjax */
var setCommentsList, theList, theExtraList, commentReply,
toggleWithKeyboard = false;
(function($) {
Function jsDump
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
QUnit.jsDump = (function() {
function quote( str ) {
return '"' + str.toString().replace( /"/g, '\\"' ) + '"';
}
function literal( o ) {
Function suggest
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.suggest = function(input, options) {
var $input, $results, timeout, prevLength, cache, cacheSize;
$input = $(input).attr("autocomplete", "off");
$results = $("<ul/>");
Function insertTable
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function insertTable() {
var formObj = document.forms[0];
var inst = tinyMCEPopup.editor, dom = inst.dom;
var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;
var html = '', capEl, elm;
Function $RouteProvider
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $RouteProvider(){
function inherit(parent, extra) {
return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra);
}
File jquery.ui.autocomplete.js
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* jQuery UI Autocomplete 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
File quicktags.js
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, fullscreen, prompt */
/*
* Quicktags
*
* This is the HTML editor in WordPress. It can be attached to any textarea and will
Function Serializer
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
tinymce.dom.Serializer = function(settings, dom, schema) {
var onPreProcess, onPostProcess, isIE = tinymce.isIE, each = tinymce.each, htmlParser;
// Support the old apply_source_formatting option
if (!settings.apply_source_formatting)
Function MediaType
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
VMM.MediaType = function(_d) {
var d = _d.replace(/^\s\s*/, '').replace(/\s\s*$/, ''),
success = false,
media = {
type: "unknown",
- 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 objectToImg
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
objectToImg : function(node) {
var object, embed, video, iframe, img, name, id, width, height, style, i, html,
param, params, source, sources, data, type, lookup = this.lookup,
matches, attrs, urlConverter = this.editor.settings.url_converter,
urlConverterScope = this.editor.settings.url_converter_scope,
Function init
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function(ed, url) {
var t = this;
t.editor = ed;
t.url = url;