Showing 278 of 361 total issues
Function handleKeyBinding
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleKeyBinding(cm, e) {
// Handle auto keymap transitions
var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;
clearTimeout(maybeTransition);
if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {
Function moveByLines
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
moveByLines: function(cm, motionArgs, vim) {
var cur = cm.getCursor();
var endCh = cur.ch;
// Depending what our last motion was, we may want to do different
// things. If our last motion was moving vertically, we want to
Function readQuoted
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readQuoted(quote, style, embed, unescaped) {
return function(stream, state) {
var escaped = false, ch;
if (state.context.type === 'read-quoted-paused') {
Function removeTag
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeTag: function(tag, animate) {
animate = typeof animate === 'undefined' ? this.options.animate : animate;
tag = $(tag);
Function incrementNumberToken
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
incrementNumberToken: function(cm, actionArgs) {
var cur = cm.getCursor();
var lineStr = cm.getLine(cur.line);
var re = /-?\d+/g;
var match;
Function moveByDisplayLines
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
moveByDisplayLines: function(cm, motionArgs, vim) {
var cur = cm.getCursor();
switch (vim.lastMotion) {
case this.moveByDisplayLines:
case this.moveByScroll:
Function rebaseHistArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function rebaseHistArray(array, from, to, diff) {
for (var i = 0; i < array.length; ++i) {
var sub = array[i], ok = true;
for (var j = 0; j < sub.changes.length; ++j) {
var cur = sub.changes[j];
Consider simplifying this complex logical expression. Open
Open
if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&
!posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
var dragEnd = operation(cm, function(e2) {
if (webkit) display.scroller.draggable = false;
cm.state.draggingText = false;
Consider simplifying this complex logical expression. Open
Open
if (endsAfter || marker.type == "bookmark" && span.from == endCh && (!isInsert || span.marker.insertLeft)) {
var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
(nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,
to: span.to == null ? null : span.to - endCh,
marker: marker});
Consider simplifying this complex logical expression. Open
Open
if (ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) &&
i < text.length - 1 && !/\s/.test(text.charAt(i + 1)))
span.style.whiteSpace = "normal";
Function doReplace
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,
replaceWith) {
Avoid deeply nested control flow statements. Open
Open
if (mayClear) {
signal(m, "beforeCursorEnter");
if (m.explicitlyCleared) {
if (!line.markedSpans) break;
else {--i; continue;}
Function swapcase
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
swapcase: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {
Avoid deeply nested control flow statements. Open
Open
if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
Avoid deeply nested control flow statements. Open
Open
if (m.title && !title) title = m.title;
Avoid deeply nested control flow statements. Open
Open
if (m.className) spanStyle += " " + m.className;
Avoid deeply nested control flow statements. Open
Open
if (!m.atomic) continue;
Avoid deeply nested control flow statements. Open
Open
if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
Avoid deeply nested control flow statements. Open
Open
if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))
collapsed = sp;
Avoid deeply nested control flow statements. Open
Open
while (pos != stop && regexps[i].test(line.charAt(pos))) {
pos += dir;
}