Showing 192 of 366 total issues
Function animationLoop
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
animationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){
Avoid deeply nested control flow statements. Open
if (pointPosition.x - textWidth < furthestLeft) {
furthestLeft = pointPosition.x - textWidth;
furthestLeftIndex = i;
}
Function drawRoundedRectangle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
drawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){
Avoid deeply nested control flow statements. Open
if (dir === L) children.adopt(dest, dest.ends[R], 0);
else children.adopt(dest, 0, dest.ends[L]);
Method make_collection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def make_collection
raise Conflict unless parent.exist?
if request.body.read.to_s == ''
if exist?
MethodNotAllowed
- 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
Avoid deeply nested control flow statements. Open
if (callback) {
callback(data.property, data.value, data.space);
delete WebSync._configCallbacks[data.id];
}
Avoid deeply nested control flow statements. Open
} else if (change.op === 'add') {
var cur = dom;
var tree = [rootDom, dom];
_.each(parts.slice(0, -1), function(part) {
cur = cur[part];
Method update_login_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_login_methods user
provider_list = get_selected_providers
provider_string = provider_list.join(",")
if provider_list.empty?
flash.now[:danger] = "You have to specify a login method."
- 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
Avoid deeply nested control flow statements. Open
} else if (data.type === 'info') {
WebSync.webSocketFirstTime = false;
WebSync.loadScripts();
WebSync.connection.sendJSON({
type: 'config',
Avoid deeply nested control flow statements. Open
if (change.value === '#text') {
el = document.createTextNode('');
} else {
el = document.createElement(change.value);
var attrs = cur.attributes;
Avoid deeply nested control flow statements. Open
if (data.action === 'sync') {
var elem = WebSync.error('<b>Error</b> ' + data.reason + ' Click to force changes.');
$(elem).click(function() {
$(this).hide();
WebSync.info('Attempting to force changes...');
Avoid deeply nested control flow statements. Open
if (last === 'textContent') {
cur[last] = '';
// Remove all children
} else if (last === 'childNodes') {
Avoid deeply nested control flow statements. Open
if (parent.css('text-indent') === '0px') {
if (parent.attr('contenteditable') === 'true') {
node.wrap("<div style='text-indent: 40px'></div>");
} else {
parent.css({
Consider simplifying this complex logical expression. Open
else if(node.nodeType == node.ELEMENT_NODE) { if(node.tagName == 'TEXTAREA' || node.tagName == 'textarea' ||
node.tagName == 'INPUT' || node.tagName == 'input' ||
node.tagName == 'SCRIPT' || node.tagName == 'script')
return;
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_.init = function(side, open, close, ctrlSeq, end) {
Function calculateScaleRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
Function CatmullRom
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CatmullRom: function(a, c, b, d, e) {
Function load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
load: function(url, mtlurl, onLoad, onProgress, onError) {
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(public_path, path, request, response, options)
Function v_matrix_to_mathml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function v_matrix_to_mathml (tokens , v_open_delim , v_close_delim ) {
var v_mtable = v_matrix_to_mtable (tokens , result_element( "mtable" ,0) ) ;
if( ( ( v_open_delim != null ) || ( v_close_delim != null ) ) ) {
var v_mrow = result_element( "mrow" ,0) ;
if( ( v_open_delim != null ) ) {
- 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"