hisptz/90-90-90-cascade-graph-widget

View on GitHub

Showing 26 of 42 total issues

Function getChartSubtitleObject has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function getChartSubtitleObject(
    chartConfiguration: any,
    analyticsObject: any
): any {
    if (chartConfiguration.hideSubtitle) {
Severity: Minor
Found in src/app/core/helpers/draw-visualization.helper.ts - 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 getAxisItemsNew has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getAxisItemsNew(
    analyticsObject: any,
    axisTypeArray: any[],
    isCategory: boolean = false
) {
Severity: Minor
Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

    Function getSeriesValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        analyticsRows,
        yAxisItemIndex,
        yAxisItemId,
        xAxisItemIndex,
        xAxisItemId,
    Severity: Minor
    Found in src/app/core/helpers/draw-chart.helper.ts - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if (parentCategory) {
                                          const parentCategoryIndex = _.findIndex(
                                              newCategoryArray,
                                              parentCategory
                                          );
      Severity: Major
      Found in src/app/core/helpers/draw-chart.helper.ts - About 45 mins to fix

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

        function getTooltipOptions(chartConfiguration: any) {
            const tooltipChartType = getAllowedChartType(chartConfiguration.type);
            let tooltipObject: any = {};
        
            if (tooltipChartType) {
        Severity: Minor
        Found in src/app/core/helpers/draw-visualization.helper.ts - 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 getXAxisOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function getXAxisOptions(
            xAxisCategories: any[],
            chartConfiguration: ChartConfiguration
        ) {
            let xAxisOptions = {};
        Severity: Minor
        Found in src/app/core/helpers/draw-chart.helper.ts - 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