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

View on GitHub

Showing 42 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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    export class ExtensionEffects implements OnInitEffects {
        constructor(
            private actions$: Actions,
            private extensionService: ExtensionService
        ) { }
    Severity: Major
    Found in src/app/store/effects/extension.effect.ts and 2 other locations - About 6 hrs to fix
    src/app/store/effects/analytics.effect.ts on lines 21..46
    src/app/store/effects/favorite.effect.ts on lines 15..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 168.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    export class FavoriteEffects implements OnInitEffects {
        constructor(
            private actions$: Actions,
            private favoriteService: FavoriteService
        ) { }
    Severity: Major
    Found in src/app/store/effects/favorite.effect.ts and 2 other locations - About 6 hrs to fix
    src/app/store/effects/analytics.effect.ts on lines 21..46
    src/app/store/effects/extension.effect.ts on lines 15..40

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 168.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    export class AnalyticsEffects implements OnInitEffects {
        constructor(
            private actions$: Actions,
            private analyticsService: AnalyticsService
        ) { }
    Severity: Major
    Found in src/app/store/effects/analytics.effect.ts and 2 other locations - About 6 hrs to fix
    src/app/store/effects/extension.effect.ts on lines 15..40
    src/app/store/effects/favorite.effect.ts on lines 15..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 168.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    function getAllowedChartType(chartType: string): string {
        let newChartType = '';
        switch (chartType) {
            case 'radar':
                newChartType = 'line';
    Severity: Major
    Found in src/app/core/helpers/draw-visualization.helper.ts and 1 other location - About 3 hrs to fix
    src/app/core/helpers/draw-chart.helper.ts on lines 628..644

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    function getAllowedChartType(chartType: string): string {
        let newChartType = '';
        switch (chartType) {
            case 'radar':
                newChartType = 'line';
    Severity: Major
    Found in src/app/core/helpers/draw-chart.helper.ts and 1 other location - About 3 hrs to fix
    src/app/core/helpers/draw-visualization.helper.ts on lines 256..272

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 108.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              newSeries = _.map(newSeries, seriesObject => {
                  const newSeriesObject: any = { ...seriesObject };
      
                  if (seriesCategories.length > 0) {
                      newSeriesObject.data = [
      Severity: Major
      Found in src/app/core/helpers/draw-chart.helper.ts and 1 other location - About 3 hrs to fix
      src/app/core/helpers/draw-chart.helper.ts on lines 312..323

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 99.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              newSeries = _.map(series, seriesObject => {
                  const newSeriesObject: any = { ...seriesObject };
      
                  if (seriesCategories.length > 0) {
                      newSeriesObject.data = [
      Severity: Major
      Found in src/app/core/helpers/draw-chart.helper.ts and 1 other location - About 3 hrs to fix
      src/app/core/helpers/draw-chart.helper.ts on lines 294..306

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 99.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export const reducer = createReducer(
            initialSystemInfoState,
            on(loadSystemInfo, state => ({
              ...state,
              ...loadingBaseState
          Severity: Major
          Found in src/app/store/reducers/system-info.reducer.ts and 4 other locations - About 2 hrs to fix
          src/app/store/reducers/analytics.reducer.ts on lines 6..22
          src/app/store/reducers/extension.reducer.ts on lines 6..22
          src/app/store/reducers/favorite.reducer.ts on lines 14..30
          src/app/store/reducers/user.reducer.ts on lines 15..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 89.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export const reducer = createReducer(
            initialUserState,
            on(loadCurrentUser, state => ({
              ...state,
              ...loadingBaseState
          Severity: Major
          Found in src/app/store/reducers/user.reducer.ts and 4 other locations - About 2 hrs to fix
          src/app/store/reducers/analytics.reducer.ts on lines 6..22
          src/app/store/reducers/extension.reducer.ts on lines 6..22
          src/app/store/reducers/favorite.reducer.ts on lines 14..30
          src/app/store/reducers/system-info.reducer.ts on lines 14..30

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 89.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export const reducer = createReducer(
              initialAnalyticsState,
              on(LoadFavoriteAnalytics, state => ({
                  ...state,
                  ...loadingBaseState
          Severity: Major
          Found in src/app/store/reducers/analytics.reducer.ts and 4 other locations - About 2 hrs to fix
          src/app/store/reducers/extension.reducer.ts on lines 6..22
          src/app/store/reducers/favorite.reducer.ts on lines 14..30
          src/app/store/reducers/system-info.reducer.ts on lines 14..30
          src/app/store/reducers/user.reducer.ts on lines 15..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 89.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export const reducer = createReducer(
              initialFavoriteState,
              on(LoadFavorite, state => ({
                  ...state,
                  ...loadingBaseState,
          Severity: Major
          Found in src/app/store/reducers/favorite.reducer.ts and 4 other locations - About 2 hrs to fix
          src/app/store/reducers/analytics.reducer.ts on lines 6..22
          src/app/store/reducers/extension.reducer.ts on lines 6..22
          src/app/store/reducers/system-info.reducer.ts on lines 14..30
          src/app/store/reducers/user.reducer.ts on lines 15..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 89.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

          export const reducer = createReducer(
              initialExtensionState,
              on(LoadFavoriteExtension, state => ({
                  ...state,
                  ...loadingBaseState
          Severity: Major
          Found in src/app/store/reducers/extension.reducer.ts and 4 other locations - About 2 hrs to fix
          src/app/store/reducers/analytics.reducer.ts on lines 6..22
          src/app/store/reducers/favorite.reducer.ts on lines 14..30
          src/app/store/reducers/system-info.reducer.ts on lines 14..30
          src/app/store/reducers/user.reducer.ts on lines 15..31

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 89.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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
                Severity
                Category
                Status
                Source
                Language