qlik-oss/picasso.js

View on GitHub
plugins/q/src/json-path-resolver.js

Summary

Maintainability
C
1 day
Test Coverage
C
78%

Showing 3 of 3 total issues

Function resolve has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

export default function resolve(path, obj) {
if (path.charAt(0) === '/') {
path = path.substring(1);
}
const arr = path.split('/');
Severity: Minor
Found in plugins/q/src/json-path-resolver.js - About 3 hrs to fix

Function resolve has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function resolve(path, obj) {
if (path.charAt(0) === '/') {
path = path.substring(1);
}
const arr = path.split('/');
Severity: Minor
Found in plugins/q/src/json-path-resolver.js - About 1 hr to fix

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

    if (!arr[i] && Array.isArray(container)) {
    const carr = new Array(container.length);
    subpath = arr.slice(i + 1).join('/');
    for (let c = 0; c < container.length; c++) {
    carr[c] = resolve(subpath, container[c]);
    Severity: Major
    Found in plugins/q/src/json-path-resolver.js and 1 other location - About 4 hrs to fix
    packages/picasso.js/src/core/data/json-path-resolver.js on lines 35..43

    There are no issues that match your filters.

    Category
    Status