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,
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 = ''
- Read upRead up
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) {
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,
Function getChartConfiguration
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getChartConfiguration(
favoriteSettings: any,
renderId: string,
visualizationLayout: any,
customChartType: string = ''
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);
Function getSanitizedAnalyticsMetadataItems
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSanitizedAnalyticsMetadataItems(
favorite: Favorite,
analytics: Analytics
) {
const sanitizedItems = [];
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) {
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) {
- Read upRead up
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,
- Read upRead up
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 = [];
/**
Function mapAnalyticsToCumulativeFormat
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mapAnalyticsToCumulativeFormat(
analyticsObject: any,
xAxisType,
yAxisType
) {
Function getSeriesData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSeriesData(
analyticsObject: any,
chartConfiguration: any,
yAxisItemId: string,
xAxisItems: any[]
Function getXAxisOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getXAxisOptions(
xAxisCategories: any[],
chartConfiguration: ChartConfiguration
) {
let xAxisOptions = {};
Function getSeriesValue
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSeriesValue(
analyticsRows,
yAxisItemIndex,
yAxisItemId,
xAxisItemIndex,
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 = [];
Function updateSeriesWithAxisOptions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateSeriesWithAxisOptions(
series: any[],
multiAxisOptions: any[],
touched: boolean = false
) {
Function extendOtherChartOptions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function extendOtherChartOptions(
initialChartObject: any,
analyticsObject: any,
chartConfiguration: any
): any {
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) {
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,
- Read upRead up
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"