Showing 12 of 36 total issues
Function createResolver
has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring. Open
Open
function createResolver() {
var state = {
defined: {},
defaults: {},
required: {},
- 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 createResolver
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function createResolver() {
var state = {
defined: {},
defaults: {},
required: {},
- 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 createResolver
has 423 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createResolver() {
var state = {
defined: {},
defaults: {},
required: {},
Function createResolver
has 314 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function createResolver() {
var state = {
defined: {},
defaults: {},
required: {},
File createResolver.js
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
Function get
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get(option) {
if (!clone.locked) {
throw new Error('get is only supported within closures of lazy options and normalizers.');
}
File createResolver.js
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import difference from 'lodash/array/difference';
import { merge, omit } from 'lodash/object';
import lang from 'lodash/lang';
import sortBy from 'lodash/collection/sortBy';
Function get
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function get(option) {
if (!clone.locked) {
throw new Error('get is only supported within closures of lazy options and normalizers.');
}
Function resolve
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolve() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
return new Promise(function (resolve, reject) {
if (state.locked) {
Function setRequired
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setRequired(optionNames) {
if (state.locked) {
throw new Error('Options cannot be made required from a lazy option or normalizer.');
}
Function resolve
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolve(options = {}) {
return new Promise((resolve, reject) => {
if (state.locked) {
const err = new Error('Options cannot be state.resolved from a lazy option or normalizer.');
return reject(err);
Function setDefined
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setDefined(optionNames) {
if (state.locked) {
throw new Error('Options cannot be defined from a lazy option or normalizer.');
}