Showing 54 of 203 total issues
File lui-icons.js
has 792 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default [
{
value: "image",
icon: "image",
label: "Image",
File actions.spec.js
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
import actions, { checkShowAction, getActionsList, getValueList } from "../actions";
describe("actions", () => {
const qStateName = "someState";
let app;
File automation-helper.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { encodeForHTML } from "./html-encoder";
import { encodeUrl, getCurrentProtocol, removeProtocolHttp } from "./url-encoder";
import { inIframe } from "./url-utils";
const TRANSITION_TIME = 400;
File ext.spec.js
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ext from "../ext";
import objectProperties from "../object-properties";
describe("ext", () => {
const translator = {
File style-formatter.spec.js
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable prefer-destructuring */
import defaultValues from "../../__tests__/default-button-props";
import { getStyleEditorDefinition } from "../../styling-panel-definition";
import styleFormatter from "../style-formatter";
File ext.js
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getStylingPanelDefinition } from "./styling-panel-definition";
import actions, { checkShowAction, getActionsList } from "./utils/actions";
import getAutomationProps from "./utils/automation-props";
import importProperties from "./utils/conversion";
import luiIcons from "./utils/lui-icons";
File actions.js
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
getAutomationData,
getAutomationUrl,
getPostOptions,
getTemporaryBookmark,
Function getInputBlocks
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getInputBlocks = (bookmark) => {
const inputBlocks = {
blocks: [
{
id: "EB6A372B-3312-4E90-8E8F-88F2A889B4CF",
Function run
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function run() {
function connect() {
const schemaPromise = fetch("https://unpkg.com/enigma.js/schemas/3.2.json").then((response) => response.json());
const openDoc = (appId) =>
File navigation-actions.spec.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import defaultValues from "../../__tests__/default-button-props";
import navigationActions, {
checkShowNavigation,
getNavigationsList,
getOrderedSheets,
File styling-panel-definition.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { fontResolver as createFontResolver } from "qlik-chart-modules";
import styleDefaults from "./style-defaults";
import propertyResolver from "./utils/property-resolver";
import { colorOptions, sizeBehaviorOptions, toggleOptions } from "./utils/style-utils";
Function parseOutput
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export const parseOutput = (data, translator) => {
const defaultMessage = { message: getDefaultMessage(translator) };
if (typeof data !== "undefined") {
if (typeof data === "object") {
if (Array.isArray(data)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pollAutomationAndGetMsg
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const pollAutomationAndGetMsg = async (automationId, triggered, response, translator) => {
let message;
switch (response.status) {
case 200:
case 201: {
Function renderButton
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const renderButton = ({
layout,
theme,
app,
interactions,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function automationRunPolling
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const automationRunPolling = async (automationId, runId, translator, polTimes, resolve) => {
const automationRun = await getAutomationRun(automationId, runId);
switch (automationRun.status) {
case "queued":
case "running":
Function supernova
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function supernova(env) {
const {
sense,
translator,
flags: { isEnabled },
Function createSnackbar
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createSnackbar = (msg, automationOpenLinkSameWindow, error) => {
const { message, url, urlText } = msg;
const encodedMessage = encodeForHTML(message);
const snackContainer = document.createElement("div");
const randomId = (Math.random() + 1).toString(36).substring(7);
Function oldAutomationRun
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const oldAutomationRun = async (automation, automationPostData, app) => {
try {
automation = encodeURIComponent(automation);
const itemInfo = await fetch(`../api/v1/items/${automation}`).then((response) => response.json());
const autoInfo = await fetch(`../api/v1/automations/${itemInfo.resourceId}`).then((response) => response.json());
Function importProperties
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const importProperties = (exportedFmt, initialProperties) => {
const newPropertyTree = { qChildren: [] };
const newProperties = {
actions: [],
// Adding props to avoid errors from old navigation button. Converting to any other chart will still give these errors
Function automationRunPolling
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const automationRunPolling = async (automationId, runId, translator, polTimes, resolve) => {
const automationRun = await getAutomationRun(automationId, runId);
switch (automationRun.status) {
case "queued":
case "running":
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"