qlik-oss/sn-org-chart

View on GitHub

Showing 34 of 79 total issues

Function fetchPage has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

export async function fetchPage(dataPages, dataMatrix, model, fullHeight, currentRow, callNum, maxCalls) {
Severity: Major
Found in src/utils/tree-utils.js - About 50 mins to fix

    Function resolveExpression has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      resolveExpression: (input) => {
        // rgb
        let matches = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(input);
        if (matches) {
          return `rgb(${matches[1]},${matches[2]},${matches[3]})`;
    Severity: Minor
    Found in src/utils/color-utils.js - About 45 mins to fix

    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 transform has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export default function transform(nodes, width, height, svg, divBox, useTransitions) {
    Severity: Minor
    Found in src/tree/transform.js - About 45 mins to fix

      Function createStylingDefinition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function createStylingDefinition(theme, flags, translator) {
        const fontResolver = createFontResolver({
          theme,
          translator,
          flags,
      Severity: Minor
      Found in src/extension/styling-definitions/styling-definition.js - About 45 mins to fix

      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 supernova has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function supernova(env) {
        return {
          qae: {
            properties,
            data,
      Severity: Minor
      Found in src/index.js - About 45 mins to fix

      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

      Consider simplifying this complex logical expression.
      Open

        if (
          (d.data.id === topId && isExpanded) ||
          (d.parent && d.parent.data.id === topId && expandedChildren.includes(d.data.id)) ||
          ancestorIds.includes(d.data.id)
        ) {
      Severity: Major
      Found in src/tree/box.js - About 40 mins to fix

        Function getTooltipStyle has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function getTooltipStyle(d, containerHeight, x, y, transform) {
        Severity: Minor
        Found in src/tree/tooltip.js - About 35 mins to fix

          Function createNodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
          Severity: Minor
          Found in src/utils/tree-utils.js - About 35 mins to fix

            Function snapshot has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export default function snapshot(expandedState, containerData, layout, transform, initialZoom) {
            Severity: Minor
            Found in src/snapshot.js - About 35 mins to fix

              Function getDarkColor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                getDarkColor(color) {
                  const percent = 0.5;
                  let f;
                  let R;
                  let B;
              Severity: Minor
              Found in src/utils/color-utils.js - About 35 mins to fix

              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

              Avoid too many return statements within this function.
              Open

                  return "none";
              Severity: Major
              Found in src/utils/color-utils.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return `rgba(${color.r},${color.g},${color.b},${a})`;
                Severity: Major
                Found in src/utils/color-utils.js - About 30 mins to fix

                  Function filterTree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const filterTree = ({ topId, isExpanded, expandedChildren }, nodeTree, extended, navigationMode) => {
                    if (navigationMode === "expandAll") {
                      return nodeTree.descendants();
                    }
                    const topNode = nodeTree.descendants().find((node) => node.data.id === topId) || nodeTree;
                  Severity: Minor
                  Found in src/tree/render.js - About 25 mins to fix

                  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 getTooltipContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getTooltipContent(d, styling) {
                    const label = encodeUtils.encodeTitle(d.data.attributes.label || d.data.id);
                    const subLabel = d.data.attributes.subLabel ? `${encodeUtils.encodeTitle(d.data.attributes.subLabel)}<br />` : "";
                    const extraLabel = d.data.attributes.extraLabel
                      ? `${encodeUtils.encodeTitle(d.data.attributes.extraLabel)}<br />`
                  Severity: Minor
                  Found in src/tree/tooltip.js - About 25 mins to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language