Showing 44 of 56 total issues
Function buildCSS
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
export async function buildCSS (target, bundle, development, onlypaths, logger) {
let error = [];
process.stdout.write(`Building ${target} `);
let start = process.hrtime();
const ITEM = scfg.bundles[target] || new BundleItem(target, []);
- 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 buildCSS
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function buildCSS (target, bundle, development, onlypaths, logger) {
let error = [];
process.stdout.write(`Building ${target} `);
let start = process.hrtime();
const ITEM = scfg.bundles[target] || new BundleItem(target, []);
Function copystatic
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
export default async function copystatic () {
const config = requireNoCache(ProyPath('config', 'static')).default.copy;
let promises = [];
for (const bundle of config) {
let compiled = false;
- 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 DetectChanges
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
async function DetectChanges (changed) {
const newconf = requireNoCache(ProyPath('config', 'bundles.js')).default;
for (const bundle of Object.keys(newconf)) {
let mustrebuild = false;
if (allBundles[bundle]) {
- 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 constructor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor () {
this.port = process.env.port;
this.env = process.env.NODE_ENV;
if (!fs.existsSync(ProyPath('.koaton'))) {
fs.writeFileSync(ProyPath('.koaton'), JSON.stringify({
Function buildJS
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function buildJS (target, bundle, development, onlypaths, logger) {
let error = [];
process.stdout.write(`Building ${target} `);
let start = process.hrtime();
const ITEM = scfg.bundles[target] || new BundleItem(target, []);
Function buildNginx
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export async function buildNginx () {
let nginxpath = await getnginxpath();
let conf = fs.readFileSync(nginxpath + 'nginx.conf', 'utf-8');
if (conf.indexOf('include sites-enabled/*') === -1) {
conf = conf.replace(/http ?\{/igm, 'http {\n\tinclude ./sites-enabled/*.conf;');
- 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 constructor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (name, ...args) {
let [fields, relations = {}] = args;
if (fields === undefined) {
throw new Error('fields can\'t be undefined');
}
Function Action
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
.Action(async function Action (options) {
process.env.port = options.port || configuration.server.port;
options.production = options.production ? 'production' : 'development';
process.env.NODE_ENV = options.production;
const embercfg = configuration.ember;
Function buildJS
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export async function buildJS (target, bundle, development, onlypaths, logger) {
let error = [];
process.stdout.write(`Building ${target} `);
let start = process.hrtime();
const ITEM = scfg.bundles[target] || new BundleItem(target, []);
- 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 buildNginx
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function buildNginx () {
let nginxpath = await getnginxpath();
let conf = fs.readFileSync(nginxpath + 'nginx.conf', 'utf-8');
if (conf.indexOf('include sites-enabled/*') === -1) {
conf = conf.replace(/http ?\{/igm, 'http {\n\tinclude ./sites-enabled/*.conf;');
Function buildBundles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function buildBundles () {
if (Object.keys(configuration.bundles).length === 0) {
console.log(` ${__ok.green} No bundles defined`);
} else {
await utils.mkdir(ProyPath('public', 'js'), -1);
- 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 persistmodel
has a Cognitive Complexity of 13 (exceeds 5 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) {
- 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 live
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
async live (nginxbuilt, live) {
let storebuffer = '';
return new Promise(async resolve => {
let appst = { log: false, result: '', success: false, pid: null, process: null };
let port = await detect(4200);
Function copystatic
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function copystatic () {
const config = requireNoCache(ProyPath('config', 'static')).default.copy;
let promises = [];
for (const bundle of config) {
let compiled = false;
Function shell
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function shell (display, command, cwd = process.cwd()) {
return new Promise(function (resolve) {
let shelllog = '';
if (skipshell) {
console.log(`+ ${display}\t${__ok}`.green);
Function DetectChanges
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function DetectChanges (changed) {
const newconf = requireNoCache(ProyPath('config', 'bundles.js')).default;
for (const bundle of Object.keys(newconf)) {
let mustrebuild = false;
if (allBundles[bundle]) {
Function buildHosts
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildHosts = function buildHosts () {
const os = require('os');
let subdomains = configuration.server;
let hostname = subdomains.host;
Function LoadServer
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LoadServer (resolve, reject, nginx) {
let PIDPromises = [];
let KoatonServer = spawn('node', ['app.js'], { shell: false, env: {liveReloadHost: liveReloadHost(), NODE_ENV: process.env.NODE_ENV} });
KoatonServer.stdout.on('data', (buffer) => {
process.stdout.write(buffer);
Function postbuild
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async postbuild () {
const emberinternalname = require(this.path('package.json')).name;
let text = await readFile(ProyPath('public', this.directory, 'index.html'), { encoding: 'utf-8' }),
indextemplate = await readFile(TemplatePath('ember_apps', 'index.handlebars'), 'utf-8'),
meta = new RegExp(`<meta ?name="${emberinternalname}.*" ?content=".*" ?/>`);