sentilo/sentilo

View on GitHub
sentilo-catalog-web/src/main/webapp/static/js/chartist-plugin-legend.js

Summary

Maintainability
D
1 day
Test Coverage

Function legend has 152 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Chartist.plugins.legend = function (options) {

        // Catch invalid options
        if (options && options.position) {
            if (!(options.position === 'top' || options.position === 'bottom' || options.position instanceof HTMLElement)) {

    Function legend has 137 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            return function legend(chart) {
    
                function removeLegendElement() {
                    var legendElement = chart.container.querySelector('.ct-legend');
                    if (legendElement) {

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

                  function addClickHandler(legendElement, legends, seriesMetadata, useLabels) {
                      legendElement.addEventListener('click', function(e) {
                          var li = e.target;
                          if (li.parentNode !== legendElement || !li.hasAttribute('data-legend'))
                              return;

        There are no issues that match your filters.

        Category
        Status