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

View on GitHub

Showing 26 of 42 total issues

File draw-chart.helper.ts has 556 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { ChartConfiguration } from '../models/chart-configuration.model';
import * as _ from 'lodash';

export function extendOtherChartOptions(
    initialChartObject: any,
Severity: Major
Found in src/app/core/helpers/draw-chart.helper.ts - About 1 day to fix

    Function getChartConfiguration has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    export function getChartConfiguration(
        favoriteSettings: any,
        renderId: string,
        visualizationLayout: any,
        customChartType: string = ''
    Severity: Minor
    Found in src/app/core/helpers/configuration.helpers.ts - About 3 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 getYAxisOptions has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getYAxisOptions(chartConfiguration: any) {
        const yAxes: any[] = chartConfiguration.axes;
        let newYAxes: any[] = [];
    
        if (yAxes.length === 0) {
    Severity: Major
    Found in src/app/core/helpers/draw-chart.helper.ts - About 3 hrs to fix

      Function getRefinedXAxisCategories has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getRefinedXAxisCategories(series: any[]) {
          let newCategories: any[] = [];
          if (series) {
              const seriesDataObjects = _.map(
                  series,
      Severity: Major
      Found in src/app/core/helpers/draw-chart.helper.ts - About 3 hrs to fix

        Function getChartConfiguration has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getChartConfiguration(
            favoriteSettings: any,
            renderId: string,
            visualizationLayout: any,
            customChartType: string = ''
        Severity: Major
        Found in src/app/core/helpers/configuration.helpers.ts - About 2 hrs to fix

          Function ngOnInit has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            ngOnInit() {
              this.store.dispatch(LoadFavorite());
              this.favorite$ = this.store.select(getFavorites);
              this.analytics$ = this.store.select(getAnalytics);
              this.extension$ = this.store.select(getExtension);
          Severity: Major
          Found in src/app/pages/home/pages/home/home.component.ts - About 2 hrs to fix

            Function getSanitizedAnalyticsMetadataItems has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function getSanitizedAnalyticsMetadataItems(
                favorite: Favorite,
                analytics: Analytics
            ) {
                const sanitizedItems = [];
            Severity: Major
            Found in src/app/core/helpers/sanitize-analytics.ts - About 2 hrs to fix

              Function getPlotOptions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getPlotOptions(chartConfiguration: any) {
                  const plotOptionChartType = getAllowedChartType(chartConfiguration.type);
              
                  const plotOptions = {};
                  if (plotOptionChartType) {
              Severity: Major
              Found in src/app/core/helpers/draw-visualization.helper.ts - About 2 hrs to fix

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

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

                function getSeriesValue(
                    analyticsRows,
                    yAxisItemIndex,
                    yAxisItemId,
                    xAxisItemIndex,
                Severity: Minor
                Found in src/app/core/helpers/draw-chart.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 getSortableSeries has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function getSortableSeries(series, sortOrder) {
                    let newSeries = [...series];
                    let seriesCategories = [];
                
                    /**
                Severity: Minor
                Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

                  Function mapAnalyticsToCumulativeFormat has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function mapAnalyticsToCumulativeFormat(
                      analyticsObject: any,
                      xAxisType,
                      yAxisType
                  ) {
                  Severity: Minor
                  Found in src/app/core/helpers/sanitize-analytics.ts - About 1 hr to fix

                    Function getSeriesData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getSeriesData(
                        analyticsObject: any,
                        chartConfiguration: any,
                        yAxisItemId: string,
                        xAxisItems: any[]
                    Severity: Minor
                    Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

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

                        Function getSeriesValue has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getSeriesValue(
                            analyticsRows,
                            yAxisItemIndex,
                            yAxisItemId,
                            xAxisItemIndex,
                        Severity: Minor
                        Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

                          Function seriesCategoryNamesArray has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                      const seriesCategoryNamesArray = _.map(seriesDataObjects, seriesData => {
                                          return _.map(seriesData, data => {
                                              // const nameArray = data.name.split('_');
                                              const nameArray = [data.name];
                                              const newCategoryArray = [];
                          Severity: Minor
                          Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

                            Function updateSeriesWithAxisOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function extendOtherChartOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function extendOtherChartOptions(
                                  initialChartObject: any,
                                  analyticsObject: any,
                                  chartConfiguration: any
                              ): any {
                              Severity: Minor
                              Found in src/app/core/helpers/draw-chart.helper.ts - About 1 hr to fix

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

                                  Function getRefinedXAxisCategories has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function getRefinedXAxisCategories(series: any[]) {
                                      let newCategories: any[] = [];
                                      if (series) {
                                          const seriesDataObjects = _.map(
                                              series,
                                  Severity: Minor
                                  Found in src/app/core/helpers/draw-chart.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language