Showing 44 of 56 total issues
Function persistmodel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function persistmodel (model, modelname, options) {
let override = await challenge(ProyPath('models', `${modelname}.js`), `The model ${modelname.green} already exits,do you want to override it?`, options.force);
if (override) {
write(ProyPath('models', modelname + '.js'), model.toCaminte());
if (options.rest) {
Function toCRUDTable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
toCRUDTable () {
let definition = [];
let actions = [];
Object.keys(this).forEach((key) => {
let entity = {};
Function createWatcher
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
createWatcher (reload) {
let watcher = new Watch(ProyPath('public', this.directory, '**/*'), {
// ignored: ,
persistent: true,
ignoreInitial: 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 StartKoatonServer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function StartKoatonServer (resolve, reject, nginx = false) {
let watcher = new Watch('./**', {
awaitWriteFinish: {
stabilityThreshold: 500,
pollInterval: 50
Function buildHosts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
buildHosts = function buildHosts () {
const os = require('os');
let subdomains = configuration.server;
let hostname = subdomains.host;
- 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 writeSync
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function writeSync (...args) {
let [file, content, mode] = args;
/* istanbul ignore next */
if (content.indexOf('koaton:static') > -1) {
return file;
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (target, source, watch = false) {
/**
* This variable is used to store the sorces files of the package.
* @private
* @type {String[]}
Function GET
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function GET (hostname) {
return new Promise(function (resolve, reject) {
let [protocol, host] = hostname.split('//');
let url = host.split('/');
host = url[0];
Function add
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
add (...args) {
let [target, transforms, alias] = args;
if (target.indexOf(':') === -1) {
alias = target;
this.privot[target] = new MutableString(target, transforms);
Consider simplifying this complex logical expression. Open
if ((!appName && !options.list) || (!appName && !!(options.use || options.prod || options.build || options.port))) {
console.log(' The command cannot be run this way.\n\tkoaton ember -h\n to see help.'.yellow);
return res;
} else if (appName && !utils.canAccess(ProyPath('ember', appName)) && !!(options.use || options.prod || options.build || options.port)) {
console.log(' That ember app does not exist.');
Function remove
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
remove (...args) {
let mutableItem = (args[0] instanceof this.Mutable ? args[0] : this[args[0]]);
if (!mutableItem) {
return this;
}
- 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
Avoid deeply nested control flow statements. Open
if (bundle.flatten) {
fs.ensureDirSync(ProyPath('public', bundle.dest));
} else {
let targetnodes = file.split('/');
let filtered = originalnodes.filter(n => targetnodes.indexOf(n) > -1).join('/');
Avoid deeply nested control flow statements. Open
if (development && !onlypaths) {
utils.write(ProyPath('public', 'css', index + target), concatCSS.content, 'utf-8', true);
ITEM.add(`/css/${index + target}`);
} else if (!development) {
concat.add(basename, concatCSS.content);
Function hasChanged
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const hasChanged = function (oldbranch, newbranch) {
if (oldbranch === undefined || newbranch === undefined) {
return true;
}
for (const file of newbranch) {
- 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
Avoid deeply nested control flow statements. Open
if (watchinFiles[index + target].length === 0) {
error.push(`${__nok.red} Pattern ${file} ${'not found'.red}`);
}
Avoid deeply nested control flow statements. Open
if (!onlypaths) {
utils.write(path.join('public', 'css', index + target), content.css.toString(), 'utf-8', true);
}
Avoid deeply nested control flow statements. Open
if (!development || !onlypaths) {
for (const url of watchinFiles[index + target]) {
concatCSS.add(target, fs.readFileSync(url));
}
}
Consider simplifying this complex logical expression. Open
} else if (appName && !utils.canAccess(ProyPath('ember', appName)) && !!(options.use || options.prod || options.build || options.port)) {
console.log(' That ember app does not exist.');
return res;
}
Function buildCSS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function buildCSS (target, bundle, development, onlypaths, logger) {
Function buildJS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export async function buildJS (target, bundle, development, onlypaths, logger) {