Showing 16 of 18 total issues
Function exports
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(directory, options){
options = options || {};
options.minify = Boolean(options.minify);
options.sourcemaps = Boolean(options.sourcemaps);
- 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 exports
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(directory, options){
options = options || {};
options.minify = Boolean(options.minify);
options.sourcemaps = Boolean(options.sourcemaps);
Function exports
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(templates, plugins){
var render = function(dirs, req, requestPath){
return renderNunjucks(dirs, requestPath.normalize('NFC'))
.then(null, function(error){
if (error.templateNotFound)
Function render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
var render = function(dirs, req, requestPath){
return renderNunjucks(dirs, requestPath.normalize('NFC'))
.then(null, function(error){
if (error.templateNotFound)
return renderNunjucks(dirs, requestPath.normalize('NFD'));
Function exports
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(projectDirectory, plugins, options){
options = options || {};
options.minify = Boolean(options.minify);
var templates = templatesFactory(projectDirectory);
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(directory, options){
options = options || {};
var jsDirectories = [directory + '/js'];
Function get
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var get = function(getOpts){
getOpts = getOpts || {};
var getFilesOptions = {};
if (getOpts.ie) {
getFilesOptions.include = new RegExp('\\.ie' + getOpts.ie + '\\.[a-z]+$');
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(directory){
// Ensure the code works with symlinks and ../ in the path
directory = fs.realpathSync(directory);
return {
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(directory){
var pagesDirectory = directory + '/pages';
var dirs = [__dirname, pagesDirectory];
var errorDirectory = path.join(directory, 'errors');
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(imgpath){
return {
middleware: function(req, res, next){
if (req.path !== '/favicon.png')
return next();
- 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 exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(directories, extensions, opts){
opts = opts || {};
if (typeof directories === 'string')
directories = [directories];
return Promise.all(directories.map(function(directory){
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(projectDirectory, plugins, options){
options = options || {};
options.minify = Boolean(options.minify);
var templates = templatesFactory(projectDirectory);
- 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 exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(imgpath){
return {
middleware: function(req, res, next){
if (req.path !== '/favicon.png')
return next();
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(templates, plugins){
var render = function(dirs, req, requestPath){
return renderNunjucks(dirs, requestPath.normalize('NFC'))
.then(null, function(error){
if (error.templateNotFound)
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(directory, options){
options = options || {};
var jsDirectories = [directory + '/js'];
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(directory){
return {
middleware: function(req, res, next){
if (req.path !== '/.htaccess')
return next();
- 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"