BoolJS/booljs

View on GitHub

Showing 5 of 5 total issues

Function exports has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = async function (instance, loader, router) {
const { routes } = instance.getComponents();
 
// Get route middleware and add it by policy types
const routeMiddleware = Plugins.list(RouteMiddleware);
Severity: Minor
Found in lib/api/loaders/server/router.js - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    case 'package': {
    return splittedName
    .map(name => name.charAt(0).toLowerCase() + name.slice(1))
    .join('');
    }
    Severity: Major
    Found in lib/api/folder/read.js and 1 other location - About 1 hr to fix
    lib/api/folder/read.js on lines 19..23

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    case 'class': {
    return splittedName
    .map(name => name.charAt(0).toUpperCase() + name.slice(1))
    .join('');
    }
    Severity: Major
    Found in lib/api/folder/read.js and 1 other location - About 1 hr to fix
    lib/api/folder/read.js on lines 14..18

    Function readFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.readFiles = async function (instance, component, route, files) {
    const fileRegex = /([A-Za-z0-9-_ ]+)\.([A-Za-z0-9_]+)/;
     
    for (const file of files) {
    const filename = join(route, file);
    Severity: Minor
    Found in lib/api/folder/read.js - About 45 mins to fix

    Function add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.add = function () {
    // eslint-disable-next-line no-extend-native
    Array.prototype.sortBy = function (property) {
    return this.sort((a, b) => {
    if (a[property] !== b[property]) {
    Severity: Minor
    Found in lib/api/utilities/array-sortby.js - About 35 mins to fix
    Severity
    Category
    Status
    Source
    Language