qlik-oss/picasso.js

View on GitHub
examples/data/q-products.js

Summary

Maintainability
F
3 days
Test Coverage
File `q-products.js` has 341 lines of code (exceeds 250 allowed). Consider refactoring.
(function (global) {
var qLayout = {
qHyperCube: {
qSize: {
qcx: 4,
qcy: 5,
},
qDimensionInfo: [
{
qFallbackTitle: 'Basket Product Group Desc',
qApprMaxGlyphCount: 19,
qCardinal: 17,
qSortIndicator: 'A',
qGroupFallbackTitles: ['Basket Product Group Desc'],
qGroupPos: 0,
Similar blocks of code found in 3 locations. Consider refactoring.
qStateCounts: {
qLocked: 0,
qSelected: 5,
qOption: 0,
qDeselected: 0,
qAlternative: 12,
qExcluded: 0,
qSelectedExcluded: 0,
qLockedExcluded: 0,
},
qTags: ['$ascii', '$text'],
qDimensionType: 'D',
qGrouping: 'N',
qNumFormat: {
qType: 'U',
qnDec: 0,
qUseThou: 0,
},
qIsAutoFormat: true,
qGroupFieldDefs: ['Basket Product Group Desc'],
qMin: 'NaN',
qMax: 'NaN',
qAttrExprInfo: [],
qAttrDimInfo: [],
title: 'Basket Product Group Desc',
autoSort: true,
cId: 'ZprDj',
othersLabel: 'Others',
},
],
qMeasureInfo: [
{
qFallbackTitle: 'Budget %',
qApprMaxGlyphCount: 16,
qCardinal: 0,
qSortIndicator: 'D',
qNumFormat: {
qType: 'R',
qnDec: 0,
qUseThou: 0,
qFmt: '##############',
qDec: '.',
qThou: ',',
},
qMin: 0.6453167082484631,
qMax: 1.0535778095292618,
qIsAutoFormat: true,
qAttrExprInfo: [
{
qMin: 0.6453167082484631,
qMax: 1.0535778095292618,
id: 'colorByExpression',
},
],
qAttrDimInfo: [],
autoSort: true,
cId: 'vzB',
numFormatFromTemplate: true,
},
Similar blocks of code found in 3 locations. Consider refactoring.
{
qFallbackTitle: '% OnTime Shipments',
qApprMaxGlyphCount: 16,
qCardinal: 0,
qSortIndicator: 'D',
qNumFormat: {
qType: 'R',
qnDec: 0,
qUseThou: 0,
qFmt: '##############',
qDec: '.',
qThou: ',',
},
qMin: 0.7418685121107267,
qMax: 0.7837242451729947,
qIsAutoFormat: true,
qAttrExprInfo: [],
qAttrDimInfo: [],
autoSort: true,
cId: 'NzZmJpR',
numFormatFromTemplate: true,
},
Similar blocks of code found in 3 locations. Consider refactoring.
{
qFallbackTitle: 'Margin %',
qApprMaxGlyphCount: 16,
qCardinal: 0,
qSortIndicator: 'D',
qNumFormat: {
qType: 'R',
qnDec: 0,
qUseThou: 0,
qFmt: '##############',
qDec: '.',
qThou: ',',
},
qMin: 0.4341154965570224,
qMax: 0.4904947985651695,
qIsAutoFormat: true,
qAttrExprInfo: [],
qAttrDimInfo: [],
autoSort: true,
cId: 'zpsgFp',
numFormatFromTemplate: true,
},
],
qEffectiveInterColumnSortOrder: [1, 0, 2, 3],
qGrandTotalRow: [
{
qText: '0.88747027525026',
qNum: 0.8874702752502577,
qElemNumber: -1,
qState: 'X',
qIsTotalCell: true,
},
{
qText: '0.79493160852508',
qNum: 0.7949316085250768,
qElemNumber: -1,
qState: 'X',
qIsTotalCell: true,
},
{
qText: '0.43191841513378',
qNum: 0.43191841513378393,
qElemNumber: -1,
qState: 'X',
qIsTotalCell: true,
},
],
qDataPages: [
{
qMatrix: [
Similar blocks of code found in 5 locations. Consider refactoring.
[
{
qText: 'Seafood',
qNum: 'NaN',
qElemNumber: 16,
qState: 'S',
},
{
qText: '1.0535778095293',
qNum: 1.0535778095292618,
qElemNumber: 0,
qState: 'L',
qAttrExps: {
qValues: [
{
qNum: 1.0535778095292618,
},
],
},
},
{
qText: '0.74186851211073',
qNum: 0.7418685121107267,
qElemNumber: 0,
qState: 'L',
},
{
qText: '0.44712550975379',
qNum: 0.44712550975378573,
qElemNumber: 0,
qState: 'L',
},
],
Similar blocks of code found in 5 locations. Consider refactoring.
[
{
qText: 'Dairy',
qNum: 'NaN',
qElemNumber: 5,
qState: 'S',
},
{
qText: '0.85153556563265',
qNum: 0.8515355656326457,
qElemNumber: 0,
qState: 'L',
qAttrExps: {
qValues: [
{
qNum: 0.8515355656326457,
},
],
},
},
{
qText: '0.78372424517299',
qNum: 0.7837242451729947,
qElemNumber: 0,
qState: 'L',
},
{
qText: '0.44044181099662',
qNum: 0.44044181099661556,
qElemNumber: 0,
qState: 'L',
},
],
Similar blocks of code found in 5 locations. Consider refactoring.
[
{
qText: 'Alcoholic Beverages',
qNum: 'NaN',
qElemNumber: 11,
qState: 'S',
},
{
qText: '0.78488295955488',
qNum: 0.7848829595548829,
qElemNumber: 0,
qState: 'L',
qAttrExps: {
qValues: [
{
qNum: 0.7848829595548829,
},
],
},
},
{
qText: '0.77249860257127',
qNum: 0.7724986025712689,
qElemNumber: 0,
qState: 'L',
},
{
qText: '0.43411549655702',
qNum: 0.4341154965570224,
qElemNumber: 0,
qState: 'L',
},
],
Similar blocks of code found in 5 locations. Consider refactoring.
[
{
qText: 'Canned Products',
qNum: 'NaN',
qElemNumber: 14,
qState: 'S',
},
{
qText: '0.72683825311192',
qNum: 0.7268382531119179,
qElemNumber: 0,
qState: 'L',
qAttrExps: {
qValues: [
{
qNum: 0.7268382531119179,
},
],
},
},
{
qText: '0.75089664166938',
qNum: 0.7508966416693837,
qElemNumber: 0,
qState: 'L',
},
{
qText: '0.47008827732022',
qNum: 0.470088277320217,
qElemNumber: 0,
qState: 'L',
},
],
Similar blocks of code found in 5 locations. Consider refactoring.
[
{
qText: 'Meat',
qNum: 'NaN',
qElemNumber: 15,
qState: 'S',
},
{
qText: '0.64531670824846',
qNum: 0.6453167082484631,
qElemNumber: 0,
qState: 'L',
qAttrExps: {
qValues: [
{
qNum: 0.6453167082484631,
},
],
},
},
{
qText: '0.76141078838174',
qNum: 0.7614107883817427,
qElemNumber: 0,
qState: 'L',
},
{
qText: '0.49049479856517',
qNum: 0.4904947985651695,
qElemNumber: 0,
qState: 'L',
},
],
],
qTails: [
{
qUp: 0,
qDown: 0,
},
],
qArea: {
qLeft: 0,
qTop: 0,
qWidth: 4,
qHeight: 5,
},
},
],
qPivotDataPages: [],
qStackedDataPages: [],
qMode: 'S',
qNoOfLeftDims: -1,
customErrorMessage: {
calcCond: '',
},
},
};
global.picData = global.picData || {};
global.picData.qProducts = {
type: 'q',
data: qLayout.qHyperCube,
};
})(window);