Showing 192 of 366 total issues
Function draw
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw : function(ease){
var easingDecimal = ease || 1;
this.clear();
var ctx = this.chart.ctx;
Function TextPiece
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
var TextPiece = P(Node, function(_, super_) {
_.init = function(text) {
super_.init.call(this);
this.text = text;
};
Function wsConnection
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wsConnection(ws) {
console.log('Connection: ', ws.upgradeReq.url);
var url = ws.upgradeReq.url;
var base = url.split('?')[0];
var parts = base.split('/');
Function v_piece_to_mathml
has 71 lines of code (exceeds 25 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++;
Function saneKeyboardEvents
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function saneKeyboardEvents(el, handlers) {
var keydown = null;
var keypress = null;
var textarea = jQuery(el);
Function MathBlock
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
var MathBlock = P(MathElement, function(_, super_) {
_.join = function(methodName) {
return this.foldChildren('', function(fold, child) {
return fold + child[methodName]();
});
Function patch_img
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function patch_img(node)
{
if(node.currentTarget)
node = node.currentTarget;
- 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 draw
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw : function(){
var ctx = this.ctx,
yLabelGap = (this.endPoint - this.startPoint) / this.steps,
xStart = Math.round(this.xScalePaddingLeft);
if (this.display){
Function initialize
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(data){
//Expose options as a scope variable here so we can access it in the ScaleClass
var options = this.options;
Function CatmullRom
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
CatmullRom: function(a, c) {
var b = a.length - 1,
d = b * c,
e = Math.floor(d),
g = TWEEN.Interpolation.Utils.CatmullRom;
- 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 Letter
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Letter = P(Variable, function(_, super_) {
_.init = function(ch) { return super_.init.call(this, this.letter = ch); };
_.createLeftOf = function(cursor) {
var autoCmds = cursor.options.autoCommands, maxLength = autoCmds._maxLength;
if (maxLength > 0) {
Function patch_img
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function patch_img(node)
{
if(node.currentTarget)
node = node.currentTarget;
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(ws, data) {
var sendFile = function(result) {
crypto.randomBytes(16, function(err, buf) {
var token = buf.toString('hex');
var address = 'websync:document_export:' + ws.docId + ':' + token;
Method file_query
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def file_query public: false, text: '', offset: 0, deleted: false, sort_type: 'date', sort_dir: 'desc'
# TODO: Implement offset
query = "document_#{public ? 'public' : 'private'}_search"
params = [text, deleted, sort_type, sort_dir]
params.push(current_user.email) if !public
- 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 getCellData
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
getCellData: function(range) {
var bits = range.split('.');
var table; // = exports.primaryTable();
if (bits.length >= 2) {
var name = bits[0];
Function latexMathParser
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var latexMathParser = (function() {
function commandToBlock(cmd) {
var block = MathBlock();
cmd.adopt(block, 0, 0);
return block;
Method strip
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.strip(str)
insideString = false
insideComment = false
skipOne = false
ret = ''
- 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 calculateScaleRange
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
//Set a minimum step of two - a point at the top of the graph, and a point at the base
var minSteps = 2,
maxSteps = Math.floor(drawingSize/(textSize * 1.5)),
Function EditableField
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
var EditableField = MathQuill.EditableField = P(AbstractMathQuill, function(_) {
_.initRootAndEvents = function(root, el, opts) {
this.initRoot(root, el, opts);
this.__controller.editable = true;
this.__controller.delegateMouseEvents();
Function initialize
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(data){
//Declare the extension of the default point, to cater for the options passed in to the constructor
this.PointClass = Chart.Point.extend({
strokeWidth : this.options.pointDotStrokeWidth,
radius : this.options.pointDotRadius,