Showing 278 of 361 total issues
Function tokenBase
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenBase(stream, state) {
stream.eatWhile(/[\w\$_]/);
Function runMode
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CodeMirror.runMode = function(string, modespec, callback, options) {
var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
var ie = /MSIE \d/.test(navigator.userAgent);
var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
Function toggleVisualMode
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggleVisualMode: function(cm, actionArgs, vim) {
var repeat = actionArgs.repeat;
var curStart = cm.getCursor();
var curEnd;
// TODO: The repeat should actually select number of characters/lines
Function expandWordUnderCursor
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
var cur = cm.getCursor();
var line = cm.getLine(cur.line);
var idx = cur.ch;
Function findSymbol
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findSymbol(cm, repeat, forward, symb) {
var cur = cm.getCursor();
var increment = forward ? 1 : -1;
var endLine = forward ? cm.lineCount() : -1;
var curCh = cur.ch;
Function runMode
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CodeMirror.runMode = function (string, modespec, callback, options) {
var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);
if (callback.nodeType == 1) {
var tabSize = (options && options.tabSize) || 4;
Function fileTree
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fileTree: function(o, h) {
// Defaults
if( !o ) var o = {};
if( o.root == undefined ) o.root = '/';
if( o.script == undefined ) o.script = 'jqueryFileTree.php';
Function tokenLexer
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenLexer(stream, state) {
indentInfo = null;
var style = state.tokenize(stream, state);
var current = stream.current();
Function skipAtomic
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function skipAtomic(doc, pos, bias, mayClear) {
var flipped = false, curPos = pos;
var dir = bias || 1;
doc.cantEdit = false;
search: for (;;) {
Function fromTextArea
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CodeMirror.fromTextArea = function(textarea, options) {
if (!options) options = {};
options.value = textarea.value;
if (!options.tabindex && textarea.tabindex)
options.tabindex = textarea.tabindex;
Function processCommand
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processCommand: function(cm, input) {
var vim = cm.state.vim;
if (vim.visualMode) {
exitVisualMode(cm);
}
Function handleKey
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleKey: function(cm, key) {
var command;
var vim = maybeInitVimState(cm);
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.enteredMacroMode) {
Function findMatchedSymbol
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findMatchedSymbol(cm, cur, symb) {
var line = cur.line;
var ch = cur.ch;
symb = symb ? symb : cm.getLine(line).charAt(ch);
Function show
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var $tip
, pos
, actualWidth
, actualHeight
Consider simplifying this complex logical expression. Open
Open
if (startsBefore ||
(marker.inclusiveLeft && marker.inclusiveRight || marker.type == "bookmark") &&
span.from == startCh && (!isInsert || !span.marker.insertLeft)) {
var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
(nw || (nw = [])).push({from: span.from,
Consider simplifying this complex logical expression. Open
Open
if (opts) {
opts = opts[0];
ignoreCase = opts.indexOf('i') != -1;
unique = opts.indexOf('u') != -1;
var decimal = opts.indexOf('d') != -1 && 1;
Consider simplifying this complex logical expression. Open
Open
if (tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
tok.type == "tag" && state.type == "closeTag" ||
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
return CodeMirror.Pass;
Function findPosH
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function findPosH(doc, pos, dir, unit, visually) {
var line = pos.line, ch = pos.ch, origDir = dir;
var lineObj = getLine(doc, line);
var possible = true;
function findNextLine() {
Function delmarks
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
delmarks: function(cm, params) {
if (!params.argString || !params.argString.trim()) {
showConfirm(cm, 'Argument required');
return;
}
Function makeChangeSingleDocInEditor
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeChangeSingleDocInEditor(cm, change, spans, selAfter) {
var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
var recomputeMaxLength = false, checkWidthStart = from.line;
if (!cm.options.lineWrapping) {