Showing 390 of 605 total issues
Function setup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
setup: function(){
function parseColor(color){
if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
color = color.parseColor();
return $R(0,2).map(function(i){
- 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 Serializers
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Form.Element.Serializers = (function() {
function input(element, value) {
switch (element.type.toLowerCase()) {
case 'checkbox':
case 'radio':
Function piRegions
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
var piRegions = Spry.Utils.getNodesByFunc(rgn, function(node)
{
try
{
if (node.nodeType == 1 /* ELEMENT_NODE */)
Function extend
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Element.extend = (function() {
function checkDeficiency(tagName) {
if (typeof window.Element != 'undefined') {
var proto = window.Element.prototype;
Function onKeyDown
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.onKeyDown = function(e)
{
this.saveState();
this.keyCode = e.keyCode;
Function Class
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Class = (function() {
var IS_DONTENUM_BUGGY = (function(){
for (var p in { toString: 1 }) {
if (p === 'toString') return false;
Consider simplifying this complex logical expression. Open
if (rule &&
(rule == TOK_DIV ||
rule == TOK_MOD ||
rule == TOK_AND ||
rule == TOK_OR) &&
Function filter
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Sizzle.filter = function(expr, set, inplace, not){
var old = expr, result = [], curLoop = set, match, anyFound,
isXMLFilter = set && set[0] && isXML(set[0]);
while ( expr && set.length ) {
File lightbox.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
// -----------------------------------------------------------------------------------
//
// Lightbox v2.05
// by Lokesh Dhakar - http://www.lokeshdhakar.com
// Last Modification: 3/18/11
Function applyColumnTypes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.DataSet.prototype.applyColumnTypes = function()
{
var rows = this.getData(true);
var numRows = rows.length;
var colNames = [];
- 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.attachBehaviors = function()
{
if (this.element) {
if (this.element.nodeName == "INPUT") {
this.input = this.element;
Function xpathParseInit
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xpathParseInit() {
if (xpathRules.length) {
return;
}
Function xpathMatchStack
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function xpathMatchStack(stack, pattern) {
// NOTE(mesch): The stack matches for variable cardinality are
// greedy but don't do backtracking. This would be an issue only
// with rules of the form A* A, i.e. with an element with variable
Function ua
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
Function BrowserSniff
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Spry.Widget.BrowserSniff = function()
{
var b = navigator.appName.toString();
var up = navigator.platform.toString();
var ua = navigator.userAgent.toString();
- 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 insert
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
insert: function(element, insertions) {
element = $(element);
if (Object.isString(insertions) || Object.isNumber(insertions) ||
Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
- 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 initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function() {
this.updateImageList();
this.keyboardAction = this.keyboardAction.bindAsEventListener(this);
Function evaluate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
BinaryExpr.prototype.evaluate = function(ctx) {
var ret;
switch (this.op.value) {
case 'or':
ret = new BooleanValue(this.expr1.evaluate(ctx).booleanValue() ||
Function update
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.SelectionDescriptor.prototype.update = function()
{
if (Spry.is.ie && Spry.is.windows) {
var sel = this.element.ownerDocument.selection;
if (this.element.nodeName == "TEXTAREA") {
Function fixupIETagAttributes
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Utils.fixupIETagAttributes = function(inStr)
{
var outStr = "";
// Break the tag string into 3 pieces.