Showing 37 of 80 total issues
Function controllerAttribute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function controllerAttribute(setting, fatherPath, component, application) {
let files = getListFile(setting, fatherPath, application);
if (files.type === "single") {
Object.keys(files).map(function (key) {
if (key !== "type") {
Function configRenderLayout
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
.then(function configRenderLayout() {
let viewEngineSetting = _.assign(self._config.nunjuckSettings || {}, {express: self._expressApplication});
let applicationView = ViewEngine(self.arrFolder, viewEngineSetting, self);
self.applicationENV = applicationView;
Function getGlobbedFiles
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.getGlobbedFiles = function (globPatterns, removeRoot) {
// For context switching
let _this = this;
// URL paths regex
Function getGlobbedFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports.getGlobbedFiles = function (globPatterns, removeRoot) {
// For context switching
let _this = this;
// URL paths regex
- 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 associateModels
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function associateModels(arrow) {
let defaultDatabase = require('./database').db();
if (arrow.models && Object.keys(arrow.models).length > 0) {
/* istanbul ignore next */
let defaultQueryResolve = function () {
Function handleAuthenticate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function handleAuthenticate(application, name) {
let passport = application.passport;
if (_.isString(name)) {
if (application.passportSetting[name]) {
let strategy = application.passportSetting[name].strategy || name;
- 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 render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.render = function (view, options, callback) {
let application = self;
var done = callback;
var opts = options || {};
Function makeRender
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function makeRender(req, res, application, componentView, componentName, component) {
Avoid deeply nested control flow statements. Open
if (!data[key].path.singleton) {
data[key].path.singleton = true;
}
Function handlePath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function handlePath(pathInfo, attribute, level) {
/* istanbul ignore else */
if (pathInfo) {
let singleton = handleSingleton(pathInfo.singleton);
let folderName = handleFolder(pathInfo.folder);
- 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 handleComponentRouteSetting
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function handleComponentRouteSetting(arrow, componentRouteSetting, defaultRouteConfig, key, setting, componentKey) {
Function start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start(setting) {
let self = this;
self.arrowSettings = setting;
let stackBegin;
- 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 overrideViewRender
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function overrideViewRender(application, componentView, componentName, component, key) {
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 1
Function associateModels
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function associateModels(arrow) {
let defaultDatabase = require('./database').db();
if (arrow.models && Object.keys(arrow.models).length > 0) {
/* istanbul ignore next */
let defaultQueryResolve = function () {
- 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 getPermissions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getPermissions(name) {
let self = this;
let privateName = "_" + self.name;
let result = {};
if (name) {
- 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"