Showing 54 of 203 total issues
Avoid too many return
statements within this function. Open
return resolve({
message: getDefaultMessage(translator),
ok: true,
});
Avoid too many return
statements within this function. Open
return { message: data };
Avoid too many return
statements within this function. Open
return resolve({
message: getDefaultMessage(translator),
ok: true,
});
Avoid too many return
statements within this function. Open
return defaultMessage;
Avoid too many return
statements within this function. Open
return resolve({ ...parseOutput(automationRun.title, translator), ok: true });
Avoid too many return
statements within this function. Open
return defaultMessage;
Avoid too many return
statements within this function. Open
return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
Avoid too many return
statements within this function. Open
return resolve({
message: getTranslation(translator, "Object.ActionButton.Automation.DefaultAutomationMsg", "Unknown error"),
ok: false,
});
Avoid too many return
statements within this function. Open
return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
Avoid too many return
statements within this function. Open
return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
Function runActions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const runActions = async ({ actionCallList, model, layout, app }) => {
const properties = await model.getEffectiveProperties();
for (let i = 0; i < actionCallList.length; i++) {
if (layout.runtimeExpressionEvaluation) {
const overrideValue =
- 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 adjustFontSizeBehavior
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const adjustFontSizeBehavior = (button, font, text, textSpan, hasIcon) => {
if (font.sizeBehavior === "fixed") {
// The font size is independent of the box size and the length of the text
text.style.fontSize = `${font.sizeFixed || DEFAULTS.FONT_SIZE_FIXED}px`;
setFontSizeBehaviorStyle(button, text, textSpan, hasIcon);
- 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 getBackgroundStyle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getBackgroundStyle = (background, theme, app, formatProperty) => {
let styles = formatProperty("background-color", getBackgroundColor(background, theme));
if ((background.useImage || background.mode === "media") && background.url.qStaticContentUrl) {
let bgUrl = background.url.qStaticContentUrl.qUrl;
if (bgUrl) {
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const pollAutomationAndGetMsg = async (automationId, triggered, response, translator) => {
let message;
switch (response.status) {
case 200:
case 201: {
- 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"