Showing 200 of 421 total issues
Function init
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( editor ) {
// Register the editing dialog.
CKEDITOR.dialog.add( 'simplebox', this.path + 'dialogs/simplebox.js' );
// Register the simplebox widget.
Function diff
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function diff( o, n ) {
var ns = new Object();
var os = new Object();
for ( var i = 0; i < n.length; i++ ) {
- 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 configFromStringAndFormat
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === utils_hooks__hooks.ISO_8601) {
configFromISO(config);
return;
Function find_longest_match
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.find_longest_match = function (alo, ahi, blo, bhi) {
var a = this.a;
var b = this.b;
var b2j = this.b2j;
var isbjunk = this.isbjunk;
Function enable
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
enable: function () {
enabledRegistry[this.map.id] = this;
this.enabled = true;
//Set flag mentioning that the module is enabling,
Function wrapElement
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
wrapElement: function( element, widgetName ) {
var wrapper = null,
widgetDef,
isInline;
Function get_matching_blocks
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.get_matching_blocks = function () {
if (this.matching_blocks != null) return this.matching_blocks;
var la = this.a.length;
var lb = this.b.length;
Function markup
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
markup = (function () {
// IE does not support gradients with multiple stops, so we need to simulate
// that for the rainbow slider with 8 divs that each have a single gradient
var gradientFix = "";
Function stateUpdater
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stateUpdater( widgetsRepo ) {
var currentlySelected = widgetsRepo.selected,
toBeSelected = [],
toBeDeselected = currentlySelected.slice( 0 ),
focused = null;
Function exec
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
exec: function( editor, commandData ) {
var focused = editor.widgets.focused;
// If a widget of the same type is focused, start editing.
if ( focused && focused.name == widgetDef.name )
focused.edit();
Function diffString2
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function diffString2( o, n ) {
o = o.replace(/\s+$/, '');
n = n.replace(/\s+$/, '');
var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/) );
- 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 update
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
update: function( options ) {
var show = true;
if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
// The idea of cancelable event is to let user create his own way of displaying notification, so if
- 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 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( editor ) {
editor._.notificationArea = new Area( editor );
// Overwrites default `editor.showNotification`.
editor.showNotification = function( message, type, progressOrDuration ) {
Function update
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function( options ) {
var show = true;
if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
// The idea of cancelable event is to let user create his own way of displaying notification, so if
Function createUpcastIterator
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createUpcastIterator( widgetsRepo ) {
var toBeWrapped = [],
upcasts = widgetsRepo._.upcasts,
upcastCallbacks = widgetsRepo._.upcastCallbacks;
Function setupDragHandler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupDragHandler( widget ) {
if ( !widget.draggable )
return;
var editor = widget.editor,
Function copyConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copyConfig(to, from) {
var i, prop, val;
if (typeof from._isAMomentObject !== 'undefined') {
to._isAMomentObject = from._isAMomentObject;
Function get_grouped_opcodes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.get_grouped_opcodes = function (n) {
if (!n) n = 3;
var codes = this.get_opcodes();
if (!codes) codes = [["equal", 0, 1, 0, 1]];
var code, tag, i1, i2, j1, j2;
Function inputToRGB
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var ok = false;
Function init
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
init: function( editor ) {
// Register the editing dialog.
CKEDITOR.dialog.add( 'simplebox', this.path + 'dialogs/simplebox.js' );
// Register the simplebox widget.
- 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"