Showing 177 of 219 total issues
Function CodeMirror
has a Cognitive Complexity of 2984 (exceeds 5 allowed). Consider refactoring. Open
window.CodeMirror = (function() {
"use strict";
// BROWSER SNIFFING
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function CodeMirror
has 3916 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.CodeMirror = (function() {
"use strict";
// BROWSER SNIFFING
File codemirror.js
has 3919 lines of code (exceeds 250 allowed). Consider refactoring. Open
// CodeMirror version 3.01
//
// CodeMirror is the only global var we claim
window.CodeMirror = (function() {
"use strict";
Function Tabs
has a Cognitive Complexity of 275 (exceeds 5 allowed). Consider refactoring. Open
var Tabs = RightJS.Tabs = (function(document, parseInt, RightJS) {
/**
* This module defines the basic widgets constructor
* it creates an abstract proxy with the common functionality
* which then we reuse and override in the actual widgets
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Tabs
has 638 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Tabs = RightJS.Tabs = (function(document, parseInt, RightJS) {
/**
* This module defines the basic widgets constructor
* it creates an abstract proxy with the common functionality
* which then we reuse and override in the actual widgets
Function multiplexingMode
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
CodeMirror.multiplexingMode = function(outer /*, others */) {
// Others should be {open, close, mode [, delimStyle]} objects
var others = Array.prototype.slice.call(arguments, 1);
var n_others = others.length;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File right-tabs-src.js
has 640 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Tabs widget for RightJS (http://rightjs.org/ui/tabs)
*
* Copyright (C) 2009-2010 Nikolay Nemshilov
*/
File css.js
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
CodeMirror.defineMode("css", function(config) {
var indentUnit = config.indentUnit, type;
var atMediaTypes = keySet([
"all", "aural", "braille", "handheld", "print", "projection", "screen",
File javascript.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
// TODO actually recognize syntax of TypeScript constructs
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var jsonMode = parserConfig.json;
Function onMouseDown
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onMouseDown(e) {
var cm = this, display = cm.display, view = cm.view, sel = view.sel, doc = view.doc;
sel.shift = e_prop(e, "shiftKey");
if (eventInWidget(display, e)) {
Function updateDocNoUndo
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateDocNoUndo(cm, from, to, lines, selUpdate, origin) {
var view = cm.view, doc = view.doc, display = cm.display;
if (view.suppressEdits) return;
var nlines = to.line - from.line, firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
Class Page
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class PufferPages::Backends::Page < ActiveRecord::Base
include ActiveUUID::UUID
include PufferPages::Backends::Mixins::Renderable
include PufferPages::Backends::Mixins::Importable
include PufferPages::Backends::Mixins::Localable
Function bidiOrdering
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
var bidiOrdering = (function() {
// Character types for codepoints 0 to 0xff
var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
// Character types for codepoints 0x600 to 0x6ff
var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
Function token
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
token: function(stream, state) {
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
//
// rule** or **ruleset:
Function multiplexingMode
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
CodeMirror.multiplexingMode = function(outer /*, others */) {
// Others should be {open, close, mode [, delimStyle]} objects
var others = Array.prototype.slice.call(arguments, 1);
var n_others = others.length;
File xml.js
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
CodeMirror.defineMode("xml", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var Kludges = parserConfig.htmlMode ? {
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
Function updateDisplayInner
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateDisplayInner(cm, changes, viewPort) {
var display = cm.display, doc = cm.view.doc;
if (!display.wrapper.clientWidth) {
display.showingFrom = display.showingTo = display.viewOffset = 0;
return;
Function charOrdering
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function charOrdering(str) {
if (!bidiRE.test(str)) return false;
var len = str.length, types = [];
for (var i = 0, type; i < len; ++i)
types.push(type = charType(str.charCodeAt(i)));
Function resizing
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
resizing: function(callback) {
var controller = this.tab.main;
if (controller.__working) { return this.resizing.bind(this, callback).delay(100); }
Function registerEventHandlers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerEventHandlers(cm) {
var d = cm.display;
on(d.scroller, "mousedown", operation(cm, onMouseDown));
on(d.scroller, "dblclick", operation(cm, e_preventDefault));
on(d.lineSpace, "selectstart", function(e) {