Showing 278 of 361 total issues
Function buildLineElement
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildLineElement(cm, line, lineNo, dims, reuse) {
var built = buildLineContent(cm, line), lineElement = built.pre;
var markers = line.gutterMarkers, display = cm.display, wrap;
var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass;
Function sort
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sort: function(cm, params) {
var reverse, ignoreCase, unique, number;
function parseArgs() {
if (params.argString) {
var args = new CodeMirror.StringStream(params.argString);
Function measureLineInner
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function measureLineInner(cm, line) {
if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom)
return crudelyMeasureLine(cm, line);
var display = cm.display, measure = emptyArray(line.text.length);
Function updateSelectionRange
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateSelectionRange(cm) {
var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
var fragment = document.createDocumentFragment();
var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);
Function createCircularJumpList
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var createCircularJumpList = function() {
var size = 100;
var pointer = -1;
var head = 0;
var tail = 0;
Consider simplifying this complex logical expression. Open
Open
if (
(event.which === $.ui.keyCode.COMMA && event.shiftKey === false) ||
event.which === $.ui.keyCode.ENTER ||
(
event.which == $.ui.keyCode.TAB &&
Function matchCommand
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
matchCommand: function(key, keyMap, vim) {
var inputState = vim.inputState;
var keys = inputState.keyBuffer.concat(key);
var matchedCommands = [];
var selectedCharacter;
Function patchDisplay
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
var dims = getDimensions(cm);
var display = cm.display, lineNumbers = cm.options.lineNumbers;
if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
removeChildren(display.lineDiv);
File bootstrap_tooltip.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ===========================================================
* bootstrap-tooltip.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame
* ===========================================================
Function insertLineContent
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function insertLineContent(line, builder, styles) {
var spans = line.markedSpans, allText = line.text, at = 0;
if (!spans) {
for (var i = 1; i < styles.length; i+=2)
builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));
Function markText
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function markText(doc, from, to, options, type) {
if (options && options.shared) return markTextShared(doc, from, to, options, type);
if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);
var marker = new TextMarker(doc, type);
Function token
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
token: function(stream, state) {
var ch = stream.peek();
var esc = state.escaped;
state.escaped = false;
/* comments */
Function findWord
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
var lineNum = cur.line;
var pos = cur.ch;
var line = cm.getLine(lineNum);
var dir = forward ? 1 : -1;
Function endOperation
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function endOperation(cm) {
var op = cm.curOp, doc = cm.doc, display = cm.display;
cm.curOp = null;
if (op.updateMaxLine) computeMaxLength(cm);
Function stretchSpansOverChange
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function stretchSpansOverChange(doc, change) {
var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
if (!oldFirst && !oldLast) return null;
Function onContextMenu
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onContextMenu(cm, e) {
if (signalDOMEvent(cm, e, "contextmenu")) return;
var display = cm.display, sel = cm.doc.sel;
if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;
Function onScrollWheel
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onScrollWheel(cm, e) {
var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
else if (dy == null) dy = e.wheelDelta;
Function buildVimKeyMap
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildVimKeyMap() {
/**
* Handle the raw key event from CodeMirror. Translate the
* Shift + key modifier to the resulting letter, while preserving other
* modifers.
Function makeDisplay
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeDisplay(place, docStart) {
var d = {};
var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");
if (webkit) input.style.width = "1000px";
Function substitute
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
substitute: function(cm, params) {
if (!cm.getSearchCursor) {
throw new Error('Search feature not available. Requires searchcursor.js or ' +
'any other getSearchCursor implementation.');
}