amercier/esviz

View on GitHub
src/lib/ast.js

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 8 of 8 total issues

Function parseDirectory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function parseDirectory(root) {
return new Promise((resolve, reject) => {
const rootId = getNodeId('.');
const nodes = {
[rootId]: { id: rootId, name: rootId, type: 'root' },
Severity: Minor
Found in src/lib/ast.js - About 1 hr to fix

    Expected parentheses around arrow function argument having a body with curly braces.
    Open

    .then(ast => {
    Severity: Minor
    Found in src/lib/ast.js by eslint

    Expected parentheses around arrow function argument having a body with curly braces.
    Open

    subGraph.nodes.forEach(node => {
    Severity: Minor
    Found in src/lib/ast.js by eslint

    Expected parentheses around arrow function argument having a body with curly braces.
    Open

    modulePaths.some(modulePath => {
    Severity: Minor
    Found in src/lib/ast.js by eslint

    Expected parentheses around arrow function argument having a body with curly braces.
    Open

    .each(subGraph => {
    Severity: Minor
    Found in src/lib/ast.js by eslint

    Missing trailing comma.
    Open

    })
    Severity: Minor
    Found in src/lib/ast.js by eslint

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

    export function buildItemsFromDirectory(path) {
    const node = buildNodeFromDirectory(path);
    const link = buildLinkToParentNode(node.id, 'subdir');
    return { node, link };
    }
    Severity: Major
    Found in src/lib/ast.js and 1 other location - About 1 hr to fix
    src/lib/ast.js on lines 126..130

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

    export function buildItemsFromFile(path) {
    const node = buildNodeFromFile(path);
    const link = buildLinkToParentNode(node.id, 'child');
    return { node, link };
    }
    Severity: Major
    Found in src/lib/ast.js and 1 other location - About 1 hr to fix
    src/lib/ast.js on lines 115..119
    Category
    Status