Showing 4 of 4 total issues
Function prettyPrint
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const prettyPrint = (
key = null,
value = '',
indent = 0,
colorOutput = 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 getAutoCompletion
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getAutoCompletion = (current, argv = {}) => {
if (argv && argv._) {
const filePath = argv._[1];
const filePathIsString = typeof filePath === 'string';
const jsonBranch = argv._[2];
- 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 readJsonFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const readJsonFile = (filepath) => {
const normalizedPath = filepath && normalize(filepath);
const isNil = R.isNil(normalizedPath);
const isString = typeof normalizedPath === 'string';
const isUnreadable = isString && jetpack.exists(normalizedPath) !== 'file';
- 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 writeJsonFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const writeJsonFile = (filepath, data = {}) => {
const isString = typeof filepath === 'string';
const normalizedPath = isString && filepath && normalize(filepath);
const isNil = R.isNil(normalizedPath);
- 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"