Showing 460 of 700 total issues
Function before
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
before: function before() {
var _this = this;
var module = this.module;
var notStartedModules = getNotStartedModules(module); // ensure the callbacks are executed serially for each module
Consider simplifying this complex logical expression. Open
Open
if ( ( !support.boxSizingReliable() && isBorderBox ||
// Support: IE 10 - 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
Function nodeKeydown
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nodeKeydown: function (ctx) {
var nextNode = null,
nextIdx = null,
tree = ctx.tree,
node = ctx.node,
Function left
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
Function showHide
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showHide( elements, show ) {
var display, elem,
values = [],
index = 0,
length = elements.length;
Function left
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
Function left
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
Function cookie
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var config = $.cookie = function (key, value, options) {
// write
if (value !== undefined) {
options = $.extend({}, config.defaults, options);
Function diffLinesToChars
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DiffMatchPatch.prototype.diffLinesToChars = function (text1, text2) {
var lineArray, lineHash, chars1, chars2;
lineArray = []; // E.g. lineArray[4] === 'Hello\n'
lineHash = {}; // E.g. lineHash['Hello\n'] === 4
Function evalEffectModifiers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function evalEffectModifiers(tree, event, effectDefault) {
var res = effectDefault;
if (isMac) {
if (event.metaKey && event.altKey) {
Function _createWidget
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widgetUuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Function getEventTarget
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getEventTarget: function (event) {
var $target,
tree,
tcn = event && event.target ? event.target.className : "",
res = { node: this.getNode(event.target), type: undefined };
Function nodeRemoveChild
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
nodeRemoveChild: function (ctx, childNode) {
var idx,
node = ctx.node,
// opts = ctx.options,
subCtx = $.extend({}, ctx, { node: childNode }),
Function _initViewportWrapper
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function () {
var // wrapper = this.scrollWrapper,
// $wrapper = $(wrapper),
tree = this;
Function handler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handler: function( event ) {
var notAsync, result,
saved = dataPriv.get( this, type );
if ( ( event.isTrigger & 1 ) && this[ type ] ) {
Function _createWidget
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widgetUuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Function _createWidget
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widgetUuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Function DiffMain
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DiffMatchPatch.prototype.DiffMain = function (text1, text2, optChecklines) {
var deadline, checklines, commonlength, commonprefix, commonsuffix, diffs; // The diff must be complete in up to 1 second.
deadline = new Date().getTime() + 1000; // Check for null inputs.
Function processModule
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function processModule(name, options, executeNow) {
var modifiers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
if (typeof options === 'function') {
executeNow = options;
Function needsSignature
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
function needsSignature(doclet) {
var needsSig = false;
// function and class definitions always get a signature
if (doclet.kind === 'function' || doclet.kind === 'class') {
- 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"