Showing 13 of 13 total issues
File es5-with-runtime.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
Function makeInvokeMethod
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
Function invoke
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
Function maybeInvokeDelegate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
Function dispatchException
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
Function circularIterator
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function circularIterator(arr) {
var index, elements, length;
return regeneratorRuntime.wrap(function circularIterator$(_context) {
while (1) {
switch (_context.prev = _context.next) {
- 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 circularIterator
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function circularIterator(arr) {
var index, elements, length;
return regeneratorRuntime.wrap(function circularIterator$(_context) {
while (1) {
switch (_context.prev = _context.next) {
- 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 AsyncIterator
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
Avoid deeply nested control flow statements. Open
Open
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
Avoid deeply nested control flow statements. Open
Open
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
Avoid too many return
statements within this function. Open
Open
return ContinueSentinel;
Avoid too many return
statements within this function. Open
Open
return handle(entry.finallyLoc);
Avoid too many return
statements within this function. Open
Open
return info;