qlik-oss/sn-org-chart

View on GitHub

Showing 34 of 79 total issues

Function createStylingDefinition has 191 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function getSettings has 155 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const getSettings = (translator, flags, anything) => {
      const theme = anything?.sense?.theme;
      const settings = {
        uses: "settings",
        items: {
    Severity: Major
    Found in src/extension/ext-raw.js - About 6 hrs to fix

      Function supernova has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function component has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            component: () => {
              const layout = useStaleLayout();
              const model = useModel();
              const element = useElement();
              const Theme = useTheme();
        Severity: Major
        Found in src/index.js - About 3 hrs to fix

          File nebula.config.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // nebula.config.js
          module.exports = {
            build: {},
            serve: {
              open: false,
          Severity: Minor
          Found in nebula.config.js - About 3 hrs to fix

            Function selectionHandler has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function selectionHandler(translator) {
              const [singleSelect, setSingleSelect] = useState(false);
              const selectionsAPI = useSelections();
              const isInSelections = !!useLayout().qSelectionInfo.qInSelections;
              const [selectionObj] = useState({
            Severity: Major
            Found in src/selections-handler.js - About 3 hrs to fix

              File ext-raw.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import DEFAULTS from "../style-defaults";
              import propertyResolver from "../utils/property-resolver";
              import migrateStyle from "./migration";
              import createStylingDefinition from "./styling-definitions/styling-definition";
              
              
              Severity: Minor
              Found in src/extension/ext-raw.js - About 3 hrs to fix

                Function createNodes has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
                  const nodeMap = {};
                  const allNodes = [];
                  for (let i = 0; i < matrix.length; ++i) {
                    const row = matrix[i];
                Severity: Major
                Found in src/utils/tree-utils.js - About 2 hrs to fix

                  Function select has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                    select: (node, selectionObj) => {
                      const { api, state, singleSelect, setState } = selectionObj;
                      if (node && api) {
                        let newState;
                        if (node.data.elemNo < 0 && node.data.elemNo !== -3) {
                  Severity: Minor
                  Found in src/utils/selections.js - About 2 hrs 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 getPoints has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function getPoints(d, topId, { depthSpacing, isVertical, x, y }, navigationMode) {
                    // TODO: Generalize to make all directions work, currently on only ttb working
                    const { cardWidth, cardHeight, buttonHeight, cardPadding, buttonMargin } = constants;
                    const points = [];
                    const halfCard = { x: cardWidth / 2, y: cardHeight / 2 };
                  Severity: Minor
                  Found in src/tree/path.js - About 2 hrs 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

                  File tree-utils.spec.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import defaultValues from "../../__tests__/default-orgchart-props";
                  import transform, {
                    anyCycle,
                    createNodes,
                    fetchPage,
                  Severity: Minor
                  Found in src/utils/__tests__/tree-utils.spec.js - About 2 hrs to fix

                    Function createNodes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function createNodes(matrix, attributeIndecies, status, navigationMode, translator) {
                      const nodeMap = {};
                      const allNodes = [];
                      for (let i = 0; i < matrix.length; ++i) {
                        const row = matrix[i];
                    Severity: Minor
                    Found in src/utils/tree-utils.js - About 2 hrs 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 select has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      select: (node, selectionObj) => {
                        const { api, state, singleSelect, setState } = selectionObj;
                        if (node && api) {
                          let newState;
                          if (node.data.elemNo < 0 && node.data.elemNo !== -3) {
                    Severity: Minor
                    Found in src/utils/selections.js - About 1 hr to fix

                      Function widthTranslation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const widthTranslation = (d, widthSpacing, element, axis, initialZoomState, navigationMode) => {
                        const { buttonMargin } = constants;
                        const initialX = (initialZoomState && initialZoomState.initialX) || 0;
                        if (navigationMode === "expandAll") {
                          d[axis] = d.x + initialX;
                      Severity: Minor
                      Found in src/tree/position.js - About 1 hr 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 createContainer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const createContainer = ({
                        element,
                        dataTree,
                        selectionObj,
                        wrapperState,
                      Severity: Minor
                      Found in src/tree/render.js - About 1 hr 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 anyCycle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function anyCycle(nodes) {
                        const visited = {};
                        const marked = {};
                        function isCycleUtil(node) {
                          visited[node.id] = true;
                      Severity: Minor
                      Found in src/utils/tree-utils.js - About 1 hr 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 getNewState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const getNewState = (d, { topId, isExpanded, expandedChildren }, ancestorIds) => {
                        if (d.data.id === topId) {
                          // top
                          isExpanded = !isExpanded;
                          expandedChildren = [];
                      Severity: Minor
                      Found in src/tree/box.js - About 1 hr 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 validateFiles has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const validateFiles = (pkg) => {
                        const whitelist = [
                          "name",
                          "version",
                          "description",
                      Severity: Minor
                      Found in tools/validate-nebula-package.js - About 1 hr to fix

                        Function getDarkColor has 27 lines of code (exceeds 25 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 1 hr to fix

                          Function openTooltip has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export function openTooltip(tooltip, d, containerHeight, styling, x, y, transform, delay = 250) {
                          Severity: Major
                          Found in src/tree/tooltip.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language