Showing 16 of 32 total issues
Function exports
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (req, res, next) => {
req.bodyChunks = [];
req.on("data", (chunk) => {
req.bodyChunks.push(chunk);
- Create a ticketCreate a ticket
Function exports
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (req, res, next) => {
res.bodyXmlObj = {
response: res.body,
};
- Create a ticketCreate a ticket
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
client.get(`bin:${req.params.uuid}`, (err, value) => {
if (err) {
debug(err);
- Create a ticketCreate a ticket
Function bins
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function bins(dsnStr) {
// parse redis dsn
const dsn = new URL(dsnStr);
// connect to redis
- Create a ticketCreate a ticket
Function processFormData
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const processFormData = (event) => {
const response = {
status: "",
statusText: "",
httpVersion: "HTTP/1.1",
- Create a ticketCreate a ticket
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
let mock = req.jsonBody;
// check for full HAR
if (req.jsonBody?.response) {
- Create a ticketCreate a ticket
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
const id = req.params.uuid;
const path = req.params[0];
const compoundId = id + path;
- Create a ticketCreate a ticket
Function router
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function router(options) {
const router = express.Router();
const defaults = [
mw.forwarded,
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
let mock = req.jsonBody;
// check for full HAR
if (req.jsonBody?.response) {
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (options, done) => {
if (!options) {
throw Error("missing options");
}
- Create a ticketCreate a ticket
Function redirect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function redirect(req, res, next) {
let count = req.params.count ? parseInt(req.params.count, 10) : 1;
const status = parseInt(req.params.status_code, 10) || 302;
const valid = [300, 301, 302, 303, 307, 308];
- Create a ticketCreate a ticket
Function redirect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function redirect(req, res, next) {
let count = req.params.count ? parseInt(req.params.count, 10) : 1;
const status = parseInt(req.params.status_code, 10) || 302;
const valid = [300, 301, 302, 303, 307, 308];
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
// compoundId allows us to provide paths in the id to resolve to a specific bin
const compoundId = req.params.uuid + req.params[0];
client.get(`bin:${compoundId}`, function (err, value) {
if (err) {
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
const id = req.params.uuid;
const path = req.params[0];
const compoundId = id + path;
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
client.get(`bin:${req.params.uuid + req.params[0]}`, (err, value) => {
if (err) {
debug(err);
- Read upRead up
- Create a ticketCreate a ticket
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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (client) => (req, res, next) => {
client.get(`bin:${req.params.uuid}`, (err, value) => {
if (err) {
debug(err);
- Read upRead up
- Create a ticketCreate a ticket
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"