netdata/netdata

View on GitHub
src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js

Summary

Maintainability
F
2 wks
Test Coverage

File d3pie-0.2.1-netdata-3.js has 1606 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * d3pie
 * @author Ben Keen
 * @version 0.1.9
 * @date June 17th, 2015
Severity: Major
Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 4 days to fix

    Function extend has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var extend = function() {
        var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},
            i = 1,
            length = arguments.length,
            deep = false,
    Severity: Major
    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 3 hrs to fix

      Function _init has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var _init = function() {
      
              // prep-work
              this.svg = helpers.addSVGSpace(this);
      
      
      Severity: Major
      Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 3 hrs to fix

        Function add has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            add: function(pie, section, sectionDisplayType) {
                var include = labels.getIncludes(sectionDisplayType);
                var settings = pie.options.labels;
        
                // group the label groups (label, percentage, value) into a single element for simpler positioning
        Severity: Major
        Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 3 hrs to fix

          Function addSegmentEventHandlers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              addSegmentEventHandlers: function(pie) {
                  var arc = pie.svg.selectAll("." + pie.cssPrefix + "arc");
                  arc = arc.merge(pie.__labels.inner.merge(pie.__labels.outer));
          
                  arc.on("click", function() {
          Severity: Major
          Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 2 hrs to fix

            Function computeLinePosition has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                computeLinePosition: function(pie, i) {
                    var angle = segments.getSegmentAngle(i, pie.options.data.content, pie.totalSize, { midpoint: true });
                    var originCoords = math.rotate(pie.pieCenter.x, pie.pieCenter.y - pie.outerRadius, pie.pieCenter.x, pie.pieCenter.y, angle);
                    var heightOffset = pie.outerLabelGroupData[i].h / 5; // TODO check
                    var labelXMargin = 6; // the x-distance of the label from the end of the line [TODO configurable]
            Severity: Minor
            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 2 hrs to fix

              Function addTooltips has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  addTooltips: function(pie) {
              
                  // group the label groups (label, percentage, value) into a single element for simpler positioning
                  var tooltips = pie.svg.insert("g")
                      .attr("class", pie.cssPrefix + "tooltips");
              Severity: Minor
              Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                Function create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    create: function(pie) {
                        var pieCenter = pie.pieCenter;
                        var colors = pie.options.colors;
                        var loadEffects = pie.options.effects.load;
                        var segmentStroke = pie.options.misc.colors.segmentStroke;
                Severity: Minor
                Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                  Function computePieRadius has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      computePieRadius: function(pie) {
                          var size = pie.options.size;
                          var canvasPadding = pie.options.misc.canvasPadding;
                  
                          // outer radius is either specified (e.g. through the generator), or omitted altogether
                  Severity: Minor
                  Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                    Function checkConflict has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        checkConflict: function(pie, currIndex, direction, size) {
                        var i, curr;
                    
                            if (size <= 1) {
                                return;
                    Severity: Minor
                    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                      Function initialCheck has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          initialCheck: function(pie) {
                              var cssPrefix = pie.cssPrefix;
                              var element = pie.element;
                              var options = pie.options;
                      
                      
                      Severity: Minor
                      Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                        Function applySmallSegmentGrouping has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            applySmallSegmentGrouping: function(data, smallSegmentGrouping) {
                                var totalSize;
                                if (smallSegmentGrouping.valueType === "percentage") {
                                    totalSize = math.getTotalPieSize(data);
                                }
                        Severity: Minor
                        Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                          Function updateProp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              d3pie.prototype.updateProp = function(propKey, value) {
                                  switch (propKey) {
                                      case "header.title.text":
                                          var oldVal = helpers.processObj(this.options, propKey);
                                          helpers.processObj(this.options, propKey, value);
                          Severity: Minor
                          Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                            Function positionLabelElements has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                positionLabelElements: function(pie, section, sectionDisplayType) {
                                    labels["dimensions-" + section] = [];
                            
                                    // get the latest widths, heights
                                    var labelGroups = pie.__labels[section];
                            Severity: Minor
                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                              Function positionLabelGroups has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  positionLabelGroups: function(pie, section) {
                                      if (pie.options.labels[section].format === "none")
                                          return;
                              
                                      pie.__labels[section]
                              Severity: Minor
                              Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                Function getIncludes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    getIncludes: function(val) {
                                        var addMainLabel  = false;
                                        var addValue      = false;
                                        var addPercentage = false;
                                
                                
                                Severity: Minor
                                Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (copyIsArray) {
                                                          copyIsArray = false;
                                                          clone = src && jQuery.isArray(src) ? src : [];
                                                      } else {
                                                          clone = src && jQuery.isPlainObject(src) ? src : {};
                                  Severity: Major
                                  Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    } else if (copy !== undefined) {
                                                        target[name] = copy;
                                                    }
                                    Severity: Major
                                    Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 45 mins to fix

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

                                          rotate: function(x, y, xm, ym, a) {
                                      Severity: Minor
                                      Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 35 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return false;
                                        Severity: Major
                                        Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return true;
                                          Severity: Major
                                          Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 30 mins to fix

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

                                                        case "header.title.text":
                                                            var oldVal = helpers.processObj(this.options, propKey);
                                                            helpers.processObj(this.options, propKey, value);
                                                            d3.select("#" + this.cssPrefix + "title").html(value);
                                                            if ((oldVal === "" && value !== "") || (oldVal !== "" && value === "")) {
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 4 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1932..1939

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

                                            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

                                                        case "header.subtitle.text":
                                                            var oldValue = helpers.processObj(this.options, propKey);
                                                            helpers.processObj(this.options, propKey, value);
                                                            d3.select("#" + this.cssPrefix + "subtitle").html(value);
                                                            if ((oldValue === "" && value !== "") || (oldValue !== "" && value === "")) {
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 4 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1923..1930

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

                                            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 (currentEl.attr("class") === pie.cssPrefix + "arc") {
                                                            segment = currentEl.select("path");
                                                        } else {
                                                            index = currentEl.attr("data-index");
                                                            segment = d3.select("#" + pie.cssPrefix + "segment" + index);
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1359..1364

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

                                            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 (currentEl.attr("class") === pie.cssPrefix + "arc") {
                                                            segment = currentEl.select("path");
                                                        } else {
                                                            index = currentEl.attr("data-index");
                                                            segment = d3.select("#" + pie.cssPrefix + "segment" + index);
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1389..1394

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

                                            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

                                                    pie.__title = pie.svg.selectAll("." + pie.cssPrefix + "title")
                                                        .data([pie.options.header.title])
                                                        .enter()
                                                        .append("text")
                                                        .text(function(d) { return d.text; })
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1593..1598

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

                                            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

                                                    pie.__subtitle = pie.svg.selectAll("." + pie.cssPrefix + "subtitle")
                                                        .data([pie.options.header.subtitle])
                                                        .enter()
                                                        .append("text")
                                                        .text(function(d) { return d.text; })
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1530..1535

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

                                            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

                                                        for (; i<=currIndex; i++) {
                                                            curr = pie.outerLabelGroupData[i];
                                            
                                                            // if there's a conflict with this label group, shift the label to be AFTER the last known
                                                            // one that's been properly placed
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1150..1159

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

                                            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

                                                        for (; i >= currIndex; i--) {
                                                            curr = pie.outerLabelGroupData[i];
                                            
                                                            // if there's a conflict with this label group, shift the label to be AFTER the last known
                                                            // one that's been properly placed
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1138..1147

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

                                            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

                                                    if (self.textComponents.title.exists) {
                                                        var d1 = helpers.getDimensions(self.__title.node());
                                                        self.textComponents.title.h = d1.h;
                                                        self.textComponents.title.w = d1.w;
                                                    }
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 2040..2044

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

                                            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

                                                    if (self.textComponents.subtitle.exists) {
                                                        var d2 = helpers.getDimensions(self.__subtitle.node());
                                                        self.textComponents.subtitle.h = d2.h;
                                                        self.textComponents.subtitle.w = d2.w;
                                                    }
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 2 hrs to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 2034..2038

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

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

                                                        labelGroup.append("text")
                                                            .attr("id", function(d, i) { return pie.cssPrefix + "segmentMainLabel" + i + "-" + section; })
                                                            .attr("class", pie.cssPrefix + "segmentMainLabel-" + section)
                                                            .text(function(d, i) {
                                                                var str = d.label;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 2 other locations - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 816..831
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 840..849

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

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

                                                        labelGroup.append("text")
                                                            .attr("id", function(d, i) { return pie.cssPrefix + "segmentPercentage" + i + "-" + section; })
                                                            .attr("class", pie.cssPrefix + "segmentPercentage-" + section)
                                                            .text(function(d, i) {
                                                                var percentage = d.percentage;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 2 other locations - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 787..805
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 840..849

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

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

                                                        labelGroup.append("text")
                                                            .attr("id", function(d, i) { return pie.cssPrefix +  "segmentValue" + i + "-" + section; })
                                                            .attr("class", pie.cssPrefix + "segmentValue-" + section)
                                                            .text(function(d, i) {
                                                                formatterContext.index = i;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 2 other locations - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 787..805
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 816..831

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

                                            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

                                                    var g = pieChartElement.selectAll("." + pie.cssPrefix + "arc")
                                                        .data(pie.options.data.content)
                                                        .enter()
                                                        .append("g")
                                                        .attr("class", pie.cssPrefix + "arc");
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1715..1719

                                            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

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

                                                tooltips.selectAll("." + pie.cssPrefix + "tooltip")
                                                    .data(pie.options.data.content)
                                                    .enter()
                                                    .append("g")
                                                    .attr("class", pie.cssPrefix + "tooltip")
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1262..1266

                                            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

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

                                                        case "label-value1":
                                                            pie.svg.selectAll("." + pie.cssPrefix + "segmentValue-" + section)
                                                                .attr("dx", function(d, i) { return dims[i].mainLabel.width + singleLinePad; });
                                                            break;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 888..891

                                            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

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

                                                        case "label-percentage1":
                                                            pie.svg.selectAll("." + pie.cssPrefix + "segmentPercentage-" + section)
                                                                .attr("dx", function(d, i) { return dims[i].mainLabel.width + singleLinePad; });
                                                            break;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 880..883

                                            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

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

                                                    tooltips.selectAll("." + pie.cssPrefix + "tooltip rect")
                                                        .attr("width", function (d, i) {
                                                            var dims = helpers.getDimensions(pie.cssPrefix + "tooltip" + i);
                                                            return dims.w + (2 * pie.options.tooltips.styles.padding);
                                                        })
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1748..1756

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

                                            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

                                                        case "label-desc":
                                                            data.sort(function(a, b) { return (a.label.toLowerCase() < b.label.toLowerCase()) ? 1 : -1; });
                                                            break;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 650..652

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

                                            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

                                                        case "label-asc":
                                                            data.sort(function(a, b) { return (a.label.toLowerCase() > b.label.toLowerCase()) ? 1 : -1; });
                                                            break;
                                            Severity: Major
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 1 hr to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 653..655

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

                                            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

                                                            if (pie.options.misc.gradient.enabled) {
                                                                color = "url(#" + pie.cssPrefix + "grad" + index + ")";
                                                            }
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 45 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1278..1280

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

                                            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

                                                            if (pie.options.misc.gradient.enabled) {
                                                                color = "url(#" + pie.cssPrefix + "grad" + i + ")";
                                                            }
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 45 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1399..1401

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

                                            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

                                                            y2 = pie.outerLabelGroupData[i].y + ((originCoords.y - pie.outerLabelGroupData[i].y) / midPoint);
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 35 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 944..944

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

                                            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

                                                            y2 = pie.outerLabelGroupData[i].y + (originCoords.y - pie.outerLabelGroupData[i].y) / midPoint;
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 35 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 924..924

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

                                            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

                                                        if (pie.options.tooltips.enabled) {
                                                            index = segment.attr("data-index");
                                                            tt.showTooltip(pie, index);
                                                        }
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 35 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1405..1408

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

                                            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

                                                        if (pie.options.tooltips.enabled) {
                                                            index = segment.attr("data-index");
                                                            tt.hideTooltip(pie, index);
                                                        }
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 35 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1372..1375

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

                                            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

                                                            var isHidden = (percentage !== null && d.percentage < percentage) || pie.options.data.content[i].label === "";
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 30 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1166..1166

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

                                            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

                                                        headerOffset += pie.textComponents.title.h + pie.options.header.titleSubtitlePadding + pie.textComponents.subtitle.h;
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 30 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 1689..1689

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

                                            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

                                                        var totalTitleHeight = pie.textComponents.title.h + pie.options.header.titleSubtitlePadding + pie.textComponents.subtitle.h;
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 30 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 678..678

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

                                            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

                                                    return (percentage !== null && d.percentage < percentage) || pie.options.data.content[index].label === "";
                                            Severity: Minor
                                            Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js and 1 other location - About 30 mins to fix
                                            src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js on lines 994..994

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

                                            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