qlik-oss/picasso.js

View on GitHub
plugins/q/src/data/__tests__/augment-hierarchy.spec.js

Summary

Maintainability
F
4 days
Test Coverage

Showing 13 of 13 total issues

File augment-hierarchy.spec.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import q from '../dataset';
import { getPropsInfo } from '../../../../../packages/picasso.js/src/core/data/util';
 
describe('augment-hierarchy', () => {
beforeAll(() => {
Severity: Minor
Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js - About 5 hrs to fix

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

    cube.qDataPages = [
    {
    qMatrix: [
    [
    { qText: 'A', qElemNumber: 1 },
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 4 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 332..352

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

    cube.qDataPages = [
    {
    qMatrix: [
    [
    { qText: 'A', qElemNumber: 1 },
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 4 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 372..392

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

    const m = q({ key: 'nyckel', data: cube }).hierarchy({
    props: {
    dimOne: {
    field: 'qDimensionInfo/0',
    value: (d) => d.qText,
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 2 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 190..198

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

    const m = q({ key: 'nyckel', data: cube }).hierarchy({
    props: {
    desc: {
    field: 'qDimensionInfo/1',
    value: (d) => d.qText,
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 2 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 162..170

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

    {
    qText: 'a1',
    qElemNo: 0,
    qRow: 8,
    qValue: 123,
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 2 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 102..116

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

    {
    qText: 'b3',
    qElemNo: 9,
    qRow: 13,
    qValue: 276,
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 1 other location - About 2 hrs to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 42..56

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

    const h = d.hierarchy({
    value: (v) => (v ? v.qText : '__'),
    props: {
    v: {
    field: 'qMeasureInfo/0',
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 317..325
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 397..405

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

    const h = d.hierarchy({
    value: (v) => (v ? v.qText : '__'),
    props: {
    v: {
    field: 'qMeasureInfo/0',
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 357..365
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 397..405

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

    const h = d.hierarchy({
    value: (v) => (v ? v.qText : '__'),
    props: {
    v: {
    field: 'qMeasureInfo/0',
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 317..325
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 357..365

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

    expect(h.descendants().map((child) => child.data.v.value)).to.eql([6, 4, 10, 3, 5, 10]);
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 367..367
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 407..407

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

    expect(h.descendants().map((child) => child.data.v.value)).to.eql([6, 4, 10, 3, 5, 10]);
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 327..327
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 367..367

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

    expect(h.descendants().map((child) => child.data.v.value)).to.eql([6, 4, 10, 3, 5, 10]);
    Severity: Major
    Found in plugins/q/src/data/__tests__/augment-hierarchy.spec.js and 2 other locations - About 1 hr to fix
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 327..327
    plugins/q/src/data/__tests__/augment-hierarchy.spec.js on lines 407..407

    There are no issues that match your filters.

    Category
    Status