Showing 278 of 361 total issues
Function CodeMirror
has a Cognitive Complexity of 3567 (exceeds 5 allowed). Consider refactoring. Open
Open
window.CodeMirror = (function() {
"use strict";
// BROWSER SNIFFING
- 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 CodeMirror
has 4955 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.CodeMirror = (function() {
"use strict";
// BROWSER SNIFFING
File codemirror.js
has 4958 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// CodeMirror version 3.20
//
// CodeMirror is the only global var we claim
window.CodeMirror = (function() {
"use strict";
Function Vim
has 2825 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Vim = function() {
CodeMirror.defineOption('vimMode', false, function(cm, val) {
if (val) {
cm.setOption('keyMap', 'vim');
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
File vim.js
has 3082 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Supported keybindings:
*
* Motion:
* h, j, k, l
Function _create
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
// for handling static scoping inside callbacks
var that = this;
// There are 2 kinds of DOM nodes this widget can be instantiated on:
File jquery_tag_it.js
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery UI Tag-it!
*
* @version v2.0 (06/2011)
*
Function evalInput
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
evalInput: function(cm, vim) {
// If the motion comand is set, execute both the operator and motion.
// Otherwise return.
var inputState = vim.inputState;
var motion = inputState.motion;
Function onMouseDown
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onMouseDown(e) {
if (signalDOMEvent(this, e)) return;
var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
sel.shift = e.shiftKey;
Function registerEventHandlers
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerEventHandlers(cm) {
var d = cm.display;
on(d.scroller, "mousedown", operation(cm, onMouseDown));
if (ie)
on(d.scroller, "dblclick", operation(cm, function(e) {
`` has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
File emacs.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function() {
"use strict";
var Pos = CodeMirror.Pos;
function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
Function bidiOrdering
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var bidiOrdering = (function() {
// Character types for codepoints 0 to 0xff
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
// Character types for codepoints 0x600 to 0x6ff
var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
Function tokenBase
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenBase(stream, state) {
curPunc = null;
if (stream.sol() && stream.match("=begin") && stream.eol()) {
state.tokenize.push(readBlockComment);
return "comment";
File python.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
CodeMirror.defineMode("python", function(conf, parserConf) {
var ERRORCLASS = 'error';
function wordRegexp(words) {
return new RegExp("^((" + words.join(")|(") + "))\\b");
Function processSearch
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processSearch: function(cm, vim, command) {
if (!cm.getSearchCursor) {
// Search depends on SearchCursor.
return;
}
Function tokenBase
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenBase(stream, state) {
// Handle scope changes
if (stream.sol()) {
var scopeOffset = state.scopes[0].offset;
if (stream.eatSpace()) {
Function doReplace
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,
replaceWith) {
// Set up all the functions.
cm.state.vim.exMode = true;
var done = false;
Function createTag
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createTag: function(value, additionalClass, duringInitialization) {
var that = this;
value = $.trim(value);
Function updateDisplayInner
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateDisplayInner(cm, changes, visible, forced) {
var display = cm.display, doc = cm.doc;
if (!display.wrapper.clientWidth) {
display.showingFrom = display.showingTo = doc.first;
display.viewOffset = 0;