Showing 340 of 6,870 total issues
Function success
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
success: function(result) {
//if (result.paserResponse.validation) {
data = result;
//result.computeResponse.matches
if (!onlyTotal) {
Function getChildren
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getChildren = function(conceptId, forceShow) {
if (typeof panel.options.selectedView == "undefined") {
panel.options.selectedView = "inferred";
}
File util.js
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by alo on 7/18/14.
*/
icon = document.createElement("img");
channel = postal.channel("Selections");
Function debounce
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function debounce(func, wait, options) {
var args,
maxTimeoutId,
result,
stamp,
Function anonymous
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return new yy.ProgramNode($$[$0-1], this._$);
Function load
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
load: function(url, settings) {
settings = (typeof settings == 'boolean' ? {addTo: settings} :
(typeof settings == 'function' ? {onLoad: settings} :
(typeof settings == 'string' ? {parent: settings} :
(typeof settings == 'object' && settings.nodeName ? {parent: settings} :
Function prop
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.i18n.prop = function(key /* Add parameters as function arguments as necessary */) {
var value = $.i18n.map[key];
if (value == null)
return '[' + key + ']';
Function anonymous
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
Function getParent
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getParent = function(conceptId, target) {
if (xhrParents != null) {
xhrParents.abort();
//console.log("aborting children call...");
};
Function getExpressionForCondition
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getExpressionForCondition = function(condition, htmlFormat, fullSyntax) {
var grammar = "";
var operator = "";
if (condition.criteria == "self") {
if (fullSyntax) {
Function favoritePanel
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function favoritePanel(divElement, options) {
var panel = this;
this.divElement = divElement;
this.options = jQuery.extend(true, {}, options);
var favoriteCall = null;
Function refsetPanel
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
function refsetPanel(divElement, options) {
var panel = this;
this.divElement = divElement;
this.options = jQuery.extend(true, {}, options);
var favoriteCall = 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"
Further reading
Function registerDefaultHelpers
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(arg) {
if(arguments.length === 2) {
return undefined;
} else {
Function renderExpression
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var renderExpression = function(concept, inferredConcept, div, options) {
var preCoordinatedHtml = referenceToExpression(concept);
var tmp = document.createElement("DIV");
tmp.innerHTML = preCoordinatedHtml;
var plainPreCoordinatedExpression = tmp.textContent || tmp.innerText || "";
File jquery.i18n.properties-1.0.9.js
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/******************************************************************************
* jquery.i18n.properties
*
* Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
* MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Function getReferences
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getReferences = function(conceptId) {
$("#references-" + panel.divElement.id + "-accordion").html("<i class='glyphicon glyphicon-refresh icon-spin'></i>");
//console.log(options.serverUrl + "/" + options.edition + "/" + options.release + "/concepts/" + conceptId + "/references");
if (xhrReferences != null) {
xhrReferences.abort();
Function connectElements
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function connectElements(svg, fig1, fig2, side1, side2, endMarker) {
var rect1cx = fig1.getBBox().x;
var rect1cy = fig1.getBBox().y;
var rect1cw = fig1.getBBox().width;
var rect1ch = fig1.getBBox().height;
Function setElementPosition
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Notification.prototype.setElementPosition = function() {
var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, wrapPos, _i, _j, _len, _len1, _ref;
position = this.getPosition();
pMain = position[0], pAlign = position[1], pArrow = position[2];
elemPos = this.elem.position();
Function baseClone
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
Function template
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function template(text, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT