src/functions/builder.js
Function buildCSS
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
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
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 buildJS
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 buildJS
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
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
Avoid deeply nested control flow statements. Open
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);
Avoid deeply nested control flow statements. Open
Open
if (!onlypaths) {
utils.write(path.join('public', 'css', index + target), content.css.toString(), 'utf-8', true);
}
Avoid deeply nested control flow statements. Open
Open
if (watchinFiles[index + target].length === 0) {
error.push(`${__nok.red} Pattern ${file} ${'not found'.red}`);
}
Avoid deeply nested control flow statements. Open
Open
if (!development || !onlypaths) {
for (const url of watchinFiles[index + target]) {
concatCSS.add(target, fs.readFileSync(url));
}
}
Function buildJS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export async function buildJS (target, bundle, development, onlypaths, logger) {
Function buildCSS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
export async function buildCSS (target, bundle, development, onlypaths, logger) {