public/external/chart.js/dist/chart.js

Summary

Maintainability
F
6 days
Test Coverage

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

function drawBorder(ctx, element, offset, spacing, endAngle, circular) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 45 mins to fix

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

function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 45 mins to fix

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

function renderText(ctx, text, x, y, font, opts = {}) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 45 mins to fix

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

function pathArc(ctx, element, offset, spacing, end, circular) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 45 mins to fix

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

function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 45 mins to fix

Function getAxisItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function getAxisItems(chart, position, axis, intersect, useFinalPosition) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function skip has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function lttbDecimation has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function lttbDecimation(data, start, count, availableWidth, options) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function _measureText has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _measureText(ctx, data, gc, longest, string) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function getIntersectItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function _steppedLineTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _steppedLineTo(ctx, previous, target, flip, mode) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function addScopes has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function addScopes(set, parentScopes, key, parentFallback, value) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function addScopesFromKey has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function addScopesFromKey(set, allScopes, key, fallback, item) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function determineLimits has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function determineLimits(angle, pos, size, min, max) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function determineUnitForFormatting has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function hueValue has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function hueValue(r, g, b, d, max) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function _updateBezierControlPoints has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function updateLimits has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function updateLimits(limits, orig, angle, hLimits, vLimits) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function drawArc has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function drawArc(ctx, element, offset, spacing, circular) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function setBoxDims has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function setBoxDims(box, left, top, width, height) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function drawPointLegend has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function drawPointLegend(ctx, options, x, y, w) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function evaluateInteractionItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function evaluateInteractionItems(chart, axis, position, handler, intersect) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function decorateText has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function decorateText(ctx, x, y, line, opts) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Function _createResolver has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {
Severity: Minor
Found in public/external/chart.js/dist/chart.js - About 35 mins to fix

Avoid too many return statements within this function.
Open

  return _createBoundaryLine(boundary, line);
Severity: Major
Found in public/external/chart.js/dist/chart.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return false;
Severity: Major
Found in public/external/chart.js/dist/chart.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return;
Severity: Major
Found in public/external/chart.js/dist/chart.js - About 30 mins to fix

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

    legend: {
      labels: {
        generateLabels(chart) {
          const data = chart.data;
          if (data.labels.length && data.datasets.length) {
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 day to fix
public/external/chart.js/dist/chart.js on lines 8706..8733

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

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

    legend: {
      labels: {
        generateLabels(chart) {
          const data = chart.data;
          if (data.labels.length && data.datasets.length) {
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 day to fix
public/external/chart.js/dist/chart.js on lines 8430..8457

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

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

    if (opts.reverse) {
      ticks.reverse();
      this.start = this.max;
      this.end = this.min;
    } else {
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 2 hrs to fix
public/external/chart.js/dist/chart.js on lines 12529..12536

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

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

    if (opts.reverse) {
      ticks.reverse();
      this.start = this.max;
      this.end = this.min;
    } else {
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 2 hrs to fix
public/external/chart.js/dist/chart.js on lines 12382..12389

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

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

      if (position === 'center') {
        borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 5606..5612

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

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

      if (position === 'center') {
        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
      } else if (isObject(position)) {
        const positionAxisID = Object.keys(position)[0];
        const value = position[positionAxisID];
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 5618..5624

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

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

    for (let i = data.length - 1; i >= 0; --i) {
      max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);
    }
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 8920..8922

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

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

      for (let i = data.length - 1; i >= 0; --i) {
        max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);
      }
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 8091..8093

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

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

  getPixelForTick(index) {
    const ticks = this.ticks;
    if (index < 0 || index > ticks.length - 1) {
      return null;
    }
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 5505..5511

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

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

  getPixelForTick(index) {
    const ticks = this.ticks;
    if (index < 0 || index > ticks.length - 1) {
      return null;
    }
Severity: Major
Found in public/external/chart.js/dist/chart.js and 1 other location - About 1 hr to fix
public/external/chart.js/dist/chart.js on lines 12180..12186

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

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

There are no issues that match your filters.

Category
Status