Showing 390 of 605 total issues
Function createSWF
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
Function _attributeTranslations
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Element._attributeTranslations = (function(){
var classProp = 'className',
forProp = 'for',
el = document.createElement('div');
Function Enumerable
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
var Enumerable = (function() {
function each(iterator, context) {
var index = 0;
try {
this._each(function(value) {
- 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 attachBehaviors
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Spry.Widget.ValidationSelect.prototype.attachBehaviors = function()
{
// find the SELECT element inside current container
if (this.element.nodeName == "SELECT") {
this.selectElement = this.element;
- 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 compare
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
BinaryExpr.prototype.compare = function(ctx, cmp) {
var v1 = this.expr1.evaluate(ctx);
var v2 = this.expr2.evaluate(ctx);
var ret;
Function evaluate
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
StepExpr.prototype.evaluate = function(ctx) {
var input = ctx.node;
var nodelist = [];
// NOTE(mesch): When this was a switch() statement, it didn't work
Function _attributeTranslations
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Element._attributeTranslations = (function(){
var classProp = 'className',
forProp = 'for',
el = document.createElement('div');
- 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 extend
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Element.extend = (function() {
function checkDeficiency(tagName) {
if (typeof window.Element != 'undefined') {
var proto = window.Element.prototype;
- 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 loadData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.HTTPSourceDataSet.LoadManager.loadData = function(reqInfo, ds, useCache)
{
if (!reqInfo)
return 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 Grow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Effect.Grow = function(element) {
element = $(element);
var options = Object.extend({
direction: 'center',
moveTransition: Effect.Transitions.sinoidal,
Function validateIP
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.validateIP = function (value, format)
{
var validIPv6Addresses = [
//preferred
/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}(?:\/\d{1,3})?$/i,
Function punycode_encode
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.Utils.punycode_encode = function (input, max_out) {
var inputc = input.split("");
input = [];
for(var i=0; i<inputc.length; i++) {
input.push(inputc[i].charCodeAt(0));
Function filter
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.DataSet.prototype.filter = function(filterFunc, filterOnly)
{
// This is a non-destructive filter function.
var dataChanged = false;
- 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 recalculateDataSetDependencies
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.HTTPSourceDataSet.prototype.recalculateDataSetDependencies = function()
{
this.hasDataRefStrings = false;
// Clear all old callbacks that may have been registered.
- 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 validation
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
validation: function(value, options) {
var formatRegExp = /^([mdy]+)[\.\-\/\\\s]+([mdy]+)[\.\-\/\\\s]+([mdy]+)$/i;
var valueRegExp = this.dateValidationPattern;
var formatGroups = options.format.match(formatRegExp);
var valueGroups = value.match(valueRegExp);
Function validation
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
validation: function(value, options) {
// HH:MM:SS T
var formatRegExp = /([hmst]+)/gi;
var valueRegExp = /(\d+|AM?|PM?)/gi;
var formatGroups = options.format.match(formatRegExp);
Function init
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.init = function(element, options)
{
this.element = this.getElement(element);
this.errors = 0;
this.flags = {locked: false, restoreSelection: true};
Function findRowsWithColumnValues
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.DataSet.prototype.findRowsWithColumnValues = function(valueObj, firstMatchOnly, unfiltered)
{
var results = [];
var rows = this.getData(unfiltered);
if (rows)
- 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 parseColor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
String.prototype.parseColor = function() {
var color = '#';
if (this.slice(0,4) == 'rgb(') {
var cols = this.slice(4,this.length-1).split(',');
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
- 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 setDimensions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
setDimensions: function(height, width) {
var d = { };
if (this.options.scaleX) d.width = width.round() + 'px';
if (this.options.scaleY) d.height = height.round() + 'px';
if (this.options.scaleFromCenter) {
- 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"