Showing 215 of 292 total issues
Function ATTR
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ATTR: function(match, curLoop, inplace, result, not, isXML){
Avoid deeply nested control flow statements. Open
if (element.tagName.toUpperCase() == 'IMG' && element.width) {
element.width++; element.width--;
} else try {
var n = document.createTextNode(' ');
element.appendChild(n);
Avoid deeply nested control flow statements. Open
for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
if ( item ) {
found = filter( item, match, i, curLoop );
var pass = not ^ !!found;
Avoid deeply nested control flow statements. Open
if (Element.getStyle(element, 'position') == 'absolute') break;
Avoid deeply nested control flow statements. Open
if (form.onsubmit() == true)
{
form.submit();
}
Function CLASS
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CLASS: function(match, curLoop, inplace, result, not, isXML){
Function dirNodeCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Function dirCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Function updateContent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
updateContent: function(responseText) {
var receiver = this.container[this.success() ? 'success' : 'failure'],
options = this.options;
if (!options.evalScripts) responseText = responseText.stripScripts();
- 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 (node.tagName !== "!") // Filter out comment nodes.
results.push(node);
Avoid deeply nested control flow statements. Open
if ( typeof cur !== "string" ) {
if ( elem === cur ) {
match = true;
break;
}
Function loop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
loop: function(timePos) {
if (timePos >= this.startOn) {
if (timePos >= this.finishOn) {
this.render(1.0);
this.cancel();
- 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 ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
Avoid deeply nested control flow statements. Open
if ( !inplace ) {
curLoop = result;
}
Function getTokenBounds
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getTokenBounds: function() {
if (null != this.tokenBounds) return this.tokenBounds;
var value = this.element.value;
if (value.strip().empty()) return [-1, 0];
var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
- 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 session[:next].include? "http://support.carbondiet.org"
redirect_to "#{session[:next]}?sso=#{CGI.escape(user.multipass)}"
else
redirect_to(session[:next])
end
Method fix_missing_date_components
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fix_missing_date_components
if !params[:flight]['return_on(1i)'].blank? || !params[:flight]['return_on(2i)'].blank? || !params[:flight]['return_on(3i)'].blank?
params[:flight]['return_on(1i)'] = params[:flight]['outbound_on(1i)'] if params[:flight]['return_on(1i)'].blank?
params[:flight]['return_on(2i)'] = params[:flight]['outbound_on(2i)'] if params[:flight]['return_on(2i)'].blank?
params[:flight]['return_on(3i)'] = params[:flight]['outbound_on(3i)'] if params[:flight]['return_on(3i)'].blank?
- 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 _tree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_tree: function(element, options, parent) {
var children = Sortable.findElements(element, options) || [];
for (var i = 0; i < children.length; ++i) {
var match = children[i].id.match(options.format);
- 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
Method date_of_first_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def date_of_first_data
start = Date::today
self.electricity_accounts.each { |x| start = x.start_date if x.start_date < start }
self.gas_accounts.each { |x| start = x.start_date if x.start_date < start }
self.vehicles.each { |x| start = x.start_date if x.start_date < start }
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
create: function(element) {
element = $(element);
var options = Object.extend({
element: element,
tag: 'li', // assumes li children, override with tag: 'tagname'
- 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"