Showing 278 of 361 total issues
Function buildKeymap
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildKeymap(pairs) {
var map = {
name : "autoCloseBrackets",
Backspace: function(cm) {
if (cm.somethingSelected()) return CodeMirror.Pass;
Function onDrop
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onDrop(e) {
var cm = this;
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
return;
e_preventDefault(e);
Function buildLineContent
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildLineContent(cm, realLine, measure, copyWidgets) {
var merged, line = realLine, empty = true;
while (merged = collapsedSpanAtStart(line))
line = getLine(cm.doc, merged.find().from.line);
Function findBeginningAndEnd
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findBeginningAndEnd(cm, symb, inclusive) {
var cur = cm.getCursor();
var line = cm.getLine(cur.line);
var chars = line.split('');
var start, end, i, len;
Function updateScrollbars
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateScrollbars(cm) {
var d = cm.display, docHeight = cm.doc.height;
var totalHeight = docHeight + paddingVert(d);
d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
Function updateDoc
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {
function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
function update(line, text, spans) {
updateLine(line, text, spans, estimateHeight);
signalLater(line, "change", line, change);
Function moveToWord
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function moveToWord(cm, repeat, forward, wordEnd, bigWord) {
var cur = cm.getCursor();
var curStart = copyCursor(cur);
var words = [];
if (forward && !wordEnd || !forward && wordEnd) {
Function buildToken
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildToken(builder, text, style, startStyle, endStyle, title) {
if (!text) return;
var special = builder.cm.options.specialChars;
if (!special.test(text)) {
builder.col += text.length;
Function paste
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
paste: function(cm, actionArgs) {
var cur = cm.getCursor();
var register = vimGlobalState.registerController.getRegister(
actionArgs.registerName);
if (!register.text) {
Function destroy
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
destroy: function() {
$.Widget.prototype.destroy.call(this);
this.element.unbind('.tagit');
this.tagList.unbind('.tagit');
Function setTagIt
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setTagIt(){
$('[data-toggle="tagit"]').each(function(){
var data_source = $(this).data('source');
var callback_after_add = $(this).data('after-add');
Function indentLine
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function indentLine(cm, n, how, aggressive) {
var doc = cm.doc;
if (how == null) how = "add";
if (how == "smart") {
if (!cm.doc.mode.indent) how = "prev";
Function coordsCharInner
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function coordsCharInner(cm, lineObj, lineNo, x, y) {
var innerOff = y - heightAtLine(cm, lineObj);
var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
var measurement = measureLine(cm, lineObj);
Function clear
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
TextMarker.prototype.clear = function() {
if (this.explicitlyCleared) return;
var cm = this.doc.cm, withOp = cm && !cm.curOp;
if (withOp) startOperation(cm);
if (hasHandler(this, "clear")) {
Function pushText
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pushText: function(registerName, operator, text, linewise) {
if (linewise && text.charAt(0) == '\n') {
text = text.slice(1) + '\n';
}
if(linewise && text.charAt(text.length - 1) !== '\n'){
Function CodeMirror
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function CodeMirror(place, options) {
if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
this.options = options = options || {};
// Determine effective options based on given values and defaults.
Function repeatLastEdit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
var macroModeState = vimGlobalState.macroModeState;
macroModeState.inReplay = true;
var isAction = !!vim.lastEditActionCommand;
var cachedInputState = vim.inputState;
Consider simplifying this complex logical expression. Open
Open
if (cur &&
(hist.lastOp == opId ||
hist.lastOrigin == change.origin && change.origin &&
((change.origin.charAt(0) == "+" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) ||
change.origin.charAt(0) == "*"))) {
Function readInput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readInput(cm) {
var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;
if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
input.value = input.value.substring(0, input.value.length - 1);
Function highlightWorker
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function highlightWorker(cm) {
var doc = cm.doc;
if (doc.frontier < doc.first) doc.frontier = doc.first;
if (doc.frontier >= cm.display.showingTo) return;
var end = +new Date + cm.options.workTime;