Showing 8 of 12 total issues
Function rawHapiPlugin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const rawHapiPlugin = function(configue, decorateName = 'configue') {
/**
* Register the <tt>Configue</tt> plugin and process the various steps and hooks
* @param server - Hapi server to configure
* @param options - options of the Configue Plugin
- 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 extendWithFluentBuilder
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function extendWithFluentBuilder(Configue) {
Configue._options = {};
optionKeys.forEach(option => {
Configue[option] = opt => {
Configue._options[option] = opt;
Function loadFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const loadFiles = (nconf, options) => {
const files = options.files;
if (Array.isArray(files) && files.length > 0) {
for (const file of files) {
const path = _.getOr(file, 'file', 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 resolve
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Configue.prototype.resolve = function() {
if (this.resolved) return this.async ? Promise.resolve(this) : undefined;
const completeSetup = () => {
this.resolved = true;
Function Configue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Configue = (module.exports = function Configue(options = {}) {
if (!(this instanceof Configue)) {
return new Configue(options);
}
- 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 resolve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Configue.prototype.resolve = function() {
if (this.resolved) return this.async ? Promise.resolve(this) : undefined;
const completeSetup = () => {
this.resolved = true;
- 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 getFirst
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getFirst(keys, defaultValue, ...rest) {
const hasDefault = _.isArray(keys) && _.isEmpty(rest);
for (const key of hasDefault ? keys : [keys, defaultValue, ...rest]) {
const result = this.nconf.get(formatKey(key));
if (result !== undefined) return result;
- 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 loadArgv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const loadArgv = (nconf, options) => {
if (_.has('disable.argv', options)) return promiseIfNeeded(options);
const argOpts = options.argv || {};
// craft own yargs if needed that is transmit to nconf
- 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"