File qunit.js
has 1469 lines of code (exceeds 250 allowed). Consider refactoring.
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
Function jsDump
has 185 lines of code (exceeds 25 allowed). Consider refactoring.
QUnit.jsDump = (function() {
function quote( str ) {
return '"' + str.toString().replace( /"/g, '\\"' ) + '"';
}
function literal( o ) {
Function equiv
has 126 lines of code (exceeds 25 allowed). Consider refactoring.
QUnit.equiv = (function() {
function bindCallbacks( o, callbacks, args ) {
var prop = QUnit.objectType( o );
Function diff
has 114 lines of code (exceeds 25 allowed). Consider refactoring.
QUnit.diff = (function() {
function diff( o, n ) {
var i,
ns = {},
os = {};
Function load
has 98 lines of code (exceeds 25 allowed). Consider refactoring.
QUnit.load = function() {
runLoggingCallbacks( "begin", QUnit, {} );
var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter,
Function callbacks
has 90 lines of code (exceeds 25 allowed). Consider refactoring.
callbacks = (function () {
function useStrictEquality( b, a ) {
if ( b instanceof a.constructor || a instanceof b.constructor ) {
Function finish
has 82 lines of code (exceeds 25 allowed). Consider refactoring.
finish: function() {
config.current = this;
if ( config.requireExpects && this.expected == null ) {
QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack );
} else if ( this.expected != null && this.expected != this.assertions.length ) {
Function diff
has 66 lines of code (exceeds 25 allowed). Consider refactoring.
function diff( o, n ) {
var i,
ns = {},
os = {};
Function done
has 55 lines of code (exceeds 25 allowed). Consider refactoring.
function done() {
config.autorun = true;
if ( config.currentModule ) {
Function setup
has 41 lines of code (exceeds 25 allowed). Consider refactoring.
setup: function() {
if ( this.module !== config.previousModule ) {
if ( config.previousModule ) {
runLoggingCallbacks( "moduleDone", QUnit, {
name: config.previousModule,
Function init
has 41 lines of code (exceeds 25 allowed). Consider refactoring.
init: function() {
extend( config, {
stats: { all: 0, bad: 0 },
moduleStats: { all: 0, bad: 0 },
started: +new Date(),
Function push
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
push: function( result, actual, expected, message ) {
if ( !config.current ) {
throw new Error( "assertion outside test context, was " + sourceFromStacktrace() );
}
Function object
has 31 lines of code (exceeds 25 allowed). Consider refactoring.
"object": function( b, a ) {
var i, j, loop,
eq = true,
aProperties = [],
Function extractStacktrace
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
function extractStacktrace( e, offset ) {
offset = offset === undefined ? 3 : offset;
var stack, include, i, regex;
Function throws
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
throws: function( block, expected, message ) {
var actual,
ok = false;
Function pushFailure
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
pushFailure: function( message, source, actual ) {
if ( !config.current ) {
throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) );
}
Function queue
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
queue: function() {
var bad,
test = this;
synchronize(function() {
Function typeOf
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
typeOf: function( obj ) {
var type;
if ( obj === null ) {
type = "null";
} else if ( typeof obj === "undefined" ) {
Avoid too many return
statements within this function.
return "object";
Avoid too many return
statements within this function.
return undefined;
Avoid too many return
statements within this function.
return !include;
Avoid too many return
statements within this function.
return e.sourceURL + ":" + e.line;
Avoid too many return
statements within this function.
return include;
Similar blocks of code found in 2 locations. Consider refactoring.
if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null &&
n[ i + 1 ] == o[ n[i].row + 1 ] ) {
n[ i + 1 ] = {
text: n[ i + 1 ],
Similar blocks of code found in 2 locations. Consider refactoring.
if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null &&
n[ i - 1 ] == o[ n[i].row - 1 ]) {
n[ i - 1 ] = {
text: n[ i - 1 ],
Similar blocks of code found in 2 locations. Consider refactoring.
for ( i = 0; i < o.length; i++ ) {
if ( os[ o[i] ] == null ) {
os[ o[i] ] = {
rows: [],
n: null
Similar blocks of code found in 2 locations. Consider refactoring.
for ( i = 0; i < n.length; i++ ) {
if ( ns[ n[i] ] == null ) {
ns[ n[i] ] = {
rows: [],
o: null
Similar blocks of code found in 2 locations. Consider refactoring.
try {
this.testEnvironment.setup.call( this.testEnvironment );
} catch( e ) {
QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
}
Similar blocks of code found in 2 locations. Consider refactoring.
if ( config.previousModule ) {
runLoggingCallbacks( "moduleDone", QUnit, {
name: config.previousModule,
failed: config.moduleStats.bad,
passed: config.moduleStats.all - config.moduleStats.bad,
Similar blocks of code found in 2 locations. Consider refactoring.
if ( config.currentModule ) {
runLoggingCallbacks( "moduleDone", QUnit, {
name: config.currentModule,
failed: config.moduleStats.bad,
passed: config.moduleStats.all - config.moduleStats.bad,
Similar blocks of code found in 2 locations. Consider refactoring.
try {
this.testEnvironment.teardown.call( this.testEnvironment );
} catch( e ) {
QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
}
Similar blocks of code found in 2 locations. Consider refactoring.
n[ ns[i].rows[0] ] = {
text: n[ ns[i].rows[0] ],
row: os[i].rows[0]
};
Similar blocks of code found in 2 locations. Consider refactoring.
o[ os[i].rows[0] ] = {
text: o[ os[i].rows[0] ],
row: ns[i].rows[0]
};
There are no issues that match your filters.