Showing 12 of 12 total issues
Function json
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function json(options) {
const opts = options || {};
const limit = getLimit(opts);
const inflate = opts.inflate !== false;
- 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 read
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function read(req, res, next, parse, debug, options) {
let length;
const opts = options || {};
let stream;
Function json
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function json(options) {
const opts = options || {};
const limit = getLimit(opts);
const inflate = opts.inflate !== false;
Function urlencoded
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function urlencoded(options) {
const opts = options || {};
// notice because option default will flip in next major
if (opts.extended === undefined) {
Function text
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function text(options) {
const opts = options || {};
const defaultCharset = opts.defaultCharset || 'utf-8';
const inflate = opts.inflate !== false;
const limit = getLimit(opts);
Function raw
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function raw(options) {
const opts = options || {};
const inflate = opts.inflate !== false;
const limit = getLimit(opts);
const type = opts.type || 'application/octet-stream';
Function contentstream
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function contentstream(req, debug, inflate) {
const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase();
const length = req.headers['content-length'];
let stream;
Function urlencoded
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function urlencoded(options) {
const opts = options || {};
// notice because option default will flip in next major
if (opts.extended === undefined) {
- 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 merge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function merge(object, parsed) {
if (!isObject(parsed)) {
object = parsed;
return object;
}
- 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 read
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function read(req, res, next, parse, debug, options) {
Function read
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function read(req, res, next, parse, debug, options) {
let length;
const opts = options || {};
let stream;
- 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 bory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function bory(options) {
const opts = {};
// exclude type option
if (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"