Showing 6 of 6 total issues
Function _parseRequest
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Open
_parseRequest(req, route) {
route = Object.assign({
name: '<unknown>',
type: 'auto',
secret: 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 _parseRequest
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_parseRequest(req, route) {
route = Object.assign({
name: '<unknown>',
type: 'auto',
secret: false
Function _handleCall
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_handleCall(req, res) {
let self = this;
this._parseBody(req, res, c(function* () {
try {
// Mock
File WebhookServer.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Created by desaroger on 23/02/17.
*/
const _ = require('lodash');
Function _parseProcess
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static _parseProcess(app) {
// Check data
if (!app || !app.pm2_env) {
return null;
}
Function _parseProcess
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
static _parseProcess(app) {
// Check data
if (!app || !app.pm2_env) {
return 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"