Showing 955 of 1,787 total issues
Function init
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
init : function(ed) {
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
tinyMCEPopup.resizeToInnerSize();
this.fillClassList('class_list');
- 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 toggle
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PROTOTYPE.toggle = function(state, event) {
var cache = this.cache,
options = this.options,
tooltip = this.tooltip;
File table.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
tinyMCEPopup.requireLangPack();
var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;
function insertTable() {
Function errorHTML
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function errorHTML(e, rootHref) {
var id = 'less-error-message:' + extractId(rootHref || "");
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
var elem = document.createElement('div'), timer, content, errors = [];
var filename = e.filename || rootHref;
Function _assignEvents
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PROTOTYPE._assignEvents = function() {
var options = this.options,
posOptions = options.position,
tooltip = this.tooltip,
Function toCSS
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
root.toCSS = (function (evaluate) {
return function (options, variables) {
options = options || {};
var evaldRoot,
css,
Function load
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load: function(url, settings) {
settings = (typeof settings == 'boolean' ? {addTo: settings} :
(typeof settings == 'function' ? {onLoad: settings} :
(typeof settings == 'string' ? {parent: settings} :
(typeof settings == 'object' && settings.nodeName ? {parent: settings} :
Function send
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function( headers, complete ) {
// Get a new xhr
var xhr = s.xhr(),
handle,
Function trigger
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function( event, data, elem, onlyHandlers ) {
var handle, ontype, cur,
bubbleType, special, tmp, i,
eventPath = [ elem || document ],
type = core_hasOwn.call( event, "type" ) ? event.type : event,
Function joinSelector
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
joinSelector: function (paths, context, selector) {
var i, j, k,
hasParentSelector, newSelectors, el, sel, parentSel,
newSelectorPath, afterParentJoin, newJoinedSelector,
Function setupFormData
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setupFormData() {
var ce = document.getElementById('container'), f = document.forms[0], s, b, i;
// Setup text fields
Function forceRoots
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
forceRoots : function(ed, e) {
var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;
var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid;
// Fix for bug #1863847
Function getBookmark
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getBookmark : function(si) {
var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot(), wb = 0, wa = 0, nv;
sx = vp.x;
sy = vp.y;
File Installer.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
Function Animation
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation( elem, properties, options ) {
var result,
stopped,
index = 0,
length = animationPrefilters.length,
Function _doKeyDown
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_doKeyDown: function(event) {
var onSelect, dateStr, sel,
inst = $.datepicker._getInst(event.target),
handled = true,
isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
Consider simplifying this complex logical expression. Open
Open
if((corner.x === LEFT && realX >= compareX) ||
(corner.x === RIGHT && realX <= compareX) ||
(corner.x === CENTER && (realX < compareX || realX > (result.width - compareX))) ||
(corner.y === TOP && realY >= compareY) ||
(corner.y === BOTTOM && realY <= compareY) ||
Function clean
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
context = context || document;
Function animate
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed( speed, easing, callback );
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
Function moveToBookmark
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
moveToBookmark : function(b) {
var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd, nvl, nv;
function getPos(r, sp, ep) {
var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}, o, v, wa, wb;