Showing 16 of 47 total issues
Function walkThrough
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function walkThrough(spec, config, path, checkDifference) {
var result = {};
var few = [];
var key;
var isDefined;
- 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 validate
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function validate(child, key, value, path) {
var type = typeOf(value);
var index;
var item;
var isValid;
- 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 exportProgram
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function exportProgram(program) {
program
.command('doc <sources...>')
.description('run setup')
.option('-o, --output [output]')
Function exportProgram
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function exportProgram(program) {
program
.command('doc <sources...>')
.description('run setup')
.option('-o, --output [output]')
- 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 generate
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
.action(function generate(sources, options) {
function log() {
if (!options.verbose) {
return;
}
Function validate
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
NumberNode.prototype.validate = function validate(value, path) {
return runValidation([
{
runable: this.options.greaterThan,
validator: {
Function walkThrough
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function walkThrough(spec, config, path, checkDifference) {
var result = {};
var few = [];
var key;
var isDefined;
Function runConditional
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function runConditional(child, result, key, path) {
var condition;
var index;
var executor;
- 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 prepareEach
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function prepareEach(item) {
var data = {};
var key;
var spec;
var optKey;
- 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 validate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function validate(child, key, value, path) {
var type = typeOf(value);
var index;
var item;
var isValid;
Function validate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
StringNode.prototype.validate = function validate(value, path) {
var count = value.length;
return runValidation([
{
Function validate
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
ArrayNode.prototype.validate = function validate(value, path) {
var count = value.length;
return runValidation([
{
Function runConditional
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function runConditional(child, result, key, path) {
var condition;
var index;
var executor;
Function prepareEach
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function prepareEach(item) {
var data = {};
var key;
var spec;
var optKey;
Function runValidation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function runValidation(options, value, path) {
var index;
var item;
for (index = 0; index < options.length; index++) {
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
BooleanNode.prototype.validate = function validate(value, path) {
if (this.options.expectToBe !== null && this.options.expectToBe !== value) {
throw new ConfigError(util.format(
'Expect to be "%s" - go "%s"',
(this.options.expectToBe === true) ? 'true' : '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"