src/actions/plan/create.js
Function createSaveToRedis
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createSaveToRedis(redis, message) {
return function saveToRedis(data) {
const { plan, plans } = data;
const { meta, level, title } = message;
const aliasedId = message.alias || plan.id;
Function saveToRedis
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function saveToRedis(data) {
const { plan, plans } = data;
const { meta, level, title } = message;
const aliasedId = message.alias || plan.id;
const hidden = message.hidden || false;
Function sendRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sendRequest(config, message) {
const defaultMerchantPreferences = {
return_url: config.urls.plan_return,
cancel_url: config.urls.plan_cancel,
auto_bill_amount: 'YES',
Function createSaveToRedis
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function createSaveToRedis(redis, message) {
return function saveToRedis(data) {
const { plan, plans } = data;
const { meta, level, title } = message;
const aliasedId = message.alias || plan.id;
- 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
Parsing error: The keyword 'const' is reserved Open
Open
const { ActionTransport } = require('@microfleet/core');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/