Showing 46 of 73 total issues
Function parse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
Function onHashChange
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.onHashChange = function(event){
//History.debug('History.onHashChange', arguments);
// Prepare
var currentUrl = ((event && event.newURL) || History.getLocationHref()),
Function onHashChange
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.onHashChange = function(event){
//History.debug('History.onHashChange', arguments);
// Prepare
var currentUrl = ((event && event.newURL) || History.getLocationHref()),
Consider simplifying this complex logical expression. Open
Open
if (History.options.html4Mode) {
History.emulated = {
pushState : true,
hashChange: true
};
Consider simplifying this complex logical expression. Open
Open
if (History.options.html4Mode) {
History.emulated = {
pushState : true,
hashChange: true
};
Function replaceState
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.replaceState = function(data,title,url,queue){
//History.debug('History.replaceState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
Function replaceState
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.replaceState = function(data,title,url,queue){
//History.debug('History.replaceState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
Function _parser_factory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
DOMParser.prototype._parser_factory = function() {
var create_document_using_DOM, create_document_using_parser, create_document_using_write, e, testDoc, _ref;
create_document_using_parser = function(html) {
return (new DOMParser).parseFromString(html, 'text/html');
};
Function normalizeState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.normalizeState = function(oldState){
// Variables
var newState, dataNotEmpty;
// Prepare
Function normalizeState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.normalizeState = function(oldState){
// Variables
var newState, dataNotEmpty;
// Prepare
Function checkerFunction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.checkerFunction = function(){
// Check Running
if ( checkerRunning ) {
return false;
}
Function checkerFunction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
History.checkerFunction = function(){
// Check Running
if ( checkerRunning ) {
return false;
}
Method render_with_wiselinks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def render_with_wiselinks(*args, &block)
options = _normalize_args(*args)
if self.request.wiselinks?
self.headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
- 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 _fail
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
RequestManager.prototype._fail = function($target, status, state, error, code, data) {
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
Open
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
Open
if (startedWithHash && iframeHash === '') {
History.back();
}
else {
// Update the Hash
Avoid deeply nested control flow statements. Open
Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}