Showing 13 of 37 total issues
Function handler
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const validator = new Ajv({
useDefaults: true,
removeAdditional: true,
allErrors: false
Function handler
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const validator = new Ajv({
useDefaults: true,
allErrors: false
}).compile(collection.schema)
Function handler
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const progress = !argv.progress ? null : new Progress({
supplied: (value) => chalk.green('↑') + ` supplied: ${value}`
})
if (progress) {
Function handler
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const progress = !argv.progress ? null : new Progress({
flattened: (value) => chalk.yellow('?') + ` flattened: ${value}`
})
if (progress) {
Function handler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const validator = new Ajv({
useDefaults: true,
removeAdditional: true,
allErrors: 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 handler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const validator = new Ajv({
useDefaults: true,
allErrors: false
}).compile(collection.schema)
- 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 _commandToYargs
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_commandToYargs (declaration) {
let cli = {}
let prerequisitesMet = true
if (declaration.prerequisites && this._collections) {
Function handler
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
declaration.handler = (argv, collection) => {
const progress = !argv.progress ? null : new Progress({
consumed: (value) => chalk.green('↑') + ` consumed: ${value}`
})
if (progress) {
Function validateParameterValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function validateParameterValue (parameter, type, format, value) {
if (type === 'integer') {
const parsedValue = Number.parseInt(value)
if (_.isNaN(parsedValue)) {
throw new Error(`Invalid "${parameter}" value: failed to parse "${value}" as integer`)
- 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 parameterDeclarationToYargs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parameterDeclarationToYargs (yargs, parameter, declaration) {
const optionName = _.kebabCase(parameter)
let option = {}
if (declaration.description) {
Function builder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
cli.builder = (yargs) => {
yargs = yargs
.usage(`Usage: $0 ${declaration.command} <collection> [options]`)
if (this._collections) {
Function _commandToYargs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_commandToYargs (declaration) {
let cli = {}
let prerequisitesMet = true
if (declaration.prerequisites && this._collections) {
- 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 parameterDeclarationToYargs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function parameterDeclarationToYargs (yargs, parameter, declaration) {
const optionName = _.kebabCase(parameter)
let option = {}
if (declaration.description) {
- 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"