Showing 200 of 382 total issues
Function sendRequest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendRequest(conn, location) {
return new AbortablePromise(function (resolve, reject, onAbort) {
var xhr = new XMLHttpRequest();
xhr.open(conn.method, location.href, true);
Function serveApp
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function serveApp(app, options) {
options = options || {};
if (typeof options === 'number') {
options = { port: options };
Function select
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function select( selector, context, results, seed, xml ) {
var i, tokens, token, type, find,
match = tokenize( selector ),
j = match.length;
Function removeData
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function CHILD
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function( type, argument, first, last ) {
if ( type === "nth" ) {
return function( elem ) {
var node, diff,
Function emit
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
if (!this._events)
this._events = {};
Function addCombinator
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
checkNonElements = base && combinator.dir === "parentNode",
doneName = done++;
Function file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function file(app, options) {
// Allow mach.file(path|options)
if (typeof app === 'string' || typeof app === 'object') {
options = app;
app = null;
- 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 createLocation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function createLocation(nodeRequest) {
var headers = nodeRequest.headers;
var protocol;
if (process.env.HTTPS === 'on' || headers['x-forwarded-ssl'] === 'on' || headers['font-end-https'] === 'on') {
- 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 serveApp
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function serveApp(app, options) {
options = options || {};
if (typeof options === 'number') {
options = { port: options };
- 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 createContent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function createContent(params, boundary) {
var content = new Stream;
// Use a promise chain to write all fields to the content
// stream in the same order they appear in params.
- 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 ajaxHandleResponses
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ajaxHandleResponses( s, jqXHR, responses ) {
var ct, type, finalDataType, firstDataType,
contents = s.contents,
dataTypes = s.dataTypes,
Function session
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function session(app, options) {
options = options || {};
if (typeof options === 'string')
options = { secret: options };
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (mach) {
mach.Message.PARSERS['multipart/form-data'] = function (message, maxLength) {
function partHandler(part) {
return message.handlePart(part);
}
Function matcherFromTokens
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
Function createStack
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStack(app) {
var layers = [], mappings = [], routes = [];
var compiledApp;
function compile(app) {
Consider simplifying this complex logical expression. Open
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
Function val
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
val: function( value ) {
var hooks, ret, isFunction,
elem = this[0];
if ( !arguments.length ) {
Function Sizzle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Sizzle( selector, context, results, seed ) {
results = results || [];
context = context || document;
var match, elem, xml, m,
nodeType = context.nodeType;
Function stop
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );