Function extract
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
export default function extract(config, dataset, cache, util) {
const cfgs = Array.isArray(config) ? config : [config];
let dataItems = [];
for (let i = 0; i < cfgs.length; i++) {
if (typeof cfgs[i].field !== 'undefined') {
Function extract
has 93 lines of code (exceeds 25 allowed). Consider refactoring.
export default function extract(config, dataset, cache, util) {
const cfgs = Array.isArray(config) ? config : [config];
let dataItems = [];
for (let i = 0; i < cfgs.length; i++) {
if (typeof cfgs[i].field !== 'undefined') {
Function getFieldAccessor
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
export function getFieldAccessor(field, page, deps, columnOrder) {
if (!field) {
return -1;
}
const cache = deps.cache;
Function getFieldAccessor
has 38 lines of code (exceeds 25 allowed). Consider refactoring.
export function getFieldAccessor(field, page, deps, columnOrder) {
if (!field) {
return -1;
}
const cache = deps.cache;
Avoid deeply nested control flow statements.
for (let l = 0; l < propsArr.length; l++) {
const p = props[propsArr[l]];
let arr = p.fields || [p];
if (p.fields) {
Avoid deeply nested control flow statements.
if (exclude) {
continue;
}
Avoid deeply nested control flow statements.
if (track) {
util.track({
cfg: cfgs[i],
itemData: mainCell,
obj: ret,
Function datumExtract
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
function datumExtract(propCfg, cell, { key }) {
const datum = {
value:
typeof propCfg.value === 'function'
? propCfg.value(cell)
Avoid too many return
statements within this function.
return (row) => row[fieldIdx];
Identical blocks of code found in 2 locations. Consider refactoring.
function datumExtract(propCfg, cell, { key }) {
const datum = {
value:
typeof propCfg.value === 'function'
? propCfg.value(cell)
Similar blocks of code found in 2 locations. Consider refactoring.
if (track) {
util.track({
cfg: cfgs[i],
itemData: mainCell,
obj: ret,
Similar blocks of code found in 2 locations. Consider refactoring.
const f = typeof cfgs[i].field === 'object' ? cfgs[i].field : dataset.field(cfgs[i].field);
There are no issues that match your filters.