valor-software/ng2-charts

View on GitHub

Showing 39 of 43 total issues

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

describe('RadarChartComponent', () => {
  let component: RadarChartComponent;
  let fixture: ComponentFixture<RadarChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('PolarAreaChartComponent', () => {
  let component: PolarAreaChartComponent;
  let fixture: ComponentFixture<PolarAreaChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('LineChartComponent', () => {
  let component: LineChartComponent;
  let fixture: ComponentFixture<LineChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('DoughnutChartComponent', () => {
  let component: DoughnutChartComponent;
  let fixture: ComponentFixture<DoughnutChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('ScatterChartComponent', () => {
  let component: ScatterChartComponent;
  let fixture: ComponentFixture<ScatterChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('PieChartComponent', () => {
  let component: PieChartComponent;
  let fixture: ComponentFixture<PieChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('DynamicChartComponent', () => {
  let component: DynamicChartComponent;
  let fixture: ComponentFixture<DynamicChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('BubbleChartComponent', () => {
  let component: BubbleChartComponent;
  let fixture: ComponentFixture<BubbleChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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 9 locations. Consider refactoring.
Open

describe('BarChartComponent', () => {
  let component: BarChartComponent;
  let fixture: ComponentFixture<BarChartComponent>;

  beforeEach(waitForAsync(() => {
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.spec.ts on lines 7..30
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.spec.ts on lines 7..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 173.

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

  it('should emit when the chart is clicked', fakeAsync(() => {
    fixture.detectChanges();

    const canvas = fixture.nativeElement.querySelector('canvas');

Severity: Major
Found in libs/ng2-charts/src/lib/base-chart.directive.spec.ts and 1 other location - About 5 hrs to fix
libs/ng2-charts/src/lib/base-chart.directive.spec.ts on lines 126..145

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 137.

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

  it('should emit when the chart is hovered', fakeAsync(() => {
    fixture.detectChanges();

    const canvas = fixture.nativeElement.querySelector('canvas');

Severity: Major
Found in libs/ng2-charts/src/lib/base-chart.directive.spec.ts and 1 other location - About 5 hrs to fix
libs/ng2-charts/src/lib/base-chart.directive.spec.ts on lines 105..124

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 137.

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

        onClick: (event?: ChartEvent, active?: object[]) => {
          if (!this.chartClick.observed && !this.chartClick.observers?.length) {
            return;
          }

Severity: Major
Found in libs/ng2-charts/src/lib/base-chart.directive.ts and 1 other location - About 3 hrs to fix
libs/ng2-charts/src/lib/base-chart.directive.ts on lines 185..191

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 101.

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

        onHover: (event: ChartEvent, active: object[]) => {
          if (!this.chartHover.observed && !this.chartHover.observers?.length) {
            return;
          }

Severity: Major
Found in libs/ng2-charts/src/lib/base-chart.directive.ts and 1 other location - About 3 hrs to fix
libs/ng2-charts/src/lib/base-chart.directive.ts on lines 192..198

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 101.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event?: ChartEvent;
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/pie-chart/pie-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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 9 locations. Consider refactoring.
Open

  public chartClicked({
    event,
    active,
  }: {
    event: ChartEvent;
apps/ng2-charts-demo/src/app/bar-chart/bar-chart.component.ts on lines 46..54
apps/ng2-charts-demo/src/app/bubble-chart/bubble-chart.component.ts on lines 63..71
apps/ng2-charts-demo/src/app/doughnut-chart/doughnut-chart.component.ts on lines 31..39
apps/ng2-charts-demo/src/app/dynamic-chart/dynamic-chart.component.ts on lines 54..62
apps/ng2-charts-demo/src/app/line-chart/line-chart.component.ts on lines 124..132
apps/ng2-charts-demo/src/app/polar-area-chart/polar-area-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/radar-chart/radar-chart.component.ts on lines 36..44
apps/ng2-charts-demo/src/app/scatter-chart/scatter-chart.component.ts on lines 45..53

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 61.

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

Severity
Category
Status
Source
Language