polkadot-js/apps

View on GitHub
packages/react-components/src/Chart/HorizBar.tsx

Summary

Maintainability
A
2 hrs
Test Coverage

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

function calculateOptions (aspectRatio: number, values: Value[], jsonValues: string, max: number, showLabels: boolean): State {
  const chartData = values.reduce((data, { colors: [normalColor = '#00f', hoverColor], label, value }): Config => {
    const dataset = data.datasets[0];

    dataset.backgroundColor.push(alphaColor(normalColor));
Severity: Minor
Found in packages/react-components/src/Chart/HorizBar.tsx - About 1 hr to fix

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

    function calculateOptions (aspectRatio: number, values: Value[], jsonValues: string, max: number, showLabels: boolean): State {
    Severity: Minor
    Found in packages/react-components/src/Chart/HorizBar.tsx - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status