Showing 8 of 18 total issues
File contacts.js
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
const _ = require('lodash')
const { URL } = require('url')
const moment = require('moment')
const { Source, Mapper } = require('@dataplug/dataplug')
const { HttpGetReader, PagedHttpGetReader } = require('@dataplug/dataplug-http')
Function factory
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/contacts/v1/lists/all/contacts/all'
if (params.recently === 'created') {
- 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 factory
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/contacts/v1/lists/all/contacts/all'
if (params.recently === 'created') {
Function factory
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/companies/v2/companies/paged'
let selector = '!.companies.*'
Function factory
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/deals/v1/deal/paged'
let selector = '!.deals.*'
Function factory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/companies/v2/companies/paged'
let selector = '!.companies.*'
- 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 factory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const factory = (params) => {
params = _.clone(params)
let uri = '/deals/v1/deal/paged'
let selector = '!.deals.*'
- 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 responseHandlerFactory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function responseHandlerFactory (params) {
return (response, request) => {
if (response.statusCode === 429) {
let body = ''
request