Showing 6 of 12 total issues
Function handler
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
declaration.handler = (argv, collection) => {
const progress = !argv.progress ? null : new Progress({
sqlized: (value) => chalk.yellow('?') + ` sqlized: ${value}`
})
if (progress) {
Function createCollection
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
function createCollection (name) {
let collection = Object.assign({}, genericCollection)
collection.name = name
collection.target = dataplug.target(targetConfigDeclaration, (params) => {
- 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 createCollection
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createCollection (name) {
let collection = Object.assign({}, genericCollection)
collection.name = name
collection.target = dataplug.target(targetConfigDeclaration, (params) => {
Function target
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
collection.target = dataplug.target(targetConfigDeclaration, (params) => {
const options = targetConfigToOptionsMapping.apply(params)
let prologueModifier = null
if (options.missing) {
Function handler
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
declaration.handler = (argv, collection) => {
const reader = new JsonStreamReader('!')
new Promise((resolve, reject) => {
process.stdin
.pipe(reader)
Function handler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
declaration.handler = (argv, collection) => {
const progress = !argv.progress ? null : new Progress({
sqlized: (value) => chalk.yellow('?') + ` sqlized: ${value}`
})
if (progress) {
- 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"