app/assets/javascripts/codemirror.sql.custom.js
Function tokenBase
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenBase(stream, state) {
var ch = stream.next();
// call hooks from the mime type
if (hooks[ch]) {
Consider simplifying this complex logical expression. Open
Open
} else if ((((support.nCharCast == true && (ch == "n" || ch == "N"))
|| (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
&& (stream.peek() == "'" || stream.peek() == '"'))) {
// charset casting: _utf8'str', N'str', n'str'
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
Consider simplifying this complex logical expression. Open
Open
} else if (support.binaryNumber == true &&
(((ch == "b" || ch == "B") && stream.match(/^'[01]+'/))
|| (ch == "0" && stream.match(/^b[01]+/)))) {
// bitstring
// ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html
Consider simplifying this complex logical expression. Open
Open
if (support.hexNumber == true &&
((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/))
|| (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) {
// hex
// ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html
Consider simplifying this complex logical expression. Open
Open
} else if ((support.commentHash && ch == "#")
|| (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) {
// 1-line comments
// ref: https://kb.askmonty.org/en/comment-syntax/
stream.skipToEnd();
Avoid too many return
statements within this function. Open
Open
return "variable-2";
Avoid too many return
statements within this function. Open
Open
return "comment";
Avoid too many return
statements within this function. Open
Open
if (atoms.hasOwnProperty(word)) return "atom";
Avoid too many return
statements within this function. Open
Open
return null;
Avoid too many return
statements within this function. Open
Open
return state.tokenize(stream, state);
Avoid too many return
statements within this function. Open
Open
if (keywords.hasOwnProperty(word)) return "keyword";
Avoid too many return
statements within this function. Open
Open
return "variable-3";
Avoid too many return
statements within this function. Open
Open
return "ruby-variable";
Avoid too many return
statements within this function. Open
Open
return "number";
Avoid too many return
statements within this function. Open
Open
if (client.hasOwnProperty(word)) return "string-2";
Avoid too many return
statements within this function. Open
Open
return "comment";
Avoid too many return
statements within this function. Open
Open
return "number";
Avoid too many return
statements within this function. Open
Open
if (builtin.hasOwnProperty(word)) return "builtin";
Avoid too many return
statements within this function. Open
Open
return "keyword";
Avoid too many return
statements within this function. Open
Open
return null;
Avoid too many return
statements within this function. Open
Open
return state.tokenize(stream, state);
Avoid too many return
statements within this function. Open
Open
return null;
Avoid too many return
statements within this function. Open
Open
return "number";