Showing 192 of 366 total issues
Method move
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def move dest, overwrite=false
path = dest.path
# Enforce a '/' at the front.
if path[0] != "/"
path = "/"+path
- 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
Method copy
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def copy dest, overwrite=false
path = dest.path
# Enforce a '/' at the front.
if path[0] != "/"
path = "/"+path
- 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 selectionRestore
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectionRestore: function(sel) {
if (sel.active) {
// Find all #text nodes.
var textNodes = $('.content').find(':not(iframe)').addBack().contents().filter(function() {
return this.nodeType === 3;
Function P
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var P = (function(prototype, ownProperty, undefined) {
// helper functions that also help minification
function isObject(o) { return typeof o === 'object'; }
function isFunction(f) { return typeof f === 'function'; }
Function v_read_delimiter
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function v_read_delimiter (tokens ) {
var v_token = tokens.list[tokens.index] ;
if( ( v_token == null ) ) {
throw "unexpected eof" ;
}
Function createMaterial_
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
createMaterial_: function(materialName) {
// Create material
var mat = this.materialsInfo[materialName];
Function startVoice
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
var startVoice = function() {
lastResults = [];
nodes = [];
recognition = new webkitSpeechRecognition();
Function v_piece_to_mathml
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function v_piece_to_mathml (tokens ) {
var v_token = tokens.list[tokens.index] ;
var v_result = null ;
if( ( v_token == "{" ) ) {
tokens.index++;
- 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
Method get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get(request, response)
raise NotFound unless exist?
if collection?
response.body = "<html><head><style>* {font-family: monospace;} body{background-image: url(/img/logo-github.png);background-repeat:no-repeat;background-position: center center;background-attachment: fixed;}section{background-color: rgba(255,255,255,0.8)}td, th{padding-right: 5px;}th{text-align: left;}</style><body><section>"
response.body << "<h2>Index of #{file_path.escape_html}</h2><hr><table><thead><th>Name</th><th>Size</th><th>Last Modified</th><th>Content Type</th></thead><tbody>"
- 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 P
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function P(_superclass /* = Object */, definition) {
// handle the case where no superclass is given
if (definition === undefined) {
definition = _superclass;
_superclass = Object;
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(ws, data) {
ws.responded = true;
redis.get('doc:' + ws.docId + ':users', function(err, reply) {
var users = {};
if (reply) {
Function unwrapGramp
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_.unwrapGramp = function() {
var gramp = this.parent.parent;
var greatgramp = gramp.parent;
var rightward = gramp[R];
var cursor = this;
Function delegateMouseEvents
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_.delegateMouseEvents = function() {
var ultimateRootjQ = this.root.jQ;
//drag-to-select event handling
this.container.bind('mousedown.mathquill', function(e) {
var rootjQ = $(e.target).closest('.mq-root-block');
Function deleteSide
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_.deleteSide = function(side, outward, cursor) {
var parent = this.parent, sib = this[side], farEnd = parent.ends[side];
if (side === this.side) { // deleting non-ghost of one-sided bracket, unwrap
this.unwrap();
Function data
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.expr[':'].data = function(el, i, match) {
matcher.lastIndex = 0;
var expr = match[3],
Function convert
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert: function(materialsInfo) {
if (!this.options) return materialsInfo;
var converted = {};
Method strip
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.strip(str)
insideString = false
insideComment = false
skipOne = false
ret = ''
Function drawPoints
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawPoints: function(id, canvas) {
var points = exports.points[id];
// Find corners of the drawing
var top, left, bottom, right;
_.each(points, function(point) {
Function relink
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_.relink = function () {
var allCells = this.jQ.find('td');
var firstCellBlock = Node.byId[allCells.first().attr(mqBlockId)];
var lastCellBlock = Node.byId[allCells.last().attr(mqBlockId)];
var firstRow = allCells.eq(0).closest('tr');
Function updateMenu
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateMenu: function() {
$('#slideView').html('');
$(exports.cssScene.children).each(function(index, slideObj) {
var slide = slideObj.element;
var preview = $("<div draggable='true' class='slidePreview " + ($(slide).hasClass('active') ? 'active' : '') + "'><div class='slide'>" + $(slide).html() + '</div></div>');