Showing 390 of 605 total issues
Function getPageSize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getPageSize: function() {
var xScroll, yScroll;
if (window.innerHeight && window.scrollMaxY) {
- 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 getNodeText
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Spry.Data.XMLDataSet.getNodeText = function(node, encodeText, encodeCData)
{
var txt = "";
if (!node)
- 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 getRecordSetFromXMLDoc
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Data.XMLDataSet.getRecordSetFromXMLDoc = function(xmlDoc, path, suppressColumns, entityEncodeStrings)
{
if (!xmlDoc || !path)
return null;
Function stopObserving
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stopObserving(element, eventName, handler) {
element = $(element);
var registry = Element.retrieve(element, 'prototype_event_registry');
if (!registry) return element;
Function validate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.validate = function() {
this.resetClasses();
//possible states: required, format, rangeMin, rangeMax, charsMin, charsMax
if (this.validateOn & Spry.Widget.ValidationTextField.ONSUBMIT) {
Function validation
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
validation: function(value, options) {
//fix for ?ID=223429 and ?ID=223387
/* the following regexp matches components of an URI as specified in http://tools.ietf.org/html/rfc3986#page-51 page 51, Appendix B.
scheme = $2
authority = $4
Function menu
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function menu(){
var menu = document.getElementById("menu");
var menuCE = document.getElementById("canto_menu_esquerdo");
var menuCC = document.getElementById("menu_centro");
var menuCD = document.getElementById("canto_menu_direito");
Function embedSWF
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
return;
}
widthStr += ""; // Auto-convert to string to make it idiot proof
Function distinct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Data.DataSet.prototype.distinct = function(columnNames)
{
if (this.data)
{
var oldData = this.data;
Function filterData
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Data.DataSet.prototype.filterData = function(filterFunc, filterOnly)
{
// This is a destructive filter function.
var dataChanged = false;
Consider simplifying this complex logical expression. Open
if (this.input) {
if (this.maxChars) {
this.input.removeAttribute("maxLength");
}
this.putHint();
Function update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(element, content) {
element = $(element);
var purgeElement = Element._purgeElement;
var descendants = element.getElementsByTagName('*'),
Function menu
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function menu(){
var menu = document.getElementById("menu");
var menuCE = document.getElementById("canto_menu_esquerdo");
var menuCC = document.getElementById("menu_centro");
var menuCD = document.getElementById("canto_menu_direito");
- 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 setStyle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
setStyle: function(element, styles) {
element = $(element);
var elementStyle = element.style, match;
if (Object.isString(styles)) {
element.style.cssText += ';' + styles;
- 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 setRequestHeaders
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
setRequestHeaders: function() {
var headers = {
'X-Requested-With': 'XMLHttpRequest',
'X-Prototype-Version': Prototype.Version,
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
- 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 getElementsByClassName
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
function iter(name) {
return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
}
- 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 setAttribute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Spry.Utils.setAttribute = function(ele, name, value)
{
ele = Spry.$(ele);
if (!ele || !name)
return;
- 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 xpathGrammarPrecedence
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function xpathGrammarPrecedence(frame) {
var ret = 0;
if (frame.rule) { /* normal reduce */
if (frame.rule.length >= 3 && frame.rule[2] >= 0) {
- 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 fixUpIEInnerHTML
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Spry.Utils.fixUpIEInnerHTML = function(inStr)
{
var outStr = "";
// Create a regular expression that will match:
- 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 compilePattern
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spry.Widget.ValidationTextField.prototype.compilePattern = function() {
if (!this.pattern) {
return;
}
var compiled = [];